PHP Safety Without SAFEMode

This goes in your php.ini files: disable_functions = passthru,shell_exec,system,proc_open,proc_close,popen

pico -w /etc/php.ini
pico -w /usr/lib/php.ini
pico -w /usr/local/lib/php.ini
pico -w /usr/local/cpanel/3rdparty/etc/php.ini
pico -w /usr/local/cpanel/3rdparty/lib/php.ini
pico -w /usr/local/Zend/etc/php.ini
Search for line: 'disable_functions'
alter for: disable_functions = passthru,shell_exec,system,proc_open,proc_close,popen

Then to wirte protect them:

chattr +i /etc/php.ini
chattr +i /usr/lib/php.ini
chattr +i /usr/local/lib/php.ini
chattr +i /usr/local/cpanel/3rdparty/etc/php.ini
chattr +i /usr/local/cpanel/3rdparty/lib/php.ini
chattr +i /usr/local/Zend/etc/php.ini

This will be pretty safe without needing safe mode

--- xwing777 - server matrix forums

Was this answer helpful?

 Print this Article

Also Read

Mask Apache Server & Services Version Numbers

"Masked response to server ident quries" Changes all your apache php etc version #'s to just...

Mod Security

Think of mod_security as an intrusion detection and prevention engine for web applications....

Mount /tmp as NOEXEC

If you are renting a server then chances are everything is lumped in / and a small amount...

What ports should be open if I'm running my cPanel server behind a firewall?

Ports that must be open to run cPanel behind a firewall: 20 -- ftp tcp inbound/outbound 21 --...

Closing open nameservers

There should be a named.conf here. Make a backup of it, and the idea is to add some lines looking...