A
AlanO
Guest
I can't get my server set up to allow individual php.ini for each domain. I've read up on this a fair bit. The problem has come up because I need to ensure that php magic quotes is off for a specific domain but I know that it is needed on another domain - hence the need for a custom php.ini.
The problem is that my server uses fast CGI everywhere. Reading up the forums suggest changing the cgi_wrapper file from
#!/bin/sh
exec /usr/bin/php5-cgi
to
#!/bin/sh
domain=`fgrep -m 1 "$UID" /etc/passwd| awk -F\: '{print $6}' |awk -F"/" '{print $5}'`
PHPRC=/var/www/vhosts/$domain/conf/php.ini
[ -f ${PHPRC} ] || PHPRC="/etc/php.ini"
export PHPRC
exec /usr/bin/php-cgi -c "$PHPRC"
I tried this but it crashed the server so I had to back it out.
Any ideas how I can make it work?
thanks
The problem is that my server uses fast CGI everywhere. Reading up the forums suggest changing the cgi_wrapper file from
#!/bin/sh
exec /usr/bin/php5-cgi
to
#!/bin/sh
domain=`fgrep -m 1 "$UID" /etc/passwd| awk -F\: '{print $6}' |awk -F"/" '{print $5}'`
PHPRC=/var/www/vhosts/$domain/conf/php.ini
[ -f ${PHPRC} ] || PHPRC="/etc/php.ini"
export PHPRC
exec /usr/bin/php-cgi -c "$PHPRC"
I tried this but it crashed the server so I had to back it out.
Any ideas how I can make it work?
thanks