Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drush pm-update and pm-updatecode using incorrect PHP version #2027

Closed
todda00 opened this issue Feb 25, 2016 · 2 comments
Closed

drush pm-update and pm-updatecode using incorrect PHP version #2027

todda00 opened this issue Feb 25, 2016 · 2 comments

Comments

@todda00
Copy link

todda00 commented Feb 25, 2016

I have Drush 8.0.3 installed, it is using the correct PHP-CLI version when calling most commands, but for some reason calling pm-update or pm-updatecode results in the headers being printed and failing.

Here is the output:

drush pm-updatecode
Illegal string offset 'site' backend.inc:1037                                                                                                                                       [warning]
                                                                                                 [error]
Content-type: text/html; charset=UTF-8

<br />
<b>Warning</b>:  proc_open(): Descriptor item must be either an array or a File-Handle in <b>phar:///usr/local/bin/drush/includes/startup.inc</b> on line <b>366</b><br />
<br />
<b>Warning</b>:  proc_get_status() expects parameter 1 to be resource, boolean given in <b>phar:///usr/local/bin/drush/includes/startup.inc</b> on line <b>367</b><br />
<br />
<b>Warning</b>:  proc_close() expects parameter 1 to be resource, boolean given in <b>phar:///usr/local/bin/drush/includes/startup.inc</b> on line <b>368</b><br />
, code: 0)
pm-updatestatus failed.                                            

Seems this is trying to use the CGI version even though when I run php -v it comes back with the CLI version:

php -v
PHP 5.6.16 (cli) (built: Dec 15 2015 14:00:53) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

Here is my .bashrc:

alias php='/usr/bin/php-cli'
alias drush='/usr/bin/php-cli /usr/local/bin/drush'

And here is drush status for the Drupal 8 site I am trying to update:

drush status
 Drupal version                  :  8.0.2                                                                                                      
 Site URI                        :  http://default                                                                                             
 Database driver                 :  mysql                                                                                                      
 Database hostname               :  localhost                                                                                                  
 Database port                   :  3306                                                                                                       
 Database username               :  condev_spicerd8                                                                                            
 Database name                   :  condev_spicerd8                                                                                            
 Drupal bootstrap                :  Successful                                                                                                 
 Drupal user                     :                                                                                                             
 Default theme                   :  spicer                                                                                                     
 Administration theme            :  seven                                                                                                      
 PHP configuration               :  /usr/local/lib/php.ini                                                                                     
 PHP OS                          :  Linux                                                                                                      
 Drush script                    :  /usr/local/bin/drush                                                                                       
 Drush version                   :  8.0.3                                                                                                      
 Drush temp directory            :  /tmp                                                                                                       
 Drush configuration             :                                                                                                             
 Drush alias files               :                                                                                                             
 Install profile                 :  standard                                                                                                   
 Drupal root                     :  /home/condev/public_html/spicer                                                                            
 Drupal Settings File            :  sites/default/settings.php                                                                                 
 Site path                       :  sites/default                                                                                              
 File directory path             :  sites/default/files                                                                                        
 Temporary file directory path   :  /tmp                                                                                                       
 Sync config path                :  [OMITED] 
@weitzman
Copy link
Member

.bashrc aliases are not that reliable when Drush redispatches. Instead adjust your $PATH to put the right PHP in front. Since you are not using the .phar install method, you could alternatively declare a DRUSH_PHP environment variable and set /path/to/php there.

@todda00
Copy link
Author

todda00 commented Feb 25, 2016

Sweet, thanks for the fast reply. This essentially fixed my issue, or at least set me down the right path to fix some other environmental issues I had. Working great now, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants