How To fix the Drush error "exec() has been disabled for security reasons bootstrap.inc"
I occasionally have to deal with shared hosting. Which I'll admit, I'm not real happy about as I generally have to install a bunch of my default tools, most of which then have to be 'fixed' to work on [insert cheap hosting firm's name]'s concept of security.
As I just did this (again), here is the 'patch' for drush to make it 'play nice.'
Summary Procedure
Copy php.ini to a drush usable location and edit for your problems.
Detailed Procedure
The Error:
# drush status exec() has been disabled for security reasons bootstrap.inc:645 [warning] exec() has been disabled for security reasons bootstrap.inc:645 [warning] PHP executable : /usr/bin/php-cli PHP configuration : /usr/local/lib/php.ini PHP OS : Linux Drush version : 6.6.0 Drush configuration : Drush alias files :
Your first step is to identify where your existing php.ini is. Thankfully the drush status above tells you, "/usr/local/lib/php.ini".
Your next step depends on if you are on shared or dedicated hosting.
For Shared Hosting:
Copy your system php.ini to either $HOME/.drush or your actual drush directory.
For Dedicated Server:
Copy your system php.ini to /etc/drush/php.ini.
Then remove 'exec' from the 'disable_functions' list in the php.ini you've copied.
$ grep disable php.ini ; This directive allows you to disable certain functions for security reasons. disable_functions = show_source, system, shell_exec, passthru, popen, proc_open
Afterwards they should look like:
$ grep disable php.ini ; This directive allows you to disable certain functions for security reasons. disable_functions = show_source, system, shell_exec, passthru, popen, proc_open $ drush status PHP executable : /usr/bin/php-cli PHP configuration : /etc/drush/php.ini /etc/drush/php.ini PHP OS : Linux Drush version : 6.6.0 Drush configuration : Drush alias files :
# # #
All for today!
Michael
Footnotes:
As I want want all users on my servers to use the same drush php.ini, I place drush's php.ini in /etc/drush.
Comments
Tyson (not verified)
Tue, 2018-02-27 23:26
Permalink
Nice Content
Nice.
Add new comment