-1

I set the drush alias in my .bash_profile as stated in the doc:

alias drush='DRUSH_PHP=/usr/local/php54/bin/php /home/dx_/drush/drush'

when I run the "drush status" the correct php version shows up

PHP configuration     :  /usr/lib/php5.5/php.ini

But when I want to run a drush sql-dump

The external command could not be executed due to an application error.                                                [error]
                                 [error]ly (returned: X-Powered-By: PHP/4.4.9

I tried to add an alias in aliases.drushrc.php but with no success.

Anyone sees what could be the problem?

  • 2
    Show the complete output of your sql-dump command, with the --debug flag set. From the partial information shown above, my guess is that you are running drush status locally to confirm the version of the local PHP, but you are probably using some remote alias (drush @remote sql-dump), and running into a problem with the PHP version on the remote machine. Please also show the complete contents of any alias you are using (with any sensitive information redacted). – greg_1_anderson Nov 13 '15 at 15:30
0

Thanks greg for taking time to answer me.

Sorry I was just stupidly running my drush command at the root of my server and not in my website directory and the error message was stated "X-Powered-By: PHP/4.4.9" which made me confuse

(uiserver):uxxxxxxx:~ > drush sql-dump
The external command could not be executed due to an application     [error]
error.
The command could not be executed successfully (returned:            [error]
X-Powered-By: PHP/4.4.9
Content-type: text/html

<br />
<b>Parse error</b>:  syntax error, unexpected '{' in
<b>/homepages/xx/dxxxxxxxxxxx/htdocs/.composer/vendor/drush/drush/includes/environment.inc</b>
on line <b>545</b><br />
, code: 255)

How ever the only .bash_profile setting that works for me is as follow:

alias drush='/usr/bin/php5.5-cli ~/.composer/vendor/drush/drush/drush.php'
export COLUMNS

As you said yourself in one of your post aliasing drush to call php directly is outdated. But I couldn't successffully set the DRUSH_PHP variable.

this

alias drush="~/.composer/vendor/drush/drush/drush.php"
export DRUSH_PHP='/usr/bin/php5.5-cli'
export PATH="$DRUSH_PHP:$PATH"
export COLUMNS

or this

alias drush='DRUSH_PHP=/usr/local/php54/bin/php ~/.composer/vendor/drush/drush/drush.php'
export COLUMNS

both give me:

(uiserver):uxxxxxxxx:~ > drush status
X-Powered-By: PHP/4.4.9
Content-type: text/html

<br />
<b>Parse error</b>:  syntax error, unexpected '{' in <b>/homepages/xx/dxxxxxxxxx/htdocs/.composer/vendor/drush/drush/includes/environment.inc</b> on line <b>545</b><br />

Am I doing something wrong?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.