Apache 2 + Php 4 + Php 5 + Suphp 0.6.1

works fine. It's possible also to put the file php.ini outside from the directory public_html in order not allowing modifications by users.

good job.
 
hehehe ! I found a little bug... This solution works fine at all except...

when you forbid PHP to one user it continues to work anyway... I guess there is something to change inside the DA GUI.

I wrote them to ask, let's see..
 
Ok, I'm a bit schizophrenic, but I can answer alone to the question.

To unable PHP using suPHP for one virtualhost simply add this :

suPHP_Engine off
RemoveHandler .php
RemoveHandler .php5

:D
 
it seems that on new da installs you have to use this configure options :



./configure --prefix=/usr/local/php4 --enable-force-cgi-redirect --enable-fastcgi --with-config-file-path=/usr/local/etc/php4/cgi --with-curl --with-curl-dir=/usr/local/lib --with-gd --with-gd-dir=/usr/local/lib --with-gettext --with-jpeg-dir=/usr/local/lib --with-kerberos --with-mcrypt --with-mhash --with-mysql=/usr/local/mysql --with-pear --with-png-dir=/usr/local/lib --with-xml --with-zlib --with-zlib-dir=/usr/local/lib --with-zip --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --enable-sockets --enable-track-vars --enable-mbstring --enable-memory-limit

and for php5

./configure --prefix=/usr/local/php5 --enable-force-cgi-redirect --enable-fastcgi --with-config-file-path=/usr/local/etc/php5/cgi --with-curl --with-curl-dir=/usr/local/lib --with-gd --with-gd-dir=/usr/local/lib --with-gettext --with-jpeg-dir=/usr/local/lib --with-kerberos --with-mcrypt --with-mhash --with-mysql=/usr/local/mysql --with-pear --with-png-dir=/usr/local/lib --with-xml --with-zlib --with-zlib-dir=/usr/local/lib --with-zip --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --enable-sockets --enable-track-vars --enable-mbstring --enable-memory-limit
 
Last edited:
debian 3.1 and a fresh DA install ver 1.27.4 (also, I can't get it to update to apache 2 but I ll open another thread if I can't work it out)

:D
 
Make sure that you download my suPHP file, because I gave some modification inside.

In case of that you would download suPHP from the original website :

in src/apache/mod_suphp.c and src/apache2/mod_suphp.c look for :

{"suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, ACCESS_CONF, ITERATE, "Tells mod_suphp to handle these MIME-types"},
{"suphp_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, ACCESS_CONF, ITERATE, "Tells mod_suphp not to handle these MIME-types"},

and change it to :

AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, ACCESS_CONF, "Tells mod_s\uphp to handle these MIME-types"),
AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, ACCESS_CONF, "Tells\ mod_suphp not to handle these MIME-types"),

:-)
 
Thx but I used your modded suphp archive ;)

It is now comiling apache2 again, we ll see if it goes til the end.
 
Thanks for this - even a numpty like me got it working fine on CentOS 4.3 (Final) !

Cheers!!
 
Hi Maniak,

I'm interested in getting this setup working on a CentOS 3.4 server but I'm currently using the DirectAdmin customapache 2 version. I understand that my current version of PHP (4.4.2) won't be overwritten and the suPHP versions will be used instead.

I just wanted to check it works with Apache 2 fine though as there is a line on your first post that reads:
Does not work with Apache 2.2.x
Is this correct or will it work with Apache 2?

Thanks for taking the time to write out this howto, I'm looking forward to giving users the opportunity to use PHP5 while maintaining compaitibility for the rest of users.

Any news from DirectAdmin about implementing this solution?
 
Hello Cutia,

I works fine with Apache 2.0.5x but not with 2.2.x.

The official documentation of suPHP said that suPHP does not work with Apache 2.2.xx.

So, if you run Apache 2.0.57, 2.0.58, 2.0.59 it will works fine.

Enjoy.
 
Thanks for your swift reply Maniak. I see now, luckily the customapache DirectAdmin version is 2.0.58 so everything should be cool. Thanks again.
 
You welcome.

Anyway, if something goes wrong when you restart apache just do this :

# rm -rf /etc/httpd/conf/httpd.conf
# cp /etc/httpd/conf/httpd.conf.original /etc/httpd/conf/httpd.conf
# service httpd restart

and it would be back to your actual configuration.

About DA implementing, it's on the way I guess, check out here and give your voice to the poll.
 
Hi Maniak,

I noticed in the poll there is the option for PHP4 (default) and then suPHP with PHP5.

This seems like a good way to do things if possible, so that all the existing and working sites aren't changed but a user has the option to use PHP5 within suPHP if they want.

Forgive me if I've got this wrong, but I've read that some people are having issues with mod_rewrite and suPHP and as most of my clients sites run on CMS's with rewrite rules I'm a little worried about implementing the full suPHP solution.

What are your thoughts on this?
 
And if some customers would have bad experience with suPHP, turn off suPHP for them, mod_php would serve their pages.

suPHP_Engine off
RemoveHandler .php
RemoveHandler .php5
 
Last edited:
Maniak said:
And if some customer has bad experience with suPHP, turn off suPHP for them, mod_php would serve their pages.

Aha! This is what I'm looking for! Thank you, makes sense now, if I can turn it off for a particular problem customer. I wont have time to implement this over the weekend but I'll post my experience with it early next week.

Thanks for the advice and solution Maniak, much appreciated.
 
Is it possible to configure this so that the default setting is to have the standard PHP4 used for all .php files and then explicitly set .php and .php5 with suPHP for only specific virtual hosts?

Is it a case of changing:
<Location />
suPHP_Engine on
suPHP_ConfigPath /usr/local/etc/php5/cgi/
suPHP_AddHandler x-httpd-php
suPHP_AddHandler x-httpd-php5
</Location>

to:

<Location />
suPHP_Engine off
suPHP_ConfigPath /usr/local/etc/php5/cgi/
suPHP_AddHandler x-httpd-php
suPHP_AddHandler x-httpd-php5
</Location>

in the main apache httpd.conf file to have the old PHP4 used as standard and then in each user's httpd.conf file switch it on again?
 
Back
Top