Page 1 of 1

Fedora 12 - ZM 1.24.2 - PHP Parse Error in functions.php

Posted: Wed Nov 25, 2009 6:16 pm
by ebassotto
I am trying to install ZM on Fedora 12, but there is the follow error:

PHP Parse error: syntax error, unexpected $end in /usr/share/zoneminder/www/includes/functions.php on line 2309

I aready tried to update the php, httpd, perl....
I also tried to downgrade php to the original of F12 dvd...

But the error persist...

Thank you in advance.........

Posted: Fri Nov 27, 2009 2:48 am
by blacksun
exact same problem! Anyone have any suggestions? Been beating my head on keyboard for 20hrs now!!!!!!

Posted: Fri Nov 27, 2009 5:15 pm
by urlgrey
I know that it's definitely related to the version of PHP included in Fedora 12. Here's the output from validating the functions.php script on a Fedora 12 system with PHP:

[scott@skidder-fc12ppc includes]$ php --version
PHP 5.3.0 (cli) (built: Nov 17 2009 19:22:28)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
[scott@skidder-fc12ppc includes]$ php -l functions.php
PHP Parse error: syntax error, unexpected $end in functions.php on line 2309
Errors parsing functions.php


And here's the output from running the same command on a Fedora 9 machine with release 5.2.9 of PHP (as provided with Fedora 9):

scott@eowyn includes]$ php --version
PHP 5.2.9 (cli) (built: Apr 17 2009 03:42:25)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
[scott@eowyn includes]$ php -l functions.php
No syntax errors detected in functions.php



The functions.php file was the same in both cases. I believe that PHP 5.2.9 will likely work in the meantime. But the long-term solution is to find the cause of the errors with the 5.3.0 release of PHP.

Posted: Fri Nov 27, 2009 9:17 pm
by blacksun
Anyone have any good ideas as to how to downgrade back to php-5.2.9? have tried RPM'n it but to no end.....

Posted: Fri Nov 27, 2009 10:39 pm
by urlgrey
I found the problem, and it's due to the default PHP configuration included with the Fedora Core 12 RPM of PHP. The short_open_tag (<?) tag is disabled by default in the /etc/php.ini file. The functions.php file makes extensive of this tag.

The fix is easy:
1) Edit the file /etc/php.ini: sudo vi /etc/php.ini
2) Change the value for short_open_tag from 'Off' to 'On' on line 229
3) Save the changes
4) Restart Apache HTTPD: sudo /etc/init.d/httpd restart

Posted: Sat Nov 28, 2009 3:26 am
by cgutierrez
Thanks! This saved me quite a bit of time... and now I can uppgrade my video server to F12... :D

Posted: Sun Nov 29, 2009 3:06 am
by L0key
WOOHOO!!!! This fixed it for me on Fedora 12!!

Thank you thank you thank you :D

Posted: Sun Dec 27, 2009 1:05 pm
by rootstat
L0key wrote:WOOHOO!!!! This fixed it for me on Fedora 12!!

Thank you thank you thank you :D
after all setting, i'm still struggling to get ZM working on f12.

Posted: Tue Mar 16, 2010 12:03 pm
by jorgus
thanks :D
works perfect

Posted: Tue Aug 10, 2010 3:37 pm
by anupmankar
Thanks a tonne. I'm using Fedora 13 and this error had me pulling at my hair in frustration. Glad that the fix was easy enough.

Posted: Tue Aug 10, 2010 11:30 pm
by bb99
It's all here, including the PHP fix, step by step:

http://www.zoneminder.com/forums/viewto ... wers+candy

php parse error

Posted: Sun Jan 02, 2011 7:00 pm
by lookie
urlgrey. thanks.

I have been running Zoneminder on 32 bit Centos 5 release and did not encounter any problems with installation/compile. However I am migrating to Fedora 14 64 bit and have had a couple of "headbangers" this being one. None of the problems were 64 bit related, but rather having to do with "newer" compilers, php, etc. This completes my list of problems. The page displays now I just need to transfer the video card from old machine to new.

Again thanks for the effort.

Ron