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

Forum for questions and support relating to the 1.25.x releases only.
Post Reply
User avatar
eracc
Posts: 84
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA
Contact:

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

Post by eracc » Tue Jan 17, 2012 6:49 pm

Hi All,

Okay, I have been hanging out on #zoneminder at freenode.net 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:
127.0.0.1 - - [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

apache-base-2.2.17-5.6.mga1
apache-conf-2.2.17-2.mga1
apache-doc-2.2.17-1.mga1
apache-mod_perl-2.0.5-1.1.mga1
apache-mod_php-5.3.6-1.mga1
apache-mod_ssl-2.2.17-5.6.mga1
apache-modules-2.2.17-5.6.mga1
apache-mpm-prefork-2.2.17-5.6.mga1
Everything ZM related is owned by the 'httpd' user.group 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.

Help?
Last edited by eracc on Wed Jan 18, 2012 4:43 pm, edited 1 time in total.

User avatar
monex
Posts: 169
Joined: Mon Jan 22, 2007 1:10 pm

Re: New install worked, now gets 500 error

Post by monex » Tue Jan 17, 2012 7:57 pm

Hi,

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
</Directory>
I hope that this will solve your problem
Image

User avatar
eracc
Posts: 84
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA
Contact:

Re: New install worked, now gets 500 error

Post by eracc » Tue Jan 17, 2012 8:15 pm

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.

User avatar
eracc
Posts: 84
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA
Contact:

Re: New install worked, now gets 500 error

Post by eracc » Wed Jan 18, 2012 4:32 pm

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. :)

User avatar
eracc
Posts: 84
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA
Contact:

Re: New install worked, now gets 500 error

Post by eracc » Wed Jan 18, 2012 4:43 pm

Ah ha! The php-mysql module for the distribution was not loaded. I found the answer in this thread on the forum.

User avatar
monex
Posts: 169
Joined: Mon Jan 22, 2007 1:10 pm

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

Post by monex » Thu Jan 19, 2012 7:52 pm

Hi,

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

Have a lot of fun
Monex
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests