MySQL for PHP
Hi, my friend is trying to setup MySQL to work with PHP. He's using WordPress and he already has installed PHP successfully but WordPress gives the following:
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.
He was reviewing this:
http://developers.sun.com/webserver/reference/techart/php2.html
he did things about compiling and something else... but no results. We don't know what to do.
How should he proceed?
thanks in advance
ra鷏
# 3
I assume your mysql installation is working alright, i.e. you can connect to it with mysql command using the same settings provided for your PHP app, right? If so, what are the errors you are getting,
Also, what are you exactly are you trying to accomplish?
Finally, when working with PHP the mysql connectivity is provided completely by PHP and your app. The web server has no contact with MySQL.
# 4
The thing is: my friend has installed Sun Java System, then the PHP add on, this one:
http://www.sun.com/download/products.xml?id=45c26bc9
And the last MySQL version. He is trying to run WordPress but PHP seems not to connect with MySQL, this is the address:
http://200.72.40.204/revista/
We think it's something related to Sun Java System or the php add-on, because when using wordpress with Apache, it works fine, it doesn't throw that error.
I mean, this happen only when using Sun Java System.
# 7
[nobr]I wrote a small php script (testmysql.php) :
<?
$username="root";
$password="abcd";
$database="mysql";
mysql_connect(localhost,$username,$password);
print "Connected <BR>";
mysql_close();
?>
I tested using command line php e.g
$ ../plugins/php/bin/php ./docs/php/testmysql.php
X-Powered-By: PHP/5.2.0, Sun add-on 1.0
Content-type: text/html
Connected
And tested inside webserver using uri /php/testmysql.php
and it worked fine.
Can you see if you can connect mysql with command line php and test this basic
script to see if works.
I configured my webserver as nsapi. I didn't test if it works with fastcgi php or not.[/nobr]
# 8
First ... what you can see in error log form webserver ? If PHP is compiled with mysql?
What you see in MySQL log?
Can you connect to tthis mysql server localy form command line?
I think all problems are between mysql and Webserver. Mayby some kind of FW or permision to DB settings.
Irek