cancel
Showing results for 
Search instead for 
Did you mean: 

Re-indexing Issue

Re-indexing Issue

Hello,

I'm running magento 2.1.3 on php 7.0.15, when I run the command

php bin/magento indexer:reindex

I've got the error message :

PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /vendor/magento/framework/App/Bootstrap.php on line 411

I search how to fix it on the forum but didn't find it...  so how can I fix it ?

Thanks for your reply !

4 REPLIES

Re: Re-indexing Issue

Are you sure that your PHP version in CLI is 7.0.x too? Type in command line:

php -v

And let me know what version it is.

If this response was helpful to you, consider giving kudos to this post.
If this response solved your problem, click accept as solution to help others solve this issue

Re: Re-indexing Issue

Hello,

 

Version is php 5.4 ... Smiley Sad

 

PHP 5.4.45-0+deb7u5 (cli) (built: Aug 30 2016 20:15:34) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

but phpinfo.php tell me it's php 7.0, I will contact my host.

 

Thanks for your reply

 

Re: Re-indexing Issue

My host confirm me I'm running php 7.0.15 , so there shouldn't be any issue with php bin/magento indexer:reindex ?, isn't it ?

 

 

 

Tags (1)

Re: Re-indexing Issue

It is a problem. Everything you're hitting via browser (and which have to go through apache/nginx/php stack), it will be executed via your PHP 7.x.

 

But it seems like in your command line (CLI), PHP 5.4.x is configured, and that the issue. Everything you execute through command line will go through PHP 5.4.x, no matter what PHP you have configured on web server.

 

The only thing you can do (if your hosting provider doesn't want to fix it), is to try to find direct path to php7.0 binary, and execute it like:

/usr/bin/php7.0 bin/magento ...
If this response was helpful to you, consider giving kudos to this post.
If this response solved your problem, click accept as solution to help others solve this issue