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

php and mysql in chrooted apache



Hi I am trying to get php(4.3.3) to access mysql(11.18) through chrooted
apache(1.3.28) on OpenBSD3.4 (Generic + raidframe on i386). Is there a
checklist of actions needed to get this working?

Both php and mysql work but not together. A test page with php(info)
works fine and mysql runs fine from the command line. My php script to
test mysql returns a blank screen.

I've read the OpenBSD FAQ, and nomoa.com/bsd as well as various forum
entries from bsdhound.com and php.net including the advice on this
page.. http://www.php.net/manual/en/install.openbsd.php

I've copied
libphp4.so to/var/www/lib/php/modules and added 
LoadModule php4_module       lib/php/modules/libphp4.so  
to /var/www/conf/httpd.conf

/var/www/tmp exists - ownership is root

The mysql socket file is linked to the chrooted environment (correctly I
believe)
/etc/rc.local contains...

if [ X"${mysql}" == X"YES" -a -x /usr/local/bin/safe_mysqld ]; then

    echo -n " mysqld"; /usr/local/bin/safe_mysqld --user=_mysql --log &

    for i in 1 2 3 4 5 6; do
        if [ -S /var/run/mysql/mysql.sock ]; then
            break
        else
            sleep 1
            echo -n "."
        fi
    done
    #
    # Apache chroot Settings

    mkdir -p /var/www/var/run/mysql
    ln -f /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock


    #
    # Postfix chroot Settings
    if [ "X${postfix_flags}" != X"NO" ]; then
        mkdir -p /var/spool/postfix/var/run/mysql
        ln -f /var/run/mysql/mysql.sock
/var/spool/postfix/var/run/mysql/mysql.sock    fi

fi


# cat /etc/rc.conf.local                                                
named_flags=""          # for normal use: "" 
httpd_flags=""          
shlib_dirs="$shlib_dirs /usr/local/lib/mysql"     
mysql=YES

Have I missed something obvious?
TIA, Gary