Enable system () and exec () functions on hosting?

I am a developer, and I create client sites on my server and then use a PHP script to clone it to the client server upon completion. I tried this time, but I get an error

"Your host does not allow the use of the system () and exec () functions."

Any idea how to enable this? I have access to cpanel and the main account is greengecko.com. Installing Wordpress was easy, I just can't run this script!

+4
source share
3 answers

If your host has disabled these features, they will not be. You can either contact your host to find out if they can enable them for each account, or if you use free hosting, you can consider switching to a paid version of your hosting to enable these features. For security reasons, they are disabled by the host. Your only course of action is if you contact your web host or try switching to paid hosting (if it has not already been).

+8
source

Elijah, I also had the same problem with system () and exec (), which is NOT included in php.

Just download the php.ini file located at the root of your site via FTP and you will find something like this:

register_globals = On safe_mode = Off enable_dl = On disable_functions = "exec,passthru,shell_exec,proc_open,popen,system,curl_exec,curl_multi_exec,parse_ini_file,show_source" 

Just delete exec (the first word in the line between ""), which is located in the disable_functions line, and also delete the system,

Remember to remove coma (,) in two words.

It worked for me.

Keep in mind, I myself created this php.ini file about a month ago, but I don’t know why, by changing the php version in cPanel, exec and system returned.

Also follow the guidelines given here with plasmid87 to get it back when you're done creating a clone of your site.

Mario bruno

+2
source

Some hosting providers allow you to override php.ini settings from within .htaccess (if Apache is Httpd) or use a separate php.ini file somewhere within the hosting account directory.

I am not familiar with your hosting provider and therefore can not comment on whether this is possible. However, I can say that if you can use such a tool, you are probably looking for the disable_functions directive.

As another piece of advice, if you find that you can “reactivate” PHP's protected functions, and this is located on the client account, I cannot stress enough how important it is to remember that you “disconnect” them again (disabling exec() and system() ) hosting accounts are increasingly becoming a necessity, since exploits and simple errors are extremely expensive for server security).

0
source

All Articles