PHP Functions disabled but not disabled in php.ini
We are moving to a new server and on this server we find that the PHP functions exec,passthru,shell_exec, and system are disabled. We know that from running phpinfo and also when we run a PHP program that uses exec, it warns us that it is disabled. So I thought I would just change this in the php.ini file. Phpinfo tells me the load configuration file is /opt/cpanel/ea-php71/root/etc/php.ini. In there I find:
disable_functions =
Also when I run php "ini in the terminal I find
disable_functions => no value => no value
I"ve looked through all the files in /opt/cpanel/ea-php71/root/etc/php.d and don"t find anything there either. Finally, even though it shouldn"t be there, I checked httpd.conf also.
How can this be? Our server does have puppet service installed and running. Could this be doing this and if so how?
Update:
Additionally I changed the php.ini file so
disable_functions = "popen"
and there was no change in what I see in phpinfo, i.e.,
| exec,passthru,shell_exec,system Update: I can the run PHP script that uses exec from the command line and it works, but not when it is run from a browser. So it appears apache is disabling the functions somehow. I didn't thing that could be done, but I had looked in the httpd.conf anyway and didn't find anything. |
-
Are you running EasyApache 3 or 4? Under MultiPHP option in WHM can you confirm that the domain is using ea-php71? 0 -
We are running EasyApache 4 and I have confirmed that the domain is using ea-php71 in Home "Software "MultiPHP Manager. 0 -
We got the answer from our server customer support. This fixed our problem. They said: There is PHP-FPM enabled for all domains on the server. It overwrites some PHP options, namely disable_functions. Thus, if you need these customizations, one should disable PHP-FPM for a domain or globally on the server as it conflicts. You may refer to 0 -
No need to disable PHP-FPM. With PHP-FPM, you can override the disabled functions by either editing / creating: /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml which will apply to all domains. Sample with other defaults I have: --- php_admin_value[error_reporting]: E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT pm_max_children: 5 pm_max_requests: 500 pm_process_idle_timeout: 20 php_admin_value_disable_functions : passthru,system
or edit a specific domain's yaml file in /var/cpanel/userdate/ACCOUNT/DOMAIN.php-fpm.yaml' Afterward you must rebuild PHP-FPM: /scripts/php_fpm_config --rebuild and maybe rebuild Apache: /scripts/rebuildhttpdconf0 -
Thanks for that input. 0 -
Glad to see you were able to get a resolution to the issue and thank you for updating here with the information on how it was resolved. 0 -
It took a while, but I finally found I could edit disabled functions in multiphp-manager/user/fpm-settings/DOMAIN. The only disabled function I could find in /var/cpanel/userdate/ACCOUNT/DOMAIN.php-fpm.yaml was one for a WordPress site (not the one I needed to change). Does anyone know if that was added by the WordPress installer? Just curious... 0 -
@tss - the system is designed so that you should not need to edit those yaml files directly. Is there a reason the cPanel >> MultiPHP INI Editor tool isn't working well? Are you able to use that area to perform those modifications? 0 -
@cPRex: After I wrote that first post, I did a little more research and found that page. It didn't come up in searching WHM, but I did find it from the PHP-FPM doc. It seems to be working. Just a note to the above thread: I didn't need to restart Apache, only the PHP-FPM service. My error then went away. Thanks for the quick response! 0 -
I'm glad that's all you had to do! 0
Please sign in to leave a comment.
Comments
10 comments