I've read through a number of issues on this (http://drupal.org/node/736824, http://drupal.org/node/916438, and http://drupal.org/node/918468) but I'm still having trouble.

My basic problem is the same as the issues listed above. Whenever I run drush, I get

exec() has been disabled for security reasons environment.inc:689    [warning]
The following restricted PHP modes have non-empty values:                [error]
disable_functions.

I have copied example.drush.ini to ~/bin/drush/drush.ini

and uncommented the line

disable_functions =

But I still get the error. It doesn't seem to recognize the overrides in the drush.ini file

I've also tried

drush --php-ini=~/bin/drush/drush.ini status

but no luck.

I would be very grateful for a nudge in the right direction.

Many thanks!

Comments

greg.1.anderson’s picture

Status: Active » Postponed (maintainer needs more info)

Use drush status to see which php.ini drush is using.

You can't use --php-ini to set the file drush will use; you must use an environment variable, or drush.ini. See drush topic, and read the drush script.

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Active

Hi greg.1.anderson,

Thanks for the quick reply.

drush status gives me

PHP configuration : /usr/local/lib/php.ini

I also have a drush.ini file at ~/bin/drush

The drush.ini file is a copy of example.drush.ini with the line

disable_functions =

un-commented.

Hope this additional info helps. Let me know if I can provide other information.

Your help is much appreciated!

Doug

greg.1.anderson’s picture

Status: Active » Postponed (maintainer needs more info)

Read #1 again and check the documentation and the drush script. You should be able to track this one down on your own easier than I can guess what's wrong (but maybe it's that you put drush.ini in your drush folder instead of your $HOME/.drush folder).

Also, please follow the instructions at http://drupal.org/node/add/project-issue/drush before posting support requests.

Anonymous’s picture

OK - Thanks for the reply.

I did do 2 hours on this before posting, trying the approaches in the documentation, including putting drush.ini in ~/.drush (but maybe that is not the right place?)

In any case, I'll keeping working on it on my own, and I'll post back here if I come up with something.

Thanks also for the link to the instructions for posting a support request. Those are helpful tips.

Anonymous’s picture

Hi there,
similar issues for me with the php.ini/drush.ini on my shared hosting.

From the various documentations and posts i got the idea to put

alias drush='/usr/bin/php535 /home/www/tools/drush/drush.php'
alias php='/usr/bin/php535'

into the .bashrc in my home directory to be able to use drush at all.

A lot of commands work fine, but the quite important ones like "up" throw errors.

The command could not be executed successfully (returned: Failed     [error]
loading
/usr/share/extensions/vers_extensions/ioncube_loader_lin_PHP535.so: 
/usr/share/extensions/vers_extensions/ioncube_loader_lin_PHP535.so:
undefined symbol: _zend_hash_init
Failed loading
/usr/share/extensions/vers_extensions/ZendOptimizerPHP535.so: 
/usr/share/extensions/vers_extensions/ZendOptimizerPHP535.so:
undefined symbol: OnUpdateLong
Your command line PHP installation is too old. Drush requires at
least PHP 5.2.0
, code: <em class="placeholder">-1</em>)

php -v tells me that the cli version should be ok:

bash-3.2$ php -v
PHP 5.3.5 (cli) (built: Jan 17 2011 13:01:25) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with the ionCube PHP Loader v4.0.8, Copyright (c) 2002-2011, by ionCube Ltd., and
    with Zend Optimizer+ v4.1, Copyright (c) 1999-2010, by Zend Technologies

drush status tells me that it uses the php.ini from /etc/php.ini, which is the same as the webserver.
There, i can find those lines also referring to this ioncube and Zend-stuff mentioned in the error message:

...
zend_extension = /usr/share/extensions/vers_extensions/ioncube_loader_lin_PHP535.so
[Zend]
zend_extension=/usr/share/extensions/vers_extensions/ZendOptimizerPHP535.so
zend_optimizerplus.memory_consumption=10
...

Now, i was trying to use the drush.ini from the examples, and put it in .drush as well as in the drush-folder, but to no avail.
drush status still refers to the /etc/php.ini

What other commands could i put in which other files to tell drush not to use /etc/php.ini but that drush.ini ?
I assume that the key lies within the .bashrc, but as this all is rocket science for me, i have really no clue what else to try to make drush run correctly.

Thanx for any hints
Cheers
Bernd

Anonymous’s picture

I'm glad you posted, because I've been meaning to follow up with the work-around that has gotten me back up and running with my shared host.

After trying all sorts of different things, I accidentally discovered that running drush by entering the full path/to/drush/drush worked, and used the drush.ini file. When running just drush, drush would give the "exec() has been disabled for security reasons environment.inc" error and would call the host's php.ini file.

Could this have something to do with using an alias for drush? I haven't had a chance to look into that quite yet, but I'm happy to be drushing again.

Hope this helps!

greg.1.anderson’s picture

Status: Postponed (maintainer needs more info) » Fixed

The handling for drush.ini is inside of the drush script, so that feature won't be available to you if you call drush.php directly.

It is better to use the drush script, but if you must call drush per #5 above, read the php documentation to see how to set you php.ini, etc.; also, pass drush the --php-options and --php command line options to tell it what php, and what options to use when drush needs to re-launch drush in a subprocess.

Read the drush script for examples.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.