nik_w wrote in php 😟depressed

Failure of PHP to work with Apache / MySQL

I turned on my computer last night and found that PHP was refusing to communicate with MySQL - I could make MySQL work through the command line and through Perl, but not through PHP. I checked everything that I could think of and everything I could find on google without any joy. I have spent about 8 hours messing with this now and I'm getting nowhere. I've uninstalled and reinstalled php & mod_php so many times today that I've lost count. My latest idea was to uninstall php, mod_php, and apache. I've reinstalled Apache, php, and mod_php (in that order) but now PHP refuses to work with Apache. I've added APACHE2_OPTS="-D PHP5" to the apache config in /etc/conf.d/apache2 but it hasn't made any difference.

I'm running Gentoo with Apache 2.0.54, PHP 5.0.4 (along with mod_php 5.0.4), and MySQL 4.0.24.

Does anyone have any ideas how I can make it work again as I'm going insane here...

Update: PHP itself seems to work now (I stopped then started Apache instead of just restarting it), but it's still not interested in talking to the database, I just see Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13).