ABHIONLINUX
Site useful for linux administration and web hosting

2009/11/28

How to set php safe_mode for a particular domain.

safe_mode is a feature of php. It is always prefferable to keep it ON due to security resaons. But for the working of some scripts it need to be turned off , in that case also dont turn it off server wide as it is a potential vulnerability.

How to turn off safe_mode for a particular domain.
---------------------------------------------------------

First thing we need to check is whether php is compiled as modular or cgi
If modular then we can do it via .htaccess in his public_html
If cgi then we can do it via php.ini in his publichtml

Via .htaccess
---------------

Add the following line


php_value safe_mode 0ff

or

php_flag safe_mode Off

If it is php 5 then add it inside the if module like


php_flag safe_mode off


via php.ini
------------

Just make a file called php.ini in his public_html then just add the line

safe_mode Off

Via hhtpd.conf
----------------

Add the following line and use ifmodule if needed

php_admin_flag safe_mode Off

No comments:

Post a Comment