PHP Off, still works.

rzRDJ

New member
Joined
Jul 11, 2012
Messages
3
Hello.

I have some packages which PHP has been switched off.

However the user still can execute PHP scripts even with PHP Off.
I test this by making a test account with CGI & PHP switched off and i could use PHP scripts too.

How can i fix this?
 
Hello,

If you use suPHP (PHP-CGI via mod_suphp), then it caused mostly by the fact that PHP is globally enabled in

/etc/httpd/conf/extra/httpd-suphp.conf

Code:
suPHP_Engine on

And in some cases (I don't remember details) if your suPHP module is compiled as

Code:
--with-setid-mode=paranoid

then you can not redefine it, it means that if even try to disable PHp for an user, or a domain, you won't be able to do that. So you need

1. Open /etc/httpd/conf/extra/httpd-suphp.conf in editor via SSh. Here change line
Code:
suPHP_Engine on
into
Code:
#suPHP_Engine on
(this is very important)

2. Protect /etc/httpd/conf/extra/httpd-suphp.conf from being overwritten,

Code:
chattr +i /etc/httpd/conf/extra/httpd-suphp.conf

3. restart apache

Code:
service httpd restart

4. check it in your browser.
 
Back
Top