tags:

views:

60

answers:

3

I am migrating my site from PHP 4 to 5

I keep getting this error on the version 5 server:

Parse error: syntax error, unexpected ';' in /var/www/vhosts/**.php on line 1688

I when I check the code its something like this:

<?=#something here being commented out?>

This worked fine in v4 but now its creating an Error. I really do not understand the error either because there is no ; in the entire line anywhere?

I can just delete the line but I am wondering why this error is happening in the first place and if there is something else I can do besides hunting down every occurrence of that?

Thanks!!

+1  A: 

There is a setting that enables <? to be shorthand for <?php - ensure that is enabled.

JYelton
That's 100% correct. This directive also affects the shorthand `<?=`, which is identical to `<? echo`. Use of this shortcut requires `short_open_tag` to be on.
Mark Tomlin
+6  A: 

This:

<?=#something here being commented out?>

Translates into this:

<?php echo /*something here being commented out*/; ?>

You just have to fix the syntax I presume.

Alix Axel
Changing it to `<?#=something here being commented out?>` should work
Slokun
@Slokun: Indeed, it should.
Alix Axel
A: 

unexpected ';' indicates more that it was not expecting the end of a command. In your code, you have a shorthand open tag. You're basically telling it to echo and not passing it an argument when you do:

<?= //comment ?>

If you shorten this to:

<?php //echo 'something'; ?>

You would be safe.

Jage