3

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()

3

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

...and also a discussion of local development environments we had here might be of interest as well: Shootout at the Local Dev Corral

|improve this answer|||||
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:

<VirtualHost *:80>
  ErrorLog /var/log/apache2/error.log
  CustomLog /var/log/apache2/access.log combined

  DocumentRoot /app/web

  <Directory '/app/web'>
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>
|improve this answer|||||
1

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
|improve this answer|||||
  • What should you do if you don't have access to the command line tools? – Aric Harris Mar 12 at 16:16

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.