<p>If you've just imported a database, it could mean your project.yaml is out of sync in your environment.</p>

<p>I fixed this by running the CLI command:</p>

<pre><code>./craft project-config/sync
</code></pre>

CC BY-SA 4.0
2020-03-12T16:16:22.513Z
What should you do if you don't have access to the command line tools?
Aric Harris
CC BY-SA 4.0
2020-06-02T21:52:09.227Z
You can also sync changes in the project config by visiting the control panel in your browser (usually `/admin`). Click the "Sync changes" button at the prompt.
Alex Roper
CC BY-SA 4.0
2019-10-03T10:46:13.677Z
2019-10-03T10:46:13.677Z
Matt E
<p>For those creating a fresh install using <a href="https://craftcms.com/docs/nitro/2.x/" rel="nofollow noreferrer">Craft CMS Nitro</a> and its <code>nitro create</code> command, don't forget to run the the Setup Wizard as a final step, as described in <a href="https://craftcms.com/docs/3.x/installation.html#step-6-run-the-setup-wizard" rel="nofollow noreferrer">Step 6: Run the Setup Wizard</a>, from the Craft Docs:</p>
<p>Either run the setup from the admin dashboard, which redirects to:  yoursite.com/admin/install</p>
<p>Or you can run <code>nitro php craft setup</code> and complete setup from the terminal.</p>
<p>This will populate the database with Craft's tables &amp; data and should address the 503 error.</p>

CC BY-SA 4.0
2021-10-25T23:36:35.037Z
2021-10-31T18:42:40.590Z
2021-10-31T18:42:40.590Z
Natetronn
<p>For me, the problem was that Apaches <code>mod_rewrite</code> wasn't enabled and Crafts <code>.htaccess</code>-file was ignored while the config <code>omitScriptNameInUrls =&gt; true</code> was set.</p>

<p>Looking at the code from the stacktrace, it looks like Craft was unable to determine that the request actually was for the CP and it didn't allow the installation to start, throwing the Error and returning 503 instead.</p>

<p>So if your URLs don't work without <code>index.php?p=</code> in front of them and you're serving via Apache, chances are that you need to enable <code>mod_rewrite</code> and then Craft will allow you to install.</p>

<pre><code>a2enmod rewrite
</code></pre>

<p>If this doesn't help, make sure that overriding the server-config via <code>.htaccess</code> is allowed for your <code>VirtualHost</code>. Here is an example configuration:</p>

<pre><code>&lt;VirtualHost *:80&gt;
  ErrorLog /var/log/apache2/error.log
  CustomLog /var/log/apache2/access.log combined

  DocumentRoot /app/web

  &lt;Directory '/app/web'&gt;
    AllowOverride All
    Require all granted
  &lt;/Directory&gt;
&lt;/VirtualHost&gt;
</code></pre>

CC BY-SA 4.0
2019-06-21T12:37:09.930Z
2019-06-21T12:37:09.930Z
Lukas Knuth
<p>I had to answer a craft prompt about db backup on <code>/admin</code> page before I was able to access any other pages</p>

CC BY-SA 4.0
2024-06-13T19:30:42.363Z
↑ Try this tip first. The reason might be: After installing the required Craft CMS dependencies via Composer, Craft CMS itself needs to be installed as well.
Frank Lämmer
CC BY-SA 4.0
2022-10-20T22:02:53.820Z
2022-10-20T22:02:53.820Z
R Bartlett
<p>Anytime I run into this issue, it's either the database settings are incorrect or I need to run composer install, so I am posting this as an answer because I am sure I will end up back at this question trying to figure out what I didn't do right.</p>

CC BY-SA 4.0
2021-01-20T14:29:05.907Z
./craft project-config/sync did the trick.
Brad
CC BY-SA 4.0
2020-09-10T20:03:41.893Z
2020-09-10T20:03:41.893Z
Brad
<p>I had a site where in <code>general.php</code>, the staging section had the <code>'isSystemLive' =&gt; false,</code></p>

<p>It was driving me batty why I could only see the front-end if logged in.</p>

CC BY-SA 4.0
2020-05-27T02:34:04.687Z
2020-05-27T02:34:04.687Z
Alex Aguilar
<p>Very likely it cannot connect to the database; that's typically what the <code>503</code> error is about:</p>

<p><a href="https://httpstatuses.com/503" rel="noreferrer">https://httpstatuses.com/503</a></p>

<p>...so check the credentials in your <code>.env</code> file, and make sure that the version of MySQL that your website is using is the internal MAMP MySQL, and not the system-wide MySQL (if any).</p>

<p>This video may help you: <a href="https://www.youtube.com/watch?v=SqSp-CvKwJM&amp;t=5s" rel="noreferrer">Installing Craft CMS v3 with MAMP Pro</a></p>

<p>...and also a discussion of local development environments we had here might be of interest as well: <a href="https://devmode.fm/episodes/shootout-at-the-local-dev-corral" rel="noreferrer">Shootout at the Local Dev Corral</a></p>

CC BY-SA 4.0
2018-07-20T19:41:07.690Z
2018-07-20T19:41:07.690Z
andrew.welch
<p>I tried installing Craft 3.0 using composer (php composer.phar create-project craftcms/craft PATH)</p>

<p>And when I try to access the /web folder it's giving me the following error. I have tried removing the folder and installing it afresh again. I am currently using MAMP on my osx localhost.</p>

