How could I enable shell_exec() only for one user? Thanks.
How could I enable shell_exec() only for one user? Thanks.
www.ShoutSonic.com ~ come and shout on gigE public networks
ichiDESK.com | unmetered Dedicated Servers ON DEMAND from US & EU on 10Mbps/100Mbps/1Gbps !
www.sanBOX.in ~ Storage Area Network Dedicated Servers
We also do Linux & Windows Web Hosting
Are you TotemOrTaboo.com ?
i wait the replay
Hi;
It is only possible if you have installed suhosin extentions in your server.
Below are the exact steps to enable a particular PHP function:
1. Remove all functions from disable_functions in php.ini
2. Add functions in php.ini suhosin.executor.func.blacklist = “” those you want to disable globally.
After that in the virtual host section of a domain you can add below code to enable a function only for one domain:
<VirtualHost 127.0.0.1>
………..
<IfModule mod_php5.c>
php_admin_value suhosin.executor.func.blacklist = “shell_exec”
</IfModule>
……
</VirtualHost>
In this example shell_exec has been enabled for the VirtualHost.
JaguarPC
jaguarpc.com
I changed this in httpd.conf:
<VirtualHost 174.136.1.201:80>
<IfModule mod_php5.c>
php_admin_value suhosin.executor.func.blacklist = “shell_exec”
</IfModule>
ServerName resellertag.com
ServerAlias Reseller Tag :: Essential Reseller Solutions
DocumentRoot /home/username/public_html
ServerAdmin webmaster@resellertag.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/resellertag.com combined
CustomLog /usr/local/apache/domlogs/resellertag.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User username # Needed for Cpanel::ApacheConf
UserDir disabled
UserDir enabled username
<IfModule mod_suphp.c>
suPHP_UserGroup username username
</IfModule>
<IfModule !mod_disable_suexec.c>
SuexecUserGroup username username
</IfModule>
ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
# To customize this VirtualHost use an include file at the following location
# Include "/usr/local/apache/conf/userdata/std/2/username/resellertag.com/*.conf"
</VirtualHost>
I restarted httpd and it gave me an error.
I have suhosin installed on my server too.
suhosin.executor.func.blacklist = "" is not in php.ini but I added it with the functions and I removed all the functions from disable_functions as well.
What do I do?
Found a better explanation and it even worked for me this time!
How to Enable shell_exec function for one account? - Accu Web Hosting
If you are using DSO, then you can use the method for suhosin, but this will not work under suPHP unfortunately. It's always best to indicate the PHP handler when asking how to enable a function, so we know which one is being used.
Also, the how-to indicated will not work to retain changes under cPanel, since cPanel has this line above each VirtualHost entry:
The reason it indicates not to edit directly is that every time either /scripts/rebuildhttpdconf or EasyApache runs, the changes made directly to httpd.conf in the VirtualHost area will be wiped.# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
I have a discussion at the following url on how to get this working using DSO (and I link to my other guide in that post on how to get it working under suPHP):
Is proc_open safe? - cPanel Forums
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support
Submit a ticket | Check an existing ticket
I don't know what you are talking about. It works fine for me under suphp(not using dso) and I haven't had a problem yet after rebuilding httpd.
These values (php_admin_value) cannot be passed for suPHP:
<IfModule mod_php5.c>
php_admin_value suhosin.executor.func.blacklist = “shell_exec”
</IfModule>
This is a DSO flag and should not work for suPHP:
suPHP - FAQ
suhosin + suphp - DirectAdmin Forums
How to Enable PHP function for a one account ? | Linux Windows System Administrator Help
How to Enable PHP function for a one account ? | backup recovery
Just to name a few.
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support
Submit a ticket | Check an existing ticket
Well, It works.
Option Configured Value
Default PHP Version (.php files) 5
PHP 5 Handler suphp
PHP 4 Handler none
Apache suEXEC on
I have shell_exec enabled on one account showing status2k without errors and the other account says: Warning: shell_exec() has been disabled for security reasons in /home/user/public_html/test/index.php on line 1
Status 2k:
Status2K Support
SuPHP is Enabled.![]()