[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help : php cannot connect to local mysql server



On Wed, 11 Feb 2004 20:58:08 -0500 "Christopher M. Ingram" <openbsd@christopheringram.com> wrote:
> Apache is chroot(2)ed by default. When PHP looks for
> /var/run/mysql/mysql.sock, its actually looking for
> /var/www/var/run/mysql/mysql.sock

> Copy, link, whatever you like to get the file in the proper spot. Check
> the archives for details.

the way i handle this is to set the socket to /var/www/var/run/mysql/mysql.sock
in /etc/my.cnf, and set it to /var/run/mysql/mysql.sock in
/var/www/etc/my.cnf

with chrooted apache, there are two my.cnf files, and you can take
advantage of this.

richard
-- 
Richard Welty                                         rwelty@averillpark.net
Averill Park Networking                                         518-573-7592
    Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security