PHP Warning: system has been disabled for security reasons
PHP Warning: system has been disabled for security reasons
1. You must log into your Linux server as ‘root’ user or as user with sudo privileges
2. Run the command ‘php --ini’ to find the location of your php.ini file
3. Check whether system function is disabled
system() function is used to execute an external program and display the output
disable_functions = system
The above command shows system function is disabled in your php.ini file
Note : system() function might be disabled during PHP hardening and enabling it server-wide is not recommended.
4. Remove system() from PHP disable_functions
Open php.ini file using any text editor like nano or vim.
vi /etc/php.ini
Scroll down to ‘disable_functions’ line and remove ‘system’ from that.
Save the php.ini file and exit.
5. Restart the web server
You must restart the web server for changes to take effect.
Command :
service httpd restart
6. Create a phpinfo file under your website to make sure system() function is removed from disable_functions
After restarting the web server, check whether you’re still getting the same error.
If you’re still getting the same error, then the path of the php.ini file of your website might be different. Create a phpinfo file under document root of your website to locate the path of the PHP configuration file.