Zion Ahead

Well-Known Member
Nov 10, 2006
347
0
166
How do I enable shell_exec in an .htaccess file for one particular account, even thought it is disabled globally in php.ini ?

I am using php 4.4.6 / cpanel / centos

Also, what would the .htaccess look like for php5x?
 

xerophyte

Well-Known Member
Mar 16, 2003
215
0
166
Canada
I don't think you can do it, the docs says

This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode.

This directive must be set in php.ini For example, you cannot set this in httpd.conf.

if you can not put in the httpd.conf, you can not have it in the .htaccess. Beside if you can do it what is the purpose of having the disable_functions

hope that heslp
 

bmcpanel

Well-Known Member
Jun 1, 2002
546
0
316
How do I enable shell_exec in an .htaccess file for one particular account, even thought it is disabled globally in php.ini ?

I am using php 4.4.6 / cpanel / centos

Also, what would the .htaccess look like for php5x?
Not sure if you are willing to use phpsuexec, but you can accomplish your task if you do use phpsuexec.

If you do use phpsuexec, limit out shell_exec for everyone in the server-wide php.ini...
disable_functions = "exec,system,passthru,readfile,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,dl,popen,parse_ini_file,show_source,curl_exec"

Then, place a custom php.ini file into the directory of the account you wish to enable shell_exec ( /home/username/www/php.ini ). The custom php.ini file must be in each directory that will require the custom php.ini settings, they are not inherited by sub-directories.. Then, make sure that the custom php.ini file with the line....

disable_functions = 'whatever,here'

.... does not contain the shell_exec function.

If you're not running phpsuexec, then I have no idea.
 
Last edited: