Page 1 of 1

Parse error: syntax error, unexpected $end

Posted: Fri Feb 27, 2009 11:27 am
by doubleoseverin
Hi there hope you can help me out.

I am running opensuse 11.0 and am installing zoneminder from source.

I have followed the instructions as per the webpage at:

http://www.zoneminder.com/wiki/index.ph ... ZoneMinder

and installed all the rpm packages listed, with the exception of openssl-devel, php5-doc, perl-Data-Manip (although I think this is a spelling mistake and should be perl-DateManip; although I could be wrong!), perl-PIRPC and ligqt4-sql-mysql (although, again I think this is a mispelling and should be libqt4-sql-mysql, which I have installed also)

When I last ran the install (with the command of: ./configure --with-webdir=/srv/www/htdocs --with-cgidir=/srv/www/cgi-bin ZM_SSL_LIB=openssl --with-webuser=wwwrun --with-webgroup=www ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass), the webpages were put in the base directory of apache which is /srv/www/htdocs and /srv/www/cgi-bin, but this last time, I first removed the default index.html, so that may have some bearing. The other times it put it in a subdirectory of 'zm'.

Basically when I point to http://localhost/zm.php it says object not found, as you might expect, as there is no zm.php file (am I doing something fundamentally wrong with the setup?), but there is an index.php which when I try to run comes up with the following error:

Parse error: syntax error, unexpected $end in /srv/www/htdocs/includes/functions.php on line 2296

I have searched the forum and found a similar problem that was (apparently) sorted by switching on the short_open_tag in php.ini, but this does not seem to work and have restarted apache2, just to make sure...

Thanks for all your help beforehand...

Posted: Sat Feb 28, 2009 8:43 am
by nuck
Ya, you've got something wierd going on. zm/includes/functions.php is only 2249 lines long.

Just don't ask me what your problem is. :) Although I suspect the webdir directory you are specifying may be wrong. Try using --with-webdir=/srv/www/htdocs/zm

oops! silly me...

Posted: Sat Feb 28, 2009 4:59 pm
by doubleoseverin
did a second search of open_short_tag and found it after the engine = On. Altered this to On and it worked! Have now got a webcam problem, but i'll put that in a seperate post. Sorry for being so stupid :roll:

Posted: Thu Oct 15, 2009 6:20 pm
by ttkh
I had the same problem and not sure where the issue is. I've disable apache_modsecurity2 and still get the same error

[Thu Oct 15 14:15:59 2009] [error] [client 10.12.96.17] PHP Parse error: syntax error, unexpected $end in /srv/www/htdocs/includes/functions.php on line 2309
[Thu Oct 15 14:15:59 2009] [error] [client 10.12.96.17] PHP Parse error: syntax error, unexpected $end in /srv/www/htdocs/includes/functions.php on line 2309
[Thu Oct 15 14:15:59 2009] [error] [client 10.12.96.17] PHP Parse error: syntax error, unexpected $end in /srv/www/htdocs/includes/functions.php on line 2309


Please help.

Thanks,

Q

use php.ini-dist instead

Posted: Tue Nov 17, 2009 12:03 am
by gregh-cctvsuppliers
I had the same problem. Then I realized for the first time I used php.ini-recommended instead of php.ini-dist

After doing cp php.ini-dist php.ini in the /usr/local/etc directory, It came up no problems.

Posted: Mon Jan 24, 2011 9:08 pm
by braindead0
PHP 5.3 (on my system at least) sets short_open_tag to Off.

Setting that to On fixed that problem, now I've got warnings about strtotime and timezone.

I fixed that by calling:

date_default_timezone_set("America/New_York");

In index.php, obviously you'd need to find the correct setting for your location.

Probably not the best fix, but I'm back in business now.

Re: Parse error: syntax error, unexpected $end

Posted: Wed Mar 16, 2011 11:44 pm
by pcfix_3
I have been looking into this because it's one of the error messages that I get. What I've come up with is the short_open_tag fix (in some forums it says that there are two of them in the php.ini file) and the other one is to edit the code in the php file to have <?php and ?> instead of the short version of <? and ?>. I have not tried this out yet seeing as I am away from my computer at the moment, but I hope this helps. I will add more if this fixes my problem.