简体   繁体   中英

Magento bin/magento parse error with Wamp

I'm new to MAgento and I have some trouble executing the magento command.

When I'm using

C:/my-project-root/bin/magento setup:upgrade

I have the following error :

Parse error: syntax error, unexpected 'try' (T_TRY) in C:\my-project-root\bin\magento on line 13

I'm with Wampserver, PHP version 5.6.31, but I run this command from the PHP7.0.23 directory because of Magento requisitie.

I've take a look at the forum to solve it, but there is no way...

When I change my PHP folder in the PATH to PHP7.0.23 the result is the same..

Anyone has an idea ?

Thank a lot

What I personnaly do is actually specify what php executable file I use with its relevant config (ini file).

go to your magento folder

cd C:\my-project-root\www\ ;

use the php 7 executable, with its relevant ini config file.

WARNING , the below example should be adapted with YOUR correct file paths

C:\wamp\bin\php\php-7.0.4-Win32-VC14-x86\php.exe -c "C:\wamp\bin\php\php-7.0.4-Win32-VC14-x86\php.ini" C:\my-project-root\bin\magento setup:upgrade

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM