Keeps prompting me to download file...

Support and queries relating to all previous versions of ZoneMinder
Locked
javaman
Posts: 13
Joined: Thu Dec 28, 2006 6:59 pm

Keeps prompting me to download file...

Post by javaman »

I recently did some reconfiguring on my zoneminder box to make it function as a general webserver. I added some domain redirects such that I can keep the same IP address but service multiple domain names with different websites.

That being said, I did alot of playing around to get things working. Now I am in a bind. I am trying to find some general troubleshooting info on my PHP or Apache configuration without having to reinstall.

When I put in my headend URL, instead of going to the mainpage (zoneminders index.php), it prompts me to download file. Any general knowledge of what I may have disabled to cause this behavior?

Here is my URL (www.twinspancam.com)

and when I do download the file, then open it in notepad it has:

Code: Select all

<?
header("Location: $PHP_SELF/zm");
?>
javaman
Posts: 13
Joined: Thu Dec 28, 2006 6:59 pm

Post by javaman »

Getting a new error now:
libphp5.so is garbled - perhaps this is not an Apache module DSO?

Here is the background of how I got to this:

OK, I found what I thought was the cause. I looked in:

Code: Select all

/etc/apache2/mods-available
/etc/apache2/mods-enabled
and found no softlinks for php5. So I created these manually. Now I have:

Code: Select all

lrwxrwxrwx 1 root root   27 Feb 28 11:10 php5.conf -> ../mods-available/php5.conf
lrwxrwxrwx 1 root root   27 Feb 28 13:15 php5.load -> ../mods-available/php5.load
Now when I restart apache2, I get this error (and still the download file thing):

* Forcing reload of web server

Code: Select all

