PHP Parse error on Ubuntu but not XAMPP

November 11, 2019 211 views
Apache PHP Ubuntu 18.04

Hey, first time here.

I am getting parse errors on my Digital Ocean Apache server, but not on my local XAMPP server. I checked the PHP versions, and they are both PHP 7. The error states, “Parse error: syntax error, unexpected ’”’, expecting ’-’ or identifier (TSTRING) or variable (TVARIABLE) or number (TNUMSTRING) in /var/www/[mywebsite]/index.php on line 44". I get no errors whatsoever on my local server, even thought the code is the exact same! I checked the other pages on the site, and the ones without PHP code work flawlessly (just a PHP issue). I am at a loss. Any help is appreciated. Thank you!

1 Answer

Hello, @ryanmichaelcurry

Can you paste the content of the index.php file so we can check it for you? You can review the code and make sure that you have ; at the end of each statement as well.

Regards,
Alex

Have another answer? Share your knowledge.