Aaron
Aaron

Reputation: 4480

production.ERROR: Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)

On my local build everything works. I recently deployed using Digital Ocean nginx. When I try to upload an image I get the following error in my log file.

production.ERROR: Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)

My php version is 7.1.18 and my Laravel Framework is 5.5.40.

I have read several posts about this error and not really sure how to fix this bug. My php version seems correct, not sure where to upgrade it and if I need to upgrade it.

When I got to phpinfo I get the following

enter image description here Any ideas of how to upgrade the server to 7.1?

Upvotes: 1

Views: 5214

Answers (1)

Kenny Horna
Kenny Horna

Reputation: 14271

Check the version of PHP used by nginx. This may be different than the one shown in your command line.

Do the following, create a simple PHP file and put it in your public folder:

hello.php

phpinfo()

Then hit hello.php in your browser.

UPDATE:

If the versions mismatch, check your /etc/nginx/sites-available/default file. There must be something in there.. like the PHP version declared in the fastcgi_pass.

Upvotes: 2

Related Questions