Jaguar Broke Apache

RHITMacMan

Registered
I just installed Jaguar out of the box. Now Apache is not working properly. Primarily, it will not display PHP pages. I'm sure I'll find more problems as I go along (not checked perl yet). I've tried everything I could think of immediately. Like checking to make sure that the load and add module lines for php4 are uncommented. All my PHP scripts are displayed as plain test, no interpreting!!!
 
No, it is using version 1.3.26. Before anyone asks, yes I did restart apache after modifying the httpd.conf to load php4. I also checked that the libphp4.so exists, and it does. But it's not loading right for some reason.

Here's my stated version:
Server Version: Apache/1.3.26 (Darwin) PHP/4.1.2 mod_ssl/2.8.10 OpenSSL/0.9.6b

Here's the information for php4 from the status module: Module Name: mod_php4.c
Content handlers: application/x-httpd-php , application/x-httpd-php-source , text/html
Configuration Phase Participation: Create Directory Config, Merge Directory Configs, Child Exit
Request Phase Participation: none
Module Directives:
php_value - PHP Value Modifier
php_flag - PHP Flag Modifier
php_admin_value - PHP Value Modifier (Admin)
php_admin_flag - PHP Flag Modifier (Admin)
Current Configuration:
 
Do you get any errors when you do
sudo apachectl restart?

Usually it'll complain if your configuration file is bad.
 
Nope, it does not complain. Here's what I see...

20 [/]% sudo apachectl restart
Password:
/usr/sbin/apachectl restart: httpd restarted
 
I figured it out. My whole httpd.conf file was obliterated during the update to 10.2, so I had to go through and compare the new httpd.conf file to my old one and comment/uncomment lines. Well, in the default httpd.conf file with MacOS X, they removed the lines that you would uncomment for PHP4, so I needed to add them back in. So make sure you add these lines back in if you intend on using PHP4 with MacOS 10.2, in the AddType section. I should have noticed this sooner.

Code:
    # And for PHP 4.x, use:
    #
     AddType application/x-httpd-php .php
     AddType application/x-httpd-php-source .phps
 
Thx, RHITMacMan, I was wacking my head on this same problem. I was loath to do the step-by-step comparison, but you already did. I owe you one.

Man, do I love Macosx.com!

BTW, my 10.2 install also 'purged' the setting that sets the directory setting to php. For those of you who haven't made this change in a while, it's also in the httpd.conf file. Change index.html to index.php (see below).

Code:
# 
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
# 
<IfModule mod_dir.c>
    DirectoryIndex index.php 
</IfModule>
 
I had the same php problem. But, lazy as I am, I looked into the /etc/httpd folder and saw the httpd.conf.applesaved file. I just switched that file back to httpd.conf, saving the new one just in case, and php was working just fine! So far I have not noticed any weird behavior this way.

Andreas
 
ever since upgrading to 10.2, whenever i try to view a php document on my system via IE 5... it opens up a dialogue saying "Unhandled File Type" and asks if i want to save the document or choose an application to use with it... i have no idea how to fix this.. in my httpd.conf file i have:


AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .php

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.htm
</IfModule>


i know im probably not making a whole lot of sense... but if anyone could offer suggestions or help.. it would be greatly appreciated... thanks very much
 
Can someone type out the fix in step-by-step instructions. Like:
1) Open terminal
2) Enter (code goes here)
3) and so on

That'd be cool because i don't know how to do all the stuff you talked about. I hardly ever use the terminal. (for fear of the unknown) :eek:

Twister
 
paleafterglow: did you also uncomment the AddModule line for PHP? And you did restart Apache?

twister: if you mean to restore your pre-10.2 httpd.conf, open the terminal and do the following:

cd /private/etc/httpd
sudo mv httpd.conf httpd.conf.10.2
sudo cp httpd.conf.applesaved httpd.conf
sudo apachectl configtest

if you have no errors, then:

sudo apachectl restart

What you did was rename httpd.conf (the one installed with 10.2) to httpd.conf.10.2 so it's easy to remember which one that was. Then you copied your pre-10.2 httpd.conf that Apple renamed httpd.conf.applesaved to httpd.conf. Now just in case you have both the old and the new ones. Then you tested your old httpd.conf to make sure there are no problems with it with the latest installed version of Apache, then if there were no problems, you restarted it to let your original httpd.conf take effect.

Is this what you were looking for?
 
hazmat... thanks for the reply.. i did get it all straightened out... and kind of a bonus as well.. i have both php 4.2.2 and php 4.1.2 on.. not running at the same time of course... but very easy and simple to switch between them... my web host has 4.1.2 so i can still develop all my stuff on my machine before uploading... and i can also start playing around in the new version of php for fun

anyways... thanks again
 
Back
Top