Suexe issue + PHP cgi… individual php.ini file wont reflect….Cpanel

October 10, 2008 on 11:17 pm | In Cpanel, PHP | 1 Comment

The php.ini files in your home directory won’t reflect the changes.

Perform the following actions to get it resolved.

1. Moving php5 binary:

mv /usr/local/cpanel/cgi-sys/php5 /usr/local/cpanel/cgi-sys/php5.bin

2. Then creating wrapper file in the /usr/local/cpanel/cgi-sys/php5 with the following content:

#!/bin/bash

# This will fake the name & path and hide the /usr/local/cpanel/cgi-sys/php5 path!
export SCRIPT_NAME=$REQUEST_URI
export SCRIPT_FILENAME=$PATH_TRANSLATED
export PWD=$DOCUMENT_ROOT

if [ -f "$DOCUMENT_ROOT/php.ini" ]; then
exec /usr/local/cpanel/cgi-sys/php5.bin -c $DOCUMENT_ROOT
else
exec /usr/local/cpanel/cgi-sys/php5.bin
fi

3. Save the file and change the permissons:

chown root:wheel /usr/local/cpanel/cgi-sys/php5*;
chmod 755 /usr/local/cpanel/cgi-sys/php5*;

Thanks to Cpanel forums…..

1 Comment »

RSS feed for comments on this post. TrackBack URI

  1. Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

    Comment by Alexwebmaster — March 3, 2009 #

Leave a comment