Not sure if this should be a support or a feature request.

I have been using hostgator for a host and have shell access, thus have been using drush without any significant issues.

However, register_globals is turned on by default, and I have overidden the default by making a php.ini file in my home directory with register_globals = Off in it. Now whenever I run drush updatedb it gives me the warning message that register_globals is on, although when I run update.php I don't get that error. Just a small thing. Thus it seems to be taking it from the default php.ini file, not the site (perhaps server) specific php.ini file. (I also see register_globals is deactivated when I run phpinfo() for an additional check.)

Is there any way to have it get the settings set by a site/server specific php.ini file when using the updatedb command?

Comments

moshe weitzman’s picture

Status: Active » Fixed

you can pass php.ini values on the command line i use a bash alias for this, but you could type it out every time if you want:

alias drush='php -d error_reporting=E_ALL ~/contributions/modules/drush/drush.php'

or you can use drush status command and edit the php.ini that drush is really using. if you don't have acesss to that, then you have to use command line as i have shown.

Status: Fixed » Closed (fixed)

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

magnusk’s picture

Version: All-Versions-2.1 »
Category: support » bug
Status: Closed (fixed) » Active

I have checked with "drush status" that the correct php.ini is loaded (using a -c command line option for php), where

register_globals        =       Off

I've also tried to use a -d command-line option to launch php and set that value to Off.

Nevertheless, every time I run "drush up" I get the following warning.

<em>register_globals</em> is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when <em>register_globals</em> is enabled. The PHP manual has instructions for <a href="http://php.net/configuration.changes">how to change configuration settings</a>. (Currently using PHP register globals Enabled ('1'))

Drupal runs just fine via Apache, with the same php.ini as referenced above -- register_globals is and remains off. The site Status report (admin/reports/status) says:

PHP register globals	Disabled

I'm using a hosted account at pair.com. Their default php.ini has register_globals On. Is there some strange execution of a php script that switches to the default php.ini instead of the one specified to drush.php?

tallship’s picture

Version: » All-versions-4.x-dev

Hostgator on this end as well.

alias drush='php -d error_reporting=E_ALL ~/contributions/modules/drush/drush.php'

is modified in my case to:

alias drush='php -d error_reporting=E_all /home/USERNAME/drush/drush'

I still get the same report of register_globals bein on when doing a "drush status" or "drush updatedb", and as noted above, a phpinfo() shows it as off as it should.

It seems that bash running drush sees /usr/local/lib/php.ini while apache sees /home/USERNAME/php.ini.

So, aside from slinging this warning, it doesn't seem to cause any issues or make drush abend, so my assumption is that it is safe as long as I'm aware that drush is going to throw this error?

kotnik’s picture

It should be safe, but you can alias Drush this way to turn off registering globals:

alias drush='php -d register_globals=0 ~/contributions/modules/drush/drush.php'

symvan’s picture

I am on hostgator too. A cleaner solution would be either to copy (or create a symbolic link) of /home/USER/php.ini in your drush directory as this is where the script looks before it resorts to the system path and /home/USER/php.ini is what takes affect in your installation anyway.

greg.1.anderson’s picture

Version: All-versions-4.x-dev » 8.x-6.x-dev
Status: Active » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.