new php and mysql stop playing together



Hi,

A bit of a newbie as far as mysql and php adminning I am; I upgraded
php to version 4.4.6, and mysql to 4.1.22, following the instructions
in the "INSTALL" files of each (I also have the same problem on
another server trying the latest mysql 5.0.*). After this, my php
won't connect to mysql, either with mysql_connect():

Warning: mysql_connect() [function.mysql-connect]: Can't connect to
local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /
var/www/html/test.php on line 4


or with ezMySQL:

(Warning: Error establishing mySQL database connection. Correct user/
password? Correct hostname? Database server running? in /var/www/html/
lib/ez_sql_mysql.php on line 84)


I've checked, and /var/lib/mysql/mysql.sock is there, and I can
connect to the server with the "mysql" client program from the shell
just fine, with the same username, pass, server and database name as
I'm using in the code. And all non-database-related php code works
fine, so MySQL and PHP seem to be working OK independently of each
other; I suspect it's just a php setting somewhere. I'd like to get
more detailed information from the connection failure than the above
messages; is that possible? I set "LogLevel debug" in httpd.conf, and
"log-bin" in /etc/my.cnf, and these in /etc/php.ini:

error_reporting = E_ALL
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
error_log = /var/log/php.log ;for some reason, it's not writing to
this....


-----
Here is the output of mysql_explain_log:

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
contains: [....]) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: ExampleP, Proxy, Sponge.
at bin/mysql_explain_log line 55


--------
System info:
mysql Ver 14.7 Distrib 4.1.22
PHP Version 4.4.6 (according to phpinfo(), but the "php" binary still
in my path is still 4.3.9)
php configure command: ./configure --with-apxs2=/usr/sbin/apxs --with-
mysql
Apache: 2.0.52 (CentOS)
OS: CentOS release 4.4 (Final)

If phpinfo() output would help, let me know.

Thanks.

--
S

.



Relevant Pages

  • Re: Speed up web pages : MySQL or PHP solutions ?
    ... People come to us to view 1 image or text + 1 PHP content. ... Can you click on the image = MYSQL ... Make your content cacheable by sending appropriate HTTP headers. ... Cache content on the server to avoid re-creation over and over again, ...
    (comp.lang.php)
  • Executing PHP files on remote web server
    ... We have a web app which uses PHP and MySQL on our in-house Apache web ... database to the web host because a lot of the data is sensitive. ... By loading the non-sensitive data into the web host's MySQL tables, ... running on our own web server. ...
    (comp.lang.php)
  • Re: Newbie Security Questions
    ... questions about PHP and its usage with MySQL. ... And even if they do, its a strange Mysql server that is sitting on the internet accepting requests from all and sundry..normally you run them on a local network, or the same box and set mysql to only accept requests FROM the apache server.. ... You have to layer that over the top using cookies and user logins if you want it. ...
    (comp.lang.php)
  • Re: Server load too high
    ... > the new dedicated server with Dual Xeon 3.2 GHz and 2GB Ram. ... > The board is written in PHP with Mysql. ... Well, since it looks like MySQL is eating more of the CPU, it could be ... In any case, I've been using PHP5 for a while now, and I've not ...
    (comp.lang.php)
  • Re: phpMyAdmin install help
    ... this means that PHP is lacking a certain functionality. ... talking to MySQL servers. ... It doesn't really matter where the MySQL server is running. ...
    (php.general)