All
A new installation of Zoneminder, version 1.24.2, using the Source Code on OpenSUSE 11.2
Have compiled and installed the software and the prerequisites. Created the DB and fired up Apache.
When I browse to the web page for the very first time it is blank and the following errors are generated in the Apache logs.
== /var/log/apache2/error_log ==
-Mon Oct 04 14:34:19 2010- -error- -client xxx.xxx.xxx.xxx- PHP Parse error: syntax error, unexpected $end in /srv/www/htdocs/includes/functions.php on line 2309
== /var/log/apache2/access_log ==
xxx.xxx.xxx.xxx - - -04/Oct/2010:14:34:19 +1300- "GET / HTTP/1.1" 500 - "-" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100506 SUSE/3.5.10-0.1 Firefox/3.5.10"
The Apache start log entry is:
-Mon Oct 04 14:33:52 2010- -notice- Apache/2.2.13 (Linux/SUSE) mod_ssl/2.2.13 OpenSSL/0.9.8k PHP/5.3.3 configured -- resuming normal operations
The line 2309 referred to in the function.php file will in fact cause an EOF error as the file only has 2308 lines according to the less command, when I went to look at the file.
The file has the correct owner and permissions for the webserver to be able to see the file.
I am a perl programmer, and have very little experience with PHP, any thoughts on what is going on here?
Cheers
JP
Syntax error in functions.php - [Solved]
Syntax error in functions.php - [Solved]
Last edited by jp321 on Tue Oct 05, 2010 8:01 am, edited 1 time in total.
Some more information on this
Opening the functions.php file in an editor that understands PHP syntax, it picks up 2 errors. There seems to be missing greater than ">" from the end of lines:
316 and 340
With out these the next line, which contains the /embed end tag, is shown as an error.
However, correcting these 2 still does not fix the issue.
Am I on the right track here?
JP
316 and 340
With out these the next line, which contains the /embed end tag, is shown as an error.
However, correcting these 2 still does not fix the issue.
Am I on the right track here?
JP
Last edited by jp321 on Mon Oct 04, 2010 9:58 am, edited 1 time in total.
Found the Syntax Issues, but still not right
OK after some hacking through the code I discovered the issue with the unexpected $end.
Along with the corrections made in post #2 I discovered that on line 670 there is a missing php in the php tags around the } in the line.
Current line is:
Correct line is:
However, the main index page does not display correctly. It seems if I look at the HTML Source View in the browser that none of the variables are being converted to their values and I get the variable name instead.
PHP is installed and working according to the phpinfo() call from within a test file. So ??
JP
Along with the corrections made in post #2 I discovered that on line 670 there is a missing php in the php tags around the } in the line.
Current line is:
Code: Select all
<option value="<?= $contentValue ?>"<?php if ( $value == $contentValue ) { ?> selected="selected"<? } ?>><?= validHtmlStr($contentText) ?></option>
Code: Select all
<option value="<?= $contentValue ?>"<?php if ( $value == $contentValue ) { ?> selected="selected"<?php } ?>><?= validHtmlStr($contentText) ?></option>
PHP is installed and working according to the phpinfo() call from within a test file. So ??
JP
Solution
It seems that on openSUSE 11.2 the /etc/php5/apache2/php.ini file has the option:
short_open_tag set to Off
Setting this to On (and restarting the Apache server) allowed the variables within the php <?= ?> tags to be displayed correctly.
Note that having this option set to On would have meant I would have not found the syntax error in the original post.
Now onto getting a camera to work...
JP
short_open_tag set to Off
Setting this to On (and restarting the Apache server) allowed the variables within the php <?= ?> tags to be displayed correctly.
Note that having this option set to On would have meant I would have not found the syntax error in the original post.
Now onto getting a camera to work...
JP