Parse error

Post all bugs here
Post Reply
erosmembers
Posts: 97
Joined: Tue Mar 15, 2016 9:41 pm

Parse error

Post by erosmembers »

Do you know this error message:
Parse error: syntax error, unexpected end of file in /var/www/html/scj/tube/index.php(0) : eval()'d code on line 658

I did an import of my running templates into my test-system.
This templates are containing some PHP code. And now I get the error above.

It seems that the old templates without PHP code are working.

Do you have any hint, why this happens?
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: Parse error

Post by admin »

it's really easy - you have en error in your php code.
Don't forget to run script update
erosmembers
Posts: 97
Joined: Tue Mar 15, 2016 9:41 pm

Re: Parse error

Post by erosmembers »

Is it possible that something will go wrong in case of template SQL export and then import?

The templates are working on a running installation.
The second installation has a problem after import.
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: Parse error

Post by admin »

I don't think so.

Anyway there's no point to guess, reupload templates many times and so.
Just check your code and that's it.
Don't forget to run script update
erosmembers
Posts: 97
Joined: Tue Mar 15, 2016 9:41 pm

Re: Parse error

Post by erosmembers »

I checked my code.

Following code is working on my running site:
<?php if (!isset($_SESSION['user'])) {?>
<li><a data-fkt="2" href='/action/register'>Register FREE account!</a></li>
<? } ?>

This will produce the error on my test system.
So I have to change this code on my test system to:
<? if (!isset($_SESSION['user'])) {?>
<li><a data-fkt="2" href='/action/register'>Register FREE account!</a></li>
<? } ?>
But then this is not executed. It is printed on the page instead without parsing.

Is there any PHP.INI option necessary to parse the php in your templates?
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: Parse error

Post by admin »

I think because of
<? } ?>

and short_tags option
Don't forget to run script update
erosmembers
Posts: 97
Joined: Tue Mar 15, 2016 9:41 pm

Re: Parse error

Post by erosmembers »

What do I have to use instead?

This is working on my running site. Why?
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: Parse error

Post by admin »

Don't forget to run script update
Post Reply