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

Again error "pm-updatestatus failed" and version PHP #2826

Closed
pselfin opened this issue Jun 29, 2017 · 5 comments
Closed

Again error "pm-updatestatus failed" and version PHP #2826

pselfin opened this issue Jun 29, 2017 · 5 comments

Comments

@pselfin
Copy link

pselfin commented Jun 29, 2017

Hi!
Drush installed via composer.
In my .bashrc/.bash_profile added

export DRUSH_PHP='/opt/php56/bin/php'
export COLUMNS
alias composer='/opt/php56/bin/php -d memory_limit=500M /home/c/XXXX/composer.phar'
alias drush='/opt/php56/bin/php -d memory_limit=500M /home/c/XXXX/vendor/bin/drush.php'

alias work good

public_html$ drush --version
 Drush Version   :  8.1.12

Commands drush status/cc/cr/dl workin very good. drush pm-updatestatus workin too...

But!
drush up don't work!((

Error:

public_html$ drush up
The external command could not be executed due to an application error.                                                                                 [error]
The command could not be executed successfully (returned: PHP Parse error:  syntax error, unexpected '[' in                                             [error]
/home/c/ct00533/vendor/drush/drush/includes/preflight.inc on line 341
, code: 255)
pm-updatestatus failed.  

Why???

Php version for drush ok:

public_html$ drush status
 PHP configuration               :  /etc/php56/cli/php.ini
 PHP OS                          :  Linux
 Drush script                    :  /home/c/XXXX/vendor/drush/drush/drush.php
 Drush version                   :  8.1.12

Help me, please!

--
Sory for my English

PS of course read issue #2027 #2155 #1294 , shared hosting, can't restart mysql server.

@weitzman
Copy link
Member

DRUSH_PHP is not supported anymore. You are better off changing your PATH so that the desired PHP comes first. You can do that for each call to Drush (PATH=\path\to\php:$PATH drush pm-update ...or change your PATH in your .bashrc.

I'm not sure that PHP path is your problem but its the first thing that comes to mind.

@Niklan
Copy link

Niklan commented Jul 3, 2017

@weitzman Hi. I looked at the problem and this is looks like real error.

Currently .basrhc file contains:

PATH="/opt/php70/bin/php:$PATH:~/.config/composer/vendor/bin"

and .bash_profile

export COLUMNS
alias php='/opt/php70/bin/php'
alias drush='/opt/php70/bin/php ~/.config/composer/vendor/drush/drush/drush.php'

Drush status works fine, but then I trying to execute drush up --debug I've got this log:

…
Cache MISS cid: 8.1.12-alias-path--9e2d30ac3720b8825322ab97fab87ce8 [0.27 sec, 28.96 МБ]                                                                                                                   [debug]
Backend invoke: php /home/c/user/.config/composer/vendor/drush/drush/drush.php  --backend=2 --verbose --debug --root=/home/c/user/balkon-plus-kuban.ru/public_html --uri=http://default              [command]
pm-updatestatus 2>&1 [0.27 sec, 28.98 МБ]
php /home/c/user/.config/composer/vendor/drush/drush/drush.php  --backend=2 --verbose --debug --root=/home/c/user/balkon-plus-kuban.ru/public_html --uri=http://default  pm-updatestatus 2>&1 [0.27   [notice]
sec, 28.98 МБ]
The external command could not be executed due to an application error. [0.31 sec, 28.98 МБ]                                                                                                           [error]
The command could not be executed successfully (returned: PHP Parse error:  syntax error, unexpected '[' in /home/c/user/.config/composer/vendor/drush/drush/includes/preflight.inc on line 341       [error]
, code: 255) [0.31 sec, 28.98 МБ]
pm-updatestatus failed. [0.31 sec, 28.98 МБ]                                                                                                                                                           [error]

Why did backend trying to invoke code from default PHP environment if it executed from other?

Backend invoke: php /home/c/user/.config/composer/vendor/drush/drush/drush.php

Why it still php, not /opt/php70/bin/php which set in alias? I think this is the problem.

@weitzman
Copy link
Member

weitzman commented Jul 3, 2017

The most reliable way to control the PHP that Drush uses is to change your PATH. You can do that forever in .bashrc, or you can do it for just one request: PATH=/path/to/php:PATH drush pm-update ...

@weitzman weitzman closed this as completed Jul 3, 2017
@Niklan
Copy link

Niklan commented Jul 3, 2017

The was misspell in PATH:

PATH="/opt/php70/bin/php:$PATH:~/.config/composer/vendor/bin"

/opt/php70/bin/php must be /opt/php70/bin ;) There is path to folder, not to binary. That's was mistake.

@pselfin
Copy link
Author

pselfin commented Jul 3, 2017

@weitzman @Niklan excellent!!!
Huge thanks!

For all.
Final working file .bash_profile

PATH="/opt/php70/bin:$PATH:~/.config/composer/vendor/bin"
alias composer='/opt/php70/bin/php /home/u/XXXX/composer.phar'
alias drush='/opt/php70/bin/php ~/.config/composer/vendor/drush/drush/drush.php'

/home/u/XXXX - your home dir.

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

3 participants