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

Forum for questions and support relating to the 1.24.x releases only.
Locked
ebassotto
Posts: 1
Joined: Wed Nov 25, 2009 6:08 pm

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

Post 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.........
blacksun
Posts: 2
Joined: Fri Nov 27, 2009 2:46 am

Post by blacksun »

exact same problem! Anyone have any suggestions? Been beating my head on keyboard for 20hrs now!!!!!!
urlgrey
Posts: 2
Joined: Fri Nov 27, 2009 5:07 pm

Post 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.
blacksun
Posts: 2
Joined: Fri Nov 27, 2009 2:46 am

Post 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.....
urlgrey
Posts: 2
Joined: Fri Nov 27, 2009 5:07 pm

Post 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
cgutierrez
Posts: 24
Joined: Fri Aug 14, 2009 6:30 am
Location: Puerto Rico (Various Locations)

Post by cgutierrez »

Thanks! This saved me quite a bit of time... and now I can uppgrade my video server to F12... :D
L0key
Posts: 4
Joined: Sun Nov 29, 2009 3:03 am
Location: The Gathering Place

Post by L0key »

WOOHOO!!!! This fixed it for me on Fedora 12!!

Thank you thank you thank you :D
"Knowledge, without action, is useless. It's not what you learn, it's what you live."

Dr Kyla Dillard
rootstat
Posts: 17
Joined: Sun Dec 27, 2009 11:44 am

Post 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.
jorgus
Posts: 13
Joined: Mon Apr 06, 2009 5:56 pm
Location: Bella Vista - Itapua - PY

Post by jorgus »

thanks :D
works perfect
anupmankar
Posts: 13
Joined: Mon Feb 02, 2009 2:46 pm
Location: Bangalore, India

Post 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.
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Post by bb99 »

It's all here, including the PHP fix, step by step:

http://www.zoneminder.com/forums/viewto ... wers+candy
lookie
Posts: 3
Joined: Fri Aug 08, 2008 11:49 pm

php parse error

Post 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
Locked