• Contact Us
  • copyright
  • About Us
  • Privacy Policy
  • Devops
  • Linux
Globedrill

PHP Warning: system has been disabled for security reasons

Linux/09 Jun, 20/836/0
Linux

PHP Warning: system has been disabled for security reasons

 

PHP system function might be disabled by your web hosting provider for security reasons. Do the below steps to re-enable system function to fix the error “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
 

grep disable_functions /etc/php.ini
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.

Leave a Reply Cancel reply

.

About Us

Globedrill.com is a website that publishes articles related to Linux and Devops. Globedrill was started on April 2016.

Contact Us

Email : globedrill.c@gmail.com

Globedrill

Copyright © 2016 Globedrill. All Rights Reserved. The content in this website is copyrighted to Globedrill.com and may not be republished either online or offline.

  • About Us
  • Privacy Policy
  • Contact Us
  • copyright