The following command is executed successfully.

php /var/www/html/mysqlconnect.php 

The same script when accessing the WEB server on Apache 2.2.x (PHP 5.3 Lib64) says that it is impossible to connect via a MySQL socket. PHP in Apache works, as phpinfo() outputs the necessary information.

It is guaranteed from the command line, as the contents of the tables are displayed. I checked the rights to the socket - everything is normal. Why is that?

  • "Everything is OK" for which user? - alexlz
  • What kind of error is issued? - razielsd
  • > "Everything is OK" for which user? Yes, it got to the point that he added an Apache user to a muscle group, launched Apache on behalf of the user muscle, put the socket in a public directory. In addition, I execute this script from the command line on behalf of the Apache user and the table is output - kolegaua
  • Warning: mysqli_connect () [function.mysqli-connect]: (HY000 / 2002): Can't connect to mySQL server through socket '/tmp/mysql.sock' (13) in - kolegaua
  • one
    So, the problem has moved to another plane. Changing runlevel5 to runlevel3, everything worked by itself. The iptables firewall is disabled for 3 and 5 Perhaps this is a question from some Fedora Core 16 service? - kolegaua

0