<blockquote>
  <ol>
  <li><p>in /Applications/MAMP/htdocs/craft/vendor/craftcms/cms/src/web/Application.php at line 498</p></li>
  <li><p>in /Applications/MAMP/htdocs/craft/vendor/craftcms/cms/src/web/Application.php at line 175 – craft\web\Application::_processInstallRequest(craft\web\Request)</p></li>
  <li><p>in /Applications/MAMP/htdocs/craft/vendor/yiisoft/yii2/base/Application.php at line 386 – craft\web\Application::handleRequest(craft\web\Request)</p></li>
  <li><p>in /Applications/MAMP/htdocs/craft/web/index.php at line 21 – yii\base\Application::run()</p></li>
  </ol>
</blockquote>

<installation>
HTTP 503 – Service Unavailable – craft\web\ServiceUnavailableHttpException [installation]
# HTTP 503 – Service Unavailable – craft\web\ServiceUnavailableHttpException [installation]

(Asked by: username_0 on 2018-07-20)

I tried installing Craft 3.0 using composer (php composer.phar create-project craftcms/craft PATH)

And when I try to access the /web folder it's giving me the following error. I have tried removing the folder and installing it afresh again. I am currently using MAMP on my osx localhost.

> 1. in /Applications/MAMP/htdocs/craft/vendor/craftcms/cms/src/web/Application.php at line 498
> 2. in /Applications/MAMP/htdocs/craft/vendor/craftcms/cms/src/web/Application.php at line 175 – craft\web\Application::\_processInstallRequest(craft\web\Request)
> 3. in /Applications/MAMP/htdocs/craft/vendor/yiisoft/yii2/base/Application.php at line 386 – craft\web\Application::handleRequest(craft\web\Request)
> 4. in /Applications/MAMP/htdocs/craft/web/index.php at line 21 – yii\base\Application::run()

**Tags:** installation

---

## 7 answers

### Answer by username_10 on 2018-07-20. Score: 10 | Accepted answer

Very likely it cannot connect to the database; that's typically what the `503` error is about:

<https://httpstatuses.com/503>

...so check the credentials in your `.env` file, and make sure that the version of MySQL that your website is using is the internal MAMP MySQL, and not the system-wide MySQL (if any).

This video may help you: [Installing Craft CMS v3 with MAMP Pro](https://www.youtube.com/watch?v=SqSp-CvKwJM&t=5s)

...and also a discussion of local development environments we had here might be of interest as well: [Shootout at the Local Dev Corral](https://devmode.fm/episodes/shootout-at-the-local-dev-corral)


---

### Answer by username_1 on 2019-10-03. Score: 10

If you've just imported a database, it could mean your project.yaml is out of sync in your environment.
I fixed this by running the CLI command:
./craft project-config/sync

> **Comments:**
> **username_2**: What should you do if you don't have access to the command line tools?  
> **username_3**: You can also sync changes in the project config by visiting the control panel in your browser (usually `/admin`). Click the "Sync changes" button at the prompt.  

---

### Answer by username_4 on 2021-10-25. Score: 3

For those creating a fresh install using [Craft CMS Nitro](https://craftcms.com/docs/nitro/2.x/) and its `nitro create` command, don't forget to run the the Setup Wizard as a final step, as described in [Step 6: Run the Setup Wizard](https://craftcms.com/docs/3.x/installation.html#step-6-run-the-setup-wizard), from the Craft Docs:

Either run the setup from the admin dashboard, which redirects to: yoursite.com/admin/install

Or you can run `nitro php craft setup` and complete setup from the terminal.

This will populate the database with Craft's tables & data and should address the 503 error.


---

### Answer by username_5 on 2019-06-21. Score: 1

For me, the problem was that Apaches mod_rewrite wasn't enabled and Crafts .htaccess-file was ignored while the config omitScriptNameInUrls => true was set.
Looking at the code from the stacktrace, it looks like Craft was unable to determine that the request actually was for the CP and it didn't allow the installation to start, throwing the Error and returning 503 instead.
So if your URLs don't work without index.php?p= in front of them and you're serving via Apache, chances are that you need to enable mod_rewrite and then Craft will allow you to install.
a2enmod rewrite

If this doesn't help, make sure that overriding the server-config via .htaccess is allowed for your VirtualHost. Here is an example configuration:

  ErrorLog /var/log/apache2/error.log
  CustomLog /var/log/apache2/access.log combined

  DocumentRoot /app/web

  
    AllowOverride All
    Require all granted


---

### Answer by username_6 on 2022-10-20. Score: 1

I had to answer a craft prompt about db backup on `/admin` page before I was able to access any other pages

> **Comments:**
> **username_7**: ↑ Try this tip first. The reason might be: After installing the required Craft CMS dependencies via Composer, Craft CMS itself needs to be installed as well.  

---

### Answer by username_8 on 2020-09-10. Score: 1

Anytime I run into this issue, it's either the database settings are incorrect or I need to run composer install, so I am posting this as an answer because I am sure I will end up back at this question trying to figure out what I didn't do right.

> **Comments:**
> **username_8**: ./craft project-config/sync did the trick.  

---

### Answer by username_9 on 2020-05-27. Score: 1

I had a site where in `general.php`, the staging section had the `'isSystemLive' => false,`

It was driving me batty why I could only see the front-end if logged in.


---

