Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : Using WP-Cli



Threaded Mode | Print  

 Using WP-Cli, WP-Cli seems to be broken (8 Replies, Read 4663 times)
azanebrain
Group: Member
Post Group: Newbie
Posts: 4
Status:
I've setup wp-cli (wp-cli.org/) on my machine, but it is unable to run any commands from the path of the wordpress site.
Running the basic `wp` command returns this error:

Error:
<h1>Error establishing a database connection</h1>
<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>localhost</code>. This could mean your host's database server is down.</p>
<ul>
    <li>Are you sure you have the correct username and password?</li>
    <li>Are you sure that you have typed the correct hostname?</li>
    <li>Are you sure that the database server is running?</li>
</ul>
<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='wordpress.org/support/'>WordPress Support Forums</a>.</p>

I have found a lot of support for this error with MAMP, but nothing with AMPPS. The main lead seems to be the bath to the PHP binary, however I've had no luck.
link: github.com/wp-cli/wp-cli/wiki/Alternative-Install-Methods

Has anyone been able to figure out how to run wp-cli with AMPPS?
IP: --   

Using WP-Cli
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Hi,

AMPPS PHP and MySQL are not in environment variable, so you may have to set their path in PATH variable.


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Using WP-Cli
azanebrain
Group: Member
Post Group: Newbie
Posts: 4
Status:
Are those paths /Applications/AMPPS/<php version>/bin and /Applications/AMPPS/mysql/bin ?
When I tried that (export WP_CLI_PHP=/Applications/AMPPS/php-5.3/bin in my .bash_profile) , I got a jumbled output of question marks and diamonds, and the PHP binary path in wp --info is still `/usr/bin/php`
IP: --   

Using WP-Cli
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Hi,

You can create a symlink at that location if necessary.

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Using WP-Cli
azanebrain
Group: Member
Post Group: Newbie
Posts: 4
Status:
Thanks for the quick responses

I tried symlinking to AMPPS/bin/php, and AMPPS/php-5.3/bin/php but those totally broke wp-cli (before I could run command such as `wp --info`)

I'm on Mac OS Mavericks, running AMPPS 2.3 if that helps
IP: --   

Using WP-Cli
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Hi,

AMPPS/bin/php ? I don't think symlink here is necessary.

wp is looking for php in /usr/bin/php, so create one there.

Code
ln -s /Applications/AMPPS/php/bin/php /usr/bin/php





-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Using WP-Cli
azanebrain
Group: Member
Post Group: Newbie
Posts: 4
Status:
That's the command I ran, but it turned out I also had to set the PHP version to 5.4. The WP-Cli official page says it supports PHP 5.3.2 or later, so I'm guessing AMPPS 5.3 is 3.0 or 3.1?

Thanks for the help, Tidus!
IP: --   

Using WP-Cli
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Hi,

PHP 5.3.28.

It also has PHP 5.4.25 and 5.5.9.


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Using WP-Cli
lrussell
Group: Member
Post Group: Newbie
Posts: 3
Status:
I just ran into this too, I posted my solution here: http://lucrussell.com/fix-for-wp-cli-ammps-printing-rubbish/
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is March 19, 2024, 7:21 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.023