Barley wrote:
If I run the script from a shell prompt as root, it outputs "Yes". If I run as any other user, it outputs "No." It also gives this error: Warning: mysqli_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
Check permissions on /var/lib/mysql. From the sockets manpage:
NOTES
In the Linux implementation, sockets which are visible in the filesystem honour the permissions of the directory they are in. Their owner, group and their permissions can be changed. Creation of a new socket will fail if the process does not have write and search (execute) permission on the directory the socket is created in. Connecting to the socket object requires read/write permission. This behavior differs from many BSD-derived systems which ignore permissions for Unix sockets. Portable programs should not rely on this feature for security.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php