How To Enable or Disable Shell_exec in PHP

First you need to find the location of PHP.ini. You will need to have root access to your server before you can perform the following steps

Type this command in the shell:

php --ini

It should output this text:

Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File: /usr/local/lib/php.ini

Enable Exec() in PHP.ini

Open the PHP.ini file and remove “exec” on “disable_functions”:

disable_functions=show_source, system, shell_exec, exec

So it will become like this:

disable_functions=show_source, system, shell_exec

Then restart PHP service, use one of these commands:

/etc/init.d/php-fpm restart
/etc/init.d/php5-fpm restart
/etc/init.d/php7.0-fpm restart

Disable Exec() in PHP.ini

Open the PHP.ini file and add “exec” on “disable_functions”:

disable_functions=show_source, system, shell_exec

So it will become like this:

disable_functions=show_source, system, shell_exec, exec

Then restart PHP service, use one of these commands:

/etc/init.d/php-fpm restart
/etc/init.d/php5-fpm restart
/etc/init.d/php7.0-fpm restart
  • shell_exec
  • 0 istifadəçi bunu faydalı hesab edir
Bu cavab sizə kömək etdi?

Related Articles

How To Change cPanel Default Time Zone

The .htaccess file is a hidden text file within your hosting account that can be very powerful....

How To Restore a Home Directory Backup in cPanel

In this article I'm going to show you how to restore a partial home directory backup in cPanel....

How to Create a MySQL Database in cPanel

When you create a database, many users are unaware that there are several other items that you...

Install SSL certificates with cPanel SSL/TLS Manager

Enable SSL/TLS Manager in WHM for cPanel users Before using the SSL/TLS Manager as a cPanel...

5 Important Things to Consider When Choosing a Domain for Your Business or Website

When first setting up any website, one of the hardest — but most important — things to decide is...