HELP php can't connect to mysql anymore

jamesbond

Well-Known Member
Oct 9, 2002
737
1
168
I just ran easyapache , everything seemed to be working fine, but then I noticed php scripts couldn't connect to mysql anymore.

The strange thing is phpMyAdmin in Cpanel is still working.


Warning: mysql_connect() [function.mysql-connect]: Access denied for user: '[email protected]' (Using password: NO) in /home/name/public_html/file.php on line 141


This is my php config file:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-swf=/usr/local/flash' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-ming=../ming-0.2a' '--enable-magic-quotes' '--with-mysql' '--with-pear' '--enable-xslt' '--with-xslt-sablot' '--enable-safe-mode' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-versioning' '--with-zlib'
 

jamesbond

Well-Known Member
Oct 9, 2002
737
1
168
Phew! I fixed it.

What happened was when I installed Zend Optimizer it said 'missing php.ini' and when I looked it was indeed disappeared, so apparently Zend deleted it in the install process somehow, because I know it was there before I installed Zend.
Very strange...

I didn't make a copy of php.ini so I had to replace it with an older version which caused the problems with mysql.

I then tried another php.ini and it started working again.

For future reference, does anyone what section of php.ini can cause the problem I had (not being able to connect to mysql)?