[Custom Module] exec_dir patch for EasyApache

sehh

Well-Known Member
Feb 11, 2006
579
6
168
Europe
From the exec_dir website:

PHP has no known possibility to limit executing of external commands with disabled safe mode. Teherefore, here is a patch adding special directive exec_dir straightly into PHP. This directive is very similar to safe_mode_exec_dir, but safe mode has not to be enabled.

This patch limits or corrects the behavior of these functions:

exec()
passthru()
proc_open()
shell_exec()
system()
popen()
is_executable()
More details about the exec_dir patch: The exec_dir patch homepage (About, Installation, Configuration)

About this custom module:

This custom module for EasyApache, adds a new option in the PHP parameters ("exec_dir patch") which allows the administrator to easily install this patch. The custom module will detect the selected PHP version, download the correct patch via wget and patch the PHP sources.

Download:

View attachment custom_opt_mod-php5-phpexecdirpatch.zip

Install:

- Unzip the archive under /var/cpanel/easy/apache/custom_opt_mods/
- Go to the EasyApache page in WHM
- Select the "exec_dir patch" check box under the PHP parameters
- Finish the EasyApache procedure to compile and install Apache and PHP
- Edit your php.ini file accordingly (cPanel default php.ini is: /usr/local/lib/php.ini)


Please let me know if you have any problems.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
If its true, its really Amazing !!

Can any cPanel staff confirm this Please ? i think every shared hosting want this module.
Hello :)

Could you elaborate on what you would like confirmed? This is a third-party workaround that is not provided by cPanel. You are welcome to research and utilize this workaround, however it's not something that cPanel can provide support for.

Thank you.
 

sehh

Well-Known Member
Feb 11, 2006
579
6
168
Europe
He is probably thinking "oh my God, this is too good to be true!" :D
 

ITGabs

Well-Known Member
Jul 30, 2013
81
0
6
cPanel Access Level
Root Administrator
Interesting, today I was reading a lot about hardening php and I see similar problems with suhosin, thanks to pointing me to this thread sehh ;)