is the cli version 7.2 as well? How did you try to create the controller? Via artisan? Were you ssh'd into homestead when running artisan?
PHP Parse error: parse error, expecting `'&'' or `"variable (T_VARIABLE)"' on HOMESTEAD
Hi,
[UPDATE] After updating my mac php version from php 5.5 to 7.2 now it works, but the question below still remains...
I know this subject has been treated many times, but my case seems different, obviously.
I got this error when trying to create a controller.
From what I've read, this issue comes because of the php version used in the application.... ok.
I'm using Homestead as my dev environment, and after phpinfo()..ing on my welcome page, I checked that It runs php 7.2.*.
My mac currently runs php 5.5 and I'm at the moment I'm creating this post, trying to install newer version...
I guess when I will manage updating it, it will get fixed since it used to work before I applied some modifications on the .bash_profile lately because of another issue I had.
What I don't understand though, is that the application clearly says that it runs php 7.2 version in Homestead, so my php version on my mac has normally nothing to do with it.
What's happening then ?? Homestead can't stand by itself ?
Thanks.
That would most likely be why it wasn't working. Artisan uses the CLI version of php, not the web version. So if you were trying to run artisan on your mac, and didn't have 7.2 installed, that's why you got the error.
Just run php -v from the cli to see the version.
It would have worked if you were ssh'd into homestead when running the artisan command, since it would have used the php version on that machine.
I'm using Homestead as my dev environment, and after phpinfo()..ing on my welcome page, I checked that It runs php 7.2.*.
Yes, that shows the web version installed.
Please or to participate in this conversation.