(apache2)...                                                                                  
apache2: Syntax error on line 116 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: API module structure `php5_module' in file /usr/lib/apache2/modules/libphp5.so is garbled - perhaps this is not an Apache module DSO?
I researched google and found nothing to actually solve the problem (except to reinstall or recompile - which I refuse to do for since this was working previously). Here is what some of the troubleshooting revealed:

Code: Select all

/var/lib/php5# ldd /usr/lib/apache2/modules/libphp5.so
        linux-gate.so.1 =>  (0xffffe000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7ad1000)
        libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0xb7a91000)
        libdb-4.3.so => /usr/lib/libdb-4.3.so (0xb79b4000)
        libgdbm.so.3 => /usr/lib/libgdbm.so.3 (0xb79ae000)
        libbz2.so.1.0 => /lib/libbz2.so.1.0 (0xb799d000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb7989000)
        libpcre.so.3 => /usr/lib/libpcre.so.3 (0xb7969000)
        libresolv.so.2 => /lib/libresolv.so.2 (0xb7956000)
        libm.so.6 => /lib/libm.so.6 (0xb792e000)
        libdl.so.2 => /lib/libdl.so.2 (0xb792a000)
        libnsl.so.1 => /lib/libnsl.so.1 (0xb7913000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0xb78f7000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xb787e000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xb785b000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0xb7857000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb7748000)
        libc.so.6 => /lib/libc.so.6 (0xb7605000)
        libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0xb74b9000)
        /lib/ld-linux.so.2 (0x80000000)
        libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0xb74b4000)

Code: Select all

/usr/sbin# ./apache2 -V
Server version: Apache/2.2.3
Server built:   Apr 27 2007 13:08:02
Server's Module Magic Number: 20051115:3
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=""
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"

Code: Select all

/usr/sbin# uname -a
Linux camserver 2.6.15-26-386 #1 PREEMPT Thu Aug 3 02:52:00 UTC 2006 i686 GNU/Linux

Code: Select all

/etc/apache2/mods-available# cat php5.conf
<IfModule mod_php5.c>
  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps
</IfModule>

Code: Select all

/etc/apache2/mods-available# cat php5.load
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so

Code: Select all

/etc/apache2/mods-enabled# ls -la
total 8
drwxr-xr-x 2 root root 4096 Feb 28 13:15 .
drwxr-xr-x 7 root root 4096 Feb 28 11:21 ..
lrwxrwxrwx 1 root root   38 May 23  2007 alias.load -> /etc/apache2/mods-available/alias.load
lrwxrwxrwx 1 root root   33 May 23  2007 auth_basic.load -> ../mods-available/auth_basic.load
lrwxrwxrwx 1 root root   33 May 23  2007 authn_file.load -> ../mods-available/authn_file.load
lrwxrwxrwx 1 root root   36 May 23  2007 authz_default.load -> ../mods-available/authz_default.load
lrwxrwxrwx 1 root root   38 May 23  2007 authz_groupfile.load -> ../mods-available/authz_groupfile.load
lrwxrwxrwx 1 root root   33 May 23  2007 authz_host.load -> ../mods-available/authz_host.load
lrwxrwxrwx 1 root root   33 May 23  2007 authz_user.load -> ../mods-available/authz_user.load
lrwxrwxrwx 1 root root   32 May 23  2007 autoindex.load -> ../mods-available/autoindex.load
lrwxrwxrwx 1 root root   36 Mar 24  2007 cgi.load -> /etc/apache2/mods-available/cgi.load
lrwxrwxrwx 1 root root   26 May 23  2007 dir.conf -> ../mods-available/dir.conf
lrwxrwxrwx 1 root root   26 May 23  2007 dir.load -> ../mods-available/dir.load
lrwxrwxrwx 1 root root   26 May 23  2007 env.load -> ../mods-available/env.load
lrwxrwxrwx 1 root root   35 May 24  2007 jk.conf -> /etc/apache2/mods-available/jk.conf
lrwxrwxrwx 1 root root   35 May 24  2007 jk.load -> /etc/apache2/mods-available/jk.load
lrwxrwxrwx 1 root root   27 May 23  2007 mime.load -> ../mods-available/mime.load
lrwxrwxrwx 1 root root   34 May 23  2007 negotiation.load -> ../mods-available/negotiation.load
lrwxrwxrwx 1 root root   27 Feb 28 11:10 php5.conf -> ../mods-available/php5.conf
lrwxrwxrwx 1 root root   27 Feb 28 13:15 php5.load -> ../mods-available/php5.load
lrwxrwxrwx 1 root root   31 May 23  2007 setenvif.load -> ../mods-available/setenvif.load
lrwxrwxrwx 1 root root   29 May 23  2007 status.load -> ../mods-available/status.load
lrwxrwxrwx 1 root root   40 Mar 24  2007 userdir.conf -> /etc/apache2/mods-available/userdir.conf
lrwxrwxrwx 1 root root   40 Mar 24  2007 userdir.load -> /etc/apache2/mods-available/userdir.load

Code: Select all

/usr/sbin# ldd apache2
 linux-gate.so.1 =>  (0xffffe000)
 libm.so.6 => /lib/libm.so.6 (0xb7f7e000)
 libpcre.so.3 => /usr/lib/libpcre.so.3 (0xb7f5e000)
 libaprutil-1.so.0 => /usr/lib/libaprutil-1.so.0 (0xb7f43000)
 libldap_r.so.2 => /usr/lib/libldap_r.so.2 (0xb7f0e000)
 liblber.so.2 => /usr/lib/liblber.so.2 (0xb7f02000)
 libdb-4.4.so => /usr/lib/libdb-4.4.so (0xb7e07000)
 libpq.so.5 => /usr/lib/libpq.so.5 (0xb7deb000)
 libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0xb7d8c000)
 libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb7d6b000)
 libapr-1.so.0 => /usr/lib/libapr-1.so.0 (0xb7d48000)
 libuuid.so.1 => /lib/libuuid.so.1 (0xb7d45000)
 librt.so.1 => /lib/librt.so.1 (0xb7d3c000)
 libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7d0e000)
 libpthread.so.0 => /lib/libpthread.so.0 (0xb7cf7000)
 libdl.so.2 => /lib/libdl.so.2 (0xb7cf2000)
 libc.so.6 => /lib/libc.so.6 (0xb7baf000)
 /lib/ld-linux.so.2 (0xb7faf000)
 libresolv.so.2 => /lib/libresolv.so.2 (0xb7b9c000)
 libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb7b86000)
 libgnutls.so.13 => /usr/lib/libgnutls.so.13 (0xb7b19000)
 libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0xb7ad8000)
 libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0xb798c000)
 libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xb7913000)
 libcom_err.so.2 => /lib/libcom_err.so.2 (0xb7910000)
 libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0xb7900000)
 libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0xb78fb000)
 libnsl.so.1 => /lib/libnsl.so.1 (0xb78e4000)
 libz.so.1 => /usr/lib/libz.so.1 (0xb78d0000)
 libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 (0xb7884000)
 libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xb7861000)
 libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0xb785b000)
Locked