LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-01-2004, 09:27 PM   #1
ming0
Member
 
Registered: Jul 2003
Location: Boston
Distribution: Ubuntu: Warty & Hoary
Posts: 113

Rep: Reputation: 16
Help w/ a PHP/Apache problem


I am having troubles getting Apache 1.3 and PHP 4 to work on my Debian Woody box.

I edited my httpd.conf, and added the following:
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.cgi index.php
</IfModule>
# And for PHP 4.x, use:
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

When I try to run QDig, a PHP script that will build galleries, I get a 500 Internal Server Error.

When I check /var/log/apache/error.log, I see the following:

[Thu Apr 1 10:48:18 2004] [error] (8)Exec format error: exec of /var/www/public_html/qdig/index.php failed
[Thu Apr 1 10:48:18 2004] [error] [client 192.168.0.103] Premature end of script headers: /var/www/public_html/qdig/index.php


My script permissions are 755, and the qdig website doesn't really have any information at all besides "this is a very easy script to use, just put index.php wherever your photos are", I used their step by step guide that basically walks you through this--with no luck.

When I add the following line to httpd.conf:
LoadModule php4_module libexec/libphp4.so


I try to restart the server, but it complains that it can't find libphp4.so

I can't find any good documents that really explain installing PHP under Apache (with Debian). I have checked the search function here, and googled for it.

Any hints/suggestions, or pointers to good Debian PHP Apache docs? (I used apt-get install php4)
 
Old 04-01-2004, 09:41 PM   #2
irish_rover
Member
 
Registered: Sep 2002
Location: IN, USA
Distribution: Debian, Endian FW
Posts: 368

Rep: Reputation: 30
Check for a modules.conf file under /etc/apache. I can't remember if that was how it was done on Woody, but I know it is on SID (unstable). Also, I'm not sure that is the correct path to libphp4.so. , it may be /usr/lib/apache/1.3/libphp4.so.
 
Old 04-02-2004, 11:09 PM   #3
ming0
Member
 
Registered: Jul 2003
Location: Boston
Distribution: Ubuntu: Warty & Hoary
Posts: 113

Original Poster
Rep: Reputation: 16
I modified the libphp4.so line, and can reset the server then. But I get the following error when I execute the script (in /var/log/apache/error.log)

[Fri Apr 2 15:00:59 2004] [error] (2)No such file or directory: mod_mime_magic: can't read magic file /etc/apache/share/magic
[Fri Apr 2 15:00:59 2004] [alert] apache: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Fri Apr 2 15:00:59 2004] [error] (2)No such file or directory: mod_mime_magic: can't read magic file /etc/apache/share/magic
[Fri Apr 2 15:00:59 2004] [notice] Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2 configured -- resuming normal operations
[Fri Apr 2 15:00:59 2004] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache/suexec)
[Fri Apr 2 15:00:59 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Fri Apr 2 15:01:18 2004] [error] (8)Exec format error: exec of /var/www/public_html/qdig/index.php failed
[Fri Apr 2 15:01:18 2004] [error] [client 192.168.0.103] Premature end of script headers: /var/www/public_html/qdig/index.php


Also, I don't know about the modules.conf file--it isn't in /etc/apache

Thanks for the suggestions (any other info I need to give you?)
 
Old 04-02-2004, 11:55 PM   #4
irish_rover
Member
 
Registered: Sep 2002
Location: IN, USA
Distribution: Debian, Endian FW
Posts: 368

Rep: Reputation: 30
Did you install apache using apt-get and which version of apache (1.3 or 2.?)

Last edited by irish_rover; 04-02-2004 at 11:56 PM.
 
Old 04-03-2004, 02:29 PM   #5
ming0
Member
 
Registered: Jul 2003
Location: Boston
Distribution: Ubuntu: Warty & Hoary
Posts: 113

Original Poster
Rep: Reputation: 16
I think it was installed as just apt-get install apache, but I know that it is 1.3

PHP is definantly 4
 
Old 04-04-2004, 08:30 AM   #6
irish_rover
Member
 
Registered: Sep 2002
Location: IN, USA
Distribution: Debian, Endian FW
Posts: 368

Rep: Reputation: 30
Maybe we would be better off getting a fresh copy at this point. Maybe you could purge it from the system and install it again so we know we are working with a clean install. apt-get remove --purge apache then apt-get install apache
 
Old 04-04-2004, 11:34 PM   #7
ming0
Member
 
Registered: Jul 2003
Location: Boston
Distribution: Ubuntu: Warty & Hoary
Posts: 113

Original Poster
Rep: Reputation: 16
OK, I did the purge and reinstall for both apache and php4. I re-edited the httpd.conf file to add the handlers and stuff. I double checked the folder containing the index.php file, and did the following to the folder:

Code:
chown www-data -R qdig
chmod 755 -R qdig
I am still getting the Premature end of script headers error??

Thanks for the help thus far!
 
Old 04-08-2004, 03:05 AM   #8
ming0
Member
 
Registered: Jul 2003
Location: Boston
Distribution: Ubuntu: Warty & Hoary
Posts: 113

Original Poster
Rep: Reputation: 16
I figured out what the deal was...

I was trying to run php as both a module and as cgi...

Thanks for the advice
 
Old 04-08-2004, 06:48 AM   #9
irish_rover
Member
 
Registered: Sep 2002
Location: IN, USA
Distribution: Debian, Endian FW
Posts: 368

Rep: Reputation: 30
Good deal, glad you found the problem.
 
Old 04-14-2004, 08:03 AM   #10
dpajares
LQ Newbie
 
Registered: Apr 2004
Location: uruguay
Distribution: debian
Posts: 26
Blog Entries: 1

Rep: Reputation: 15
Thumbs up

I have the same problem.
I read the threads and not underestand the solution.
Please help me!!!.

Regards, Damián.
 
Old 04-14-2004, 09:12 AM   #11
dpajares
LQ Newbie
 
Registered: Apr 2004
Location: uruguay
Distribution: debian
Posts: 26
Blog Entries: 1

Rep: Reputation: 15
Talking

Just place the .php file in /var/www/htdocs
It work.

Regards, Damián.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with PHP and Apache problem. Phantisy Linux - Software 7 08-16-2004 07:53 AM
Apache 2 PHP Problem jon1591 Linux - Newbie 1 02-07-2004 01:54 PM
Apache php index.php problem neurotic Linux - Software 3 11-18-2003 06:02 PM
Apache/PHP problem david63 Linux - General 1 05-13-2003 04:41 PM
problem apache/php dbu Linux - Software 0 01-31-2001 08:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration