Parse error: syntax error, unexpected end of file

  • Posted May 31, 2014

I get this error when I installed a tracking script:

( ! ) Parse error: syntax error, unexpected end of file in /var/www/ on line 189 Call Stack

Time Memory Function Location

1 0.0001 126152 {main}( ) …/index.php:0 2 0.0001 126572 require_once( ‘/var/www/’ ) …/index.php:21

I tried installing the same script on my shared hosting at hostgator and it installed perfectly.

I am running on Ubuntu 14.04, and LEMP installed with EasyEngine installation script found at

Can anyone help me out with what this error is about and how I can fix it?

Thanks so much.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This error is because you are using <? instead of <?php tag. Correct the php opening tag and it will work!

Ubuntu 14.04 is running PHP 5.5. Perhaps the script isn’t compatible? Are there any listed system requirements for the software? If you need an older version of PHP, you can try Ubuntu 12.04.

Thanks William, <br> <br>But this script is straight from the vendor that came in a zip file. I just unziped in the folder and ran the setup process. <br> <br>I also tried the same script in my shared hosting account with hostgator and it worked pretty well without any kind of errors. <br> <br>Is there anything else you think that could go wrong? <br> <br>Thanks once again <br> <br>Mark <br>

If I remember correctly, unexpected End of File in PHP can be caused by a mis-placed semicolon (;). <br> <br>It’s a pain, but check through the code to make sure that every statement is ended correctly, and that all if and while statements are correctly terminated (make sure there isn’t a stray closing bracket } that doesn’t pair up). <br> <br>Something like PHPLinter may help with this.