EDIT 1 : Maybe the mod should move the thread to the HowTo section ?
EDIT 2 : Forgot one step. See step 8
EDIT 3 : Forgot an option on suPHP ./configure
EDIT 4 : Changed the way to install suPHP. Now everything should work perfectly!
Here are the steps I did to make suPHP work with Redhat 9.0 :
1- Get suPHP :
wget http://www.suphp.org/download/suphp-0.5.tar.gz
2- Unpack the archive and enter into the created directory :
tar -zxvf suphp-0.5.tar.gz ; cd suphp-0.5/
3- Copy your current php bin :
cp -p /usr/local/bin/php /usr/local/bin/php.CLI
- Download, extract php CGI :
Make sure you are running Redhat9.0 and you are using PHP 4.3.4 :
wget http://katou.nebukazar.net/CGI-php-v4.3.4-rh9.tar.gz
tar -zxvf CGI-php-v4.3.4-rh9.tar.gz ; cp -fp CGI-php-v4.3.4-rh9/php /usr/local/bin/php.CGI
If you are not using Redhat 9 or you're not using the same PHP version, you can download your PHP version, configure then make. The CGI php version is located under : [PHP-Directory]/sapi/cgi/php
4- Configure suPHP to your system :
./configure --with-apache-user=apache --with-php=/usr/local/bin/php.CGI --disable-checkpath --disable-checkuid --disable-checkgid --with-min-uid=0 --with-min-gid=0
5- Make :
make
6- Before doing make install, please keep a backup of your httpd.conf :
cp -p /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak
7- Make install suPHP :
make install
8- Edit your httpd.conf
- vi or pico /etc/httpd/conf/httpd.conf
locate :
<IfModule mod_php4.c>
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>
and replace with :
<IfModule mod_php4.c>
suPHP_Engine on
AddHandler x-httpd-php .php
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
9- Change 1 setting in your php.ini (
!! Make sure you are editing the right php.ini file !!):
vi or pico /usr/local/lib/php.ini
find :
and change it to :
10- Restart httpd :
service httpd restart
suPHP log is installed under /etc/httpd/logs/suphp_log
If you need more help PM me or contact me at
[email protected]