RE: PHP disable functions
04-09-2015, 12:17 AM
(This post was last modified: 04-09-2015, 12:18 AM by apinto.)
Greentings sunardi, and welcome to the Sentora Community
You should first enable PHP Debugging (see php.net: error_reporting manual) on your php.ini (see Sentora Docs: Important Paths):
Note: This should NEVER be left enabled for production servers.
With Debugging enabled you will see errors and not only a blank page (when you try to connect to the Sentora Panel).
Read those errors and try to find what needs to be changed.
Suhosin
Sentora uses suhosin (suhosin Official Website) as the executor, you should check your httpd-vhosts.conf (see Sentora Docs: Important Paths) and edit the following line (only the last line matters, the rest is just for reference):
Editing this, instead of php.ini is, in my opinion, the best way to do it (disable unwanted commands) within Sentora (please, someone correct me if I'm wrong), this will keep them available to Sentora Panel but not for other users.
If you really want to globaly disable those commands, please check witch ones are needed by Sentora by following the steps above (enable PHP debugg and search).
You should first enable PHP Debugging (see php.net: error_reporting manual) on your php.ini (see Sentora Docs: Important Paths):
PHP Code:
// Report all PHP errors (see changelog)
error_reporting(E_ALL);
With Debugging enabled you will see errors and not only a blank page (when you try to connect to the Sentora Panel).
Read those errors and try to find what needs to be changed.
Suhosin
Sentora uses suhosin (suhosin Official Website) as the executor, you should check your httpd-vhosts.conf (see Sentora Docs: Important Paths) and edit the following line (only the last line matters, the rest is just for reference):
PHP Code:
<virtualhost *:80>
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ServerAdmin admin@yourdomain.com
DocumentRoot "/var/sentora/hostdata/user_account/public_html/yourdomain_com"
php_admin_value open_basedir "/var/sentora/hostdata/yourdomain/public_html/yourdomain_com:/var/sentora/temp/"
# EDIT THE LINE BELOW #
php_admin_value suhosin.executor.func.blacklist "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"
Editing this, instead of php.ini is, in my opinion, the best way to do it (disable unwanted commands) within Sentora (please, someone correct me if I'm wrong), this will keep them available to Sentora Panel but not for other users.
If you really want to globaly disable those commands, please check witch ones are needed by Sentora by following the steps above (enable PHP debugg and search).
My Sentora Resources
[Module] Mail Quota Count | Vagrant Box with Sentora
Graphic and Web Design. Development.
www.vanguardly.com
[Module] Mail Quota Count | Vagrant Box with Sentora
Graphic and Web Design. Development.
www.vanguardly.com