2

When attempting to install Craft 3 in OSX El Cap, I'm getting the following errors:

Script @php craft setup/welcome handling the post-create-project-cmd event returned with error code 255 /Craft3/vendor/craftcms/cms/bootstrap/bootstrap.php on line 104

Parse error: parse error in PATH/vendor/craftcms/cms/bootstrap/bootstrap.php on line 104 Script @php craft setup/welcome handling the post-create-project-cmd event returned with error code 255

I used the --ignore-platform-reqs flag as I am using PHP7 on MAMP.

When I attempt to load index.php in the browser I'm seeing this seemingly related issue in the trace:

in PATH/web/index.php at line 21 – yii\base\Application::run() 15161718192021 (new Dotenv\Dotenv(CRAFT_BASE_PATH))->load();}

// Load and run Craft define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); $app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/web.php'; $app->run();

I've substituted "PATH" in all errors in lieu of the actual path.

Any advice on resolving this would be much appreciated.

  • Sounds like your executing the default PHP 5.x PHP install instead of MAMP's PHP 7. What if you run /path/to/MAMP/PHP7/php /path/to/composer.phar create-project...? – Brad Bell Oct 18 '17 at 17:41
  • I was able to get a clean install and ran the setup in the CLI. I can now get to the CP login but nothing happens when I attempt to login. No error. – PhilR Oct 18 '17 at 18:36
  • Started over at the top of the install and all is now working as expected. Thanks for your. help. – PhilR Oct 18 '17 at 19:04
  • Glad you're all sorted... would you mind piecing together an official answer in case it ends up helping someone in the future? – Brad Bell Oct 18 '17 at 19:29
3

In order to install under MAMP with PHP7 we added the MAMP PHP7 path with the following command:

export PATH="/Applications/MAMP/bin/php/php7.0.15/bin:$PATH"

After achieving a successful Craft 3 install we ran the setup in the CLI and we also created a fresh DB and a new MAMP host following the sequence recommended in the installation docs.

  • 1
    Note that you need to swap out php7.0.15 out for the exact version you are using. Just navigate to the directory in finder to double check. – Bonk Oct 22 '17 at 1:00
2

According to this thread you can add

# Use MAMP version of PHP
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH

to .bash_profile.

This grabs your current php Version in MAMP and you can install it without setting --ignore-platform-reqs.

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.