In the control panel in /utilities/updates I can see I have a Craft update and several plugin updates available. I prefer to update via the command line to avoid browser timeouts etc so ran ./craft update but I get this output:
Craft isn鈥檛 installed yet!
Fetching available updates ... done
You鈥檙e all up-to-date!
I also noticed if I run ./craft help it _does_ output the help options but it says Craft isn鈥檛 installed yet! before the help options.
./craft updateYeah the update command isn鈥檛 going to give accurate results if the CLI thinks Craft isn鈥檛 installed yet, as is the case here.
Couple things to check, to get that working:
Make sure you鈥檙e running the terminal command from the same environment that Craft is actually installed in. For example if Craft is running in a Vagrant box, make sure that you鈥檙e SSH鈥檇 into the Vagrant box before running it.
Try changing the DB_SERVER environment variable from localhost to 127.0.0.1.
The site is running through MAMP, I'm assuming I'm in the correct environment.
I ran the ./craft migrate command successfully on another similar project. I did have to change the DB_SERVER variable to 127.0.0.1 on that occasion but I had already tried that for this site too and it didn't change anything.
Do you still have the other project around? If so can you update it to the latest version and then try running the migrate command again on it, and see if you get the same Craft isn鈥檛 installed yet! output? (Ignoring whether the command works in general or not).
All sorted! I turned on the setting in MAMP to Allow network access to MySql which I've never touched before so no idea why it was fine before!
Anyway, all good. Thanks for pointing me in the right direction :)
Ah great! I鈥檝e never noticed that setting either :) Thanks for the update, we鈥檒l have to remember that one.
All sorted! I turned on the setting in MAMP to
Allow network access to MySqlwhich I've never touched before so no idea why it was fine before!Anyway, all good. Thanks for pointing me in the right direction :)
Anyone know a WAMP equivalent solution to this?
@away86 not tested, but try https://dba.stackexchange.com/questions/186301/how-to-enable-remote-access-to-wamp-mysql
I realised that each person may have different cause for the same symptom.
For me, I'm using WAMP on Windows, and I was getting the following message in console.log:
[craft\services\Updates::getUpdates] Couldn't get updates: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
It was weird because I previously fixed this issue for the web version for the local Plugin Store / Craft Updates (in the CP), based on this post. Not sure why it still happened for the CLI version.
I eventually fixed it by adding the following code to config/guzzle.php:
<?php
return [
'*' => [
'verify' => true, // this is Guzzle / Craft default setting anyway.
],
'dev' => [
'verify' => "C:/wamp/bin/php/cacert.pem", // change it to the path for your own cacert.pem, or it can be false if you don't have a cacert.pem
],
];
References:
Hope this helps someone using WAMP with the same issue as me.
Just curious @brandonkelly , is there any concern if we set 'verify' to false for the local dev environment?
Most helpful comment
Yeah the
updatecommand isn鈥檛 going to give accurate results if the CLI thinks Craft isn鈥檛 installed yet, as is the case here.Couple things to check, to get that working:
Make sure you鈥檙e running the terminal command from the same environment that Craft is actually installed in. For example if Craft is running in a Vagrant box, make sure that you鈥檙e SSH鈥檇 into the Vagrant box before running it.
Try changing the
DB_SERVERenvironment variable fromlocalhostto127.0.0.1.