Page 1 of 1

[RESOLVED!] New install worked, now gets 500 error

Posted: Tue Jan 17, 2012 6:49 pm
by eracc
Hi All,

Okay, I have been hanging out on #zoneminder at for two days now asking for help and only got one response there. Not even one that was really helpful. Hopefully, some of you here can help me solve this. The directory structure on this build is:

Code: Select all

[root@zmvss Build]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             7.7G  391M  7.0G   6% /
/dev/md0              1.9T   33M  1.9T   1% /data0
/dev/sda10             20G  265M   19G   2% /home
/dev/sda8             4.9G  138M  4.5G   3% /tmp
/dev/sda6             9.7G  2.3G  6.9G  26% /usr
/dev/sda7             9.7G  327M  8.8G   4% /var
/dev/sda9             9.7G  158M  9.0G   2% /var/www
The events and images directories are bind mapped to the big md0 RAID storage in /etc/fstab:

Code: Select all

/data0/zmdata/events /var/www/html/events none defaults,bind  0 2
/data0/zmdata/images /var/www/html/images none defaults,bind  0 2
The scenario: A brand new Mageia 1 (Red Hat / Fedora derivative) Linux setup with all the packages needed to build ZM installed. I had to use CPAN to get the Net::SFTP::Foreign and X10::ActiveHome which are required for this particular ZM build. While in CPAN I upgraded the Perl installation, which was a bad idea I later discovered. Then I built ZM 1.25.0, created the MySQL database, ran 'make install', copied the 'zm' script to /etc/rc.d/init.d/, then started it with 'service zm start'. When I checked with Firefox the main ZM screen came up and all appeared well. I then set it for authenticated use, logged in and all was well. By all was well I mean I could see the main ZM screen and access the config menus.

But, while trying to make some adjustments to the base Linux system using the tools provided by Mageia I found out that the CPAN upgrade had completely hosed some of the Perl based tools provided by Mageia. I dinked around trying to fix this for a couple of days, then decided to wipe '/' and '/usr' and reinstall. This "fixed" the broken Perl tools in Mageia. Of course, I then had to redo my ZM install. I reran ./configure, make and make install and edited the installed zm.conf with the user and pass for the MySQL 'zm' database. This time, ZM is not working. Every time I try to load the 'index.php' for ZM I see this in the Apache access_log: - - [17/Jan/2012:13:17:47 -0500] "GET /index.php HTTP/1.1" 500 - "-" "Mozilla/5.0 (X11; Linux x86_64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
So, I shut down 'zm', deleted the 'zm' database, ran 'make uninstall' in the 'zm' build directory (/home/zoneminder/Build/ZoneMinder-1.25.0), removed the 'zm' build directory, extracted the build directory from the ZoneMinder-1.25.0.tar.gz again and redid the steps to ./configure, make. create the 'zm' database, and make install ZM again. I still get a 500 error every time I try to load the 'index.php' file for ZM.

Nothing shows up in the Apache error_log file. When I load a test.php page with the one line <? phpinfo(); ?> in it, that works. So PHP on Apache does appear to be working okay. Here are the Apache packages that are installed:

Code: Select all

Everything ZM related is owned by the 'httpd' apache.apache except for the actual database files owned by mysql.mysql and the 'zm' script in /etc/rc.d/init.d/ owned by root.root.


Re: New install worked, now gets 500 error

Posted: Tue Jan 17, 2012 7:57 pm
by monex

ZoneMinder has an own apache conf file. Please verify that it located in /etc/apache2/conf.d/ or in an other proper location for your apache installation. You should restart apache2 after the ZoneMinder installation so that this file gets read. The file should have the following contents (replace Directory with the path to your installation)

Code: Select all

<Directory /srv/www/htdocs/zm/>
        php_admin_flag short_open_tag On
        Options FollowSymLinks
I hope that this will solve your problem

Re: New install worked, now gets 500 error

Posted: Tue Jan 17, 2012 8:15 pm
by eracc
That file did not exist in /etc/httpd/conf.d/ when I checked. Creating it and editing for this install to use the correct document root did not help though. The short_open_tag is already on in php.ini. FollowSymLinks was already enabled.

Since this is going to be a stand-alone ZM VSS I am not using a subdirectory for a ZM virtual host. All ZM files for the web host are in /var/www/html/. With the 'index.php' file for ZM in the document root for the server (meaning it is in /var/www/html/).

Thanks for the suggestion anyway. At least it eliminates a possible problem.

Re: New install worked, now gets 500 error

Posted: Wed Jan 18, 2012 4:32 pm
by eracc
New information! I slapped my forehead when I remembered this morning one could enable error logging for PHP in php.ini. I did that for logging to 'syslog' and to display errors in the browser and now can see the error:
Jan 18 11:25:59 zmvss httpd: PHP Fatal error: Call to undefined function mysql_pconnect() in /var/www/html/includes/database.php on line 32
So, now maybe someone can give me a clue as to what is wrong. :)

Re: New install worked, now gets 500 error

Posted: Wed Jan 18, 2012 4:43 pm
by eracc
Ah ha! The php-mysql module for the distribution was not loaded. I found the answer in this thread on the forum.

Re: [RESOLVED!] New install worked, now gets 500 error

Posted: Thu Jan 19, 2012 7:52 pm
by monex

glad to see that you've got it working now :)
Sometimes the final solution is quite simple ;)

Have a lot of fun