0

I have a web application I'm moving from a web server to an other.

On the old server I have:

Ubuntu LTS 12 PHP 5.3.28

On the new one Ubuntu LTS 14 PHP 5.5.9

One file produce a syntax error on the new server:

http://pastebin.com/5RMq4SU8 (it's huge, don't want to copy past it here)

php -l /var/www/AndroidReviews/myapp/plugins/tools.php
PHP Parse error:  syntax error, unexpected end of file in /var/www/AndroidReviews/myapp/plugins/tools.php on line 455

On the previous one, every thing works fine

I didn't used php for a few years but php -l just verify the file without processing the includes right ?

Do you have any idea of what cause this problem, and how to fix it ?

Antzi
  • 12,831
  • 7
  • 48
  • 74

1 Answers1

1

Make sure short open tags are on, otherwise change all <?= to <?php echo and <? to <?php which is another reason why you're getting an end of file parse error.

Or, enable them in your php.ini file.

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
  • 1
    `=` is not the problem, in PHP 5.5 these work even with short tags off. But in the code `` is used in line 397 and 399, those won't work without short tags enabled. – Gerald Schneider Sep 03 '14 at 06:56
  • @GeraldSchneider Thank you Gerald, I overlooked those. I've made the appropriate edit. +1 – Funk Forty Niner Sep 03 '14 at 06:57
  • You missed my point. You are implying that `=` will only work with short tags enabled, [which since PHP5.4](http://de1.php.net/manual/en/ini.core.php#ini.short-open-tag) is no longer the case. – Gerald Schneider Sep 03 '14 at 07:00
  • @GeraldSchneider The OP stated that short open tags were not on, as per comment http://stackoverflow.com/questions/25637773/php-l-produce-different-output-for-same-file#comment40057782_25637773 - OP's PHP may not that version. – Funk Forty Niner Sep 03 '14 at 07:00