5

I just updated to Craft 3.1 and logged into the admin to make the required updates to the database and this all worked fine. However, when I use the new ./craft update CLI feature, it responds with "Craft isn't installed yet", even though it's on a year old Craft project and just successfully updated to Craft 3.1?

There's not really any other messages to go on for this one. See below.

Craft 3.1 update error

3 Answers 3

7

Have you tried running ./craft setup to double check if your setup is correct?

If ./craft setup completes successfully ./craft should find the existing installation and complete any required setup.

In my experience, this is usually related to a non-default /config/db.php or problematic .env file.

Note: Always do a backup before trying anything related to setup just to be on the safe side.

2
  • In my case the craft.bat file was missing. You might double check that as well ;)
    – outline4
    Commented Apr 17, 2020 at 5:08
  • 1
    My issue was using localhost instead of 127.0.01 - the latter worked.
    – iamkeir
    Commented Jul 2, 2020 at 11:25
5

You can get this error message even if Craft installation is OK. If you work in MAMP environment and have this error message, check if your PHP and MySQL are available from command line (Terminal).

To check PHP, do following:

Open terminal and type: $ which php If you see something like "/usr/bin/php" that means MAMP's PHP is not available from command line.

We have to modify the $PATH variable modifying the file ~/.bash_profile located in your root user folder. Type: $ sudo nano ~/.bash_profile

Edit PATH by entering path to MySQL and PHP (pay attention on php version that you have in your MAMP)

PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php7.3.9/bin:$PATH

Save changes and reload edited .bash_profile with:

$ source ~/.bash_profile

Check PHP with:

$ which php

If you see "/Applications/MAMP/bin/php/php7.3.9/bin/php" this is it ;)

3
  • In MAMP Pro there is a tickbox which basically does all this for you under PHP > Make this version available on the command line. Commented Mar 16, 2020 at 17:57
  • cheers Dusko, this worked for me on MAMP Commented Apr 10, 2020 at 14:56
  • This was exactly my issue and fixed me up perfectly. Thanks!
    – Brimby
    Commented Apr 25, 2020 at 1:17
1

If you are landing here in 2023: This seems to be a regularly recurring issue for a multitude of problems. Most likely though, your database settings are incorrect.

  1. Double-checking the database connection settings in the config/db.php file to make sure they are correct and the database server is running, keep in mind that in Craft 3 and Craft 4 this will lead you to checking your .env file for the correct variables. One key ENV variable to check is your DB_TABLE_PREFIX this value is usually default to craft_ but could be set to something custom!
  2. Creating the database and user specified in the config/db.php file, if they do not already exist. Double check that you have the correct user and password!
  3. Ensuring that the web server has the necessary permissions to read and write to the config/ and storage/ directories. We usually start with chmod 755 and slowly increase from there.
  4. Clearing the browser cache and cookies, as sometimes this can cause issues with the installation process. Another easy way is to just use an incognito browser for a sanity check, as there usually is no browser cache or leftover cookies associated with an incognito session.
  5. Checking the PHP error logs for more information about the specific issue. You can find the logs for Craft in storage/logs/*.log
  6. Check the craft version you are using if it matches with your php version. This is especially true if this is a Craft 4 site, as there is now a requirement of PHP 8. 

You can read more here: Craft CMS Isn't Installed Yet?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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