hi there,
I was going to update PHP, Apache and MySQL on my Fedora Core 4 with yum, so I've run this command by root:
Code:
# yum update apache mysql php
Looks like everything is OK...
Quote:
Dec 24 23:30:51 Updated: mysql.i386 4.1.20-1.FC4.1
Dec 24 23:30:53 Updated: php.i386 5.0.4-10.5
Dec 24 23:30:53 Updated: php-ldap.i386 5.0.4-10.5
Dec 24 23:31:01 Updated: php-pear.i386 5.0.4-10.5
Dec 24 23:31:06 Updated: mysql-devel.i386 4.1.20-1.FC4.1
Dec 24 23:31:06 Updated: php-gd.i386 5.0.4-10.5
Dec 24 23:31:07 Updated: php-mbstring.i386 5.0.4-10.5
Dec 24 23:31:25 Updated: mysql-server.i386 4.1.20-1.FC4.1
|
With fresh software my site powered by PHP+MySQL and hosted on this machine is refused to work!
Quote:
ERROR_NO_COMMUNICATION_WITH_SERVER
|
Here is message in log:
Quote:
[client XXX.XXX.XXX.XXX] PHP Notice: Use of undefined constant ERROR_NO_COMMUNICATION_WITH_SERVER - assumed 'ERROR_NO_COMMUNICATION_WITH_SERVER' in /path/to/script/dbconnect.php on line 9
|
Before performing update everything was fine!..
So I've put
<? phpinfo() ?> into
test.php in my webserver folder and fire up my browser at
http://localhost/test.php. It shows me that php was builded with defaults (
--without-mysql)!!! Argh. I've make these actions
Code:
# yum remove php
# yum install php php-mysql php-xml
and checked
/var/log/yum.log
Quote:
Dec 25 13:48:42 Erased: php
Dec 25 13:48:43 Erased: php-pear
Dec 25 13:48:45 Erased: php-ldap
Dec 25 13:48:45 Erased: php-mbstring
Dec 25 13:48:45 Erased: php-gd
Dec 25 14:05:21 Installed: php.i386 5.0.4-10.5
Dec 25 14:05:21 Installed: php-ldap.i386 5.0.4-10.5
Dec 25 14:05:21 Installed: php-mysql.i386 5.0.4-10.5
Dec 25 14:05:23 Installed: php-pear.i386 5.0.4-10.5
Dec 25 14:05:23 Installed: php-gd.i386 5.0.4-10.5
Dec 25 14:05:23 Installed: php-mbstring.i386 5.0.4-10.5
Dec 25 14:18:29 Installed: php-xml.i386 5.0.4-10.5
|
After installing
php-mysql my scripts started to work with one correction: I have to use $host = 127.0.0.1 instead of $host = localhost
Code:
$link = @mysql_connect($host,$dbuser,$dbpwd) or die(ERROR_NO_COMMUNICATION_WITH_SERVER);
My site works only in this case!
Code:
$link=mysql_connect(localhost,$dbuser,$dbpwd);
echo mysql_error();
returns
Quote:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)mysql_connect
|
Any ideas?