4

I'm using laravel 5.5 framework.It requirements PHP >= 7.0.0. when I run server I got this error (php artisan serve):

PHP Parse error:  syntax error, unexpected '?' in E:\xampp\htdocs\dibit\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php on line 233

I've installed the last version of xampp and phpstorm.

I think this error show I'm not using php 7.

enter image description here

in my console of my phpstorm when I run this commend:

php -v

it returns PHP 5.6.21.

where is my problem?

the result of this code:

<?php

echo phpversion();

?>

is:

7.2.1



http://localhost/p.php

I have two xampp software but them have been installed an

12
  • Have you checked E:\xampp\htdocs\dibit\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php on line 233? Maybe there is something wrong? Commented Jan 24, 2018 at 7:04
  • helpers.php line 233?? Commented Jan 24, 2018 at 7:05
  • The php executable for the CLI might be still using the old 5.6 version. Most probably the php short-code might not be enabled. pls check the above file Commented Jan 24, 2018 at 7:05
  • error line code: return app('cache')->get($arguments[0], $arguments[1] ?? null); Commented Jan 24, 2018 at 7:06
  • 1
    It looks to me like your command prompt uses an old php version. To make sure that, run "where php" in a command prompt and find out whether it prints the right path. If it's incorrect, check the PATH environment variable and put the content here. Commented Jan 24, 2018 at 7:22

1 Answer 1

3

It looks to me like your command prompt uses an old php version. To confirm that, run

where php

in a command prompt and find out whether it prints the right path (to PHP7). If it's incorrect, check the PATH environment variable and modify it with the correct path to PHP7.

Hope it helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.