Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Apache 2 problems

Apache 2 problems
Thread Tools
Dedicated MacNNer
Join Date: Nov 2000
Location: Netherlands
Status: Offline
Reply With Quote
Oct 15, 2004, 07:31 AM
 
I have installed Apache 2 quite a while ago, and it works allright. I would like to use PHP as well, and I understand this is installed by default on 10.3. I added a few lines to the apache config-file to activate PHP, but that doesn't seem to work. I wonder why.

LoadModule php4_module modules/libphp4.so
# Use for PHP 4.x:
AddHandler php-script php
# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps

I added this to the file /library/apache2/conf/httpd.conf. But still the php file is served as text. It is not parsed.

Then I have another problem with Apache. I use a preference pane to restart Apache. When doing a graceful restart, it gets back in a fraction of a second. Then if I repeat this, I get an error.

If I stop the server, it takes quite a long time. If the server is stopped, starting it again results in an error, just like with the second graceful restart.

So I go to the terminal. Open the bin-directory and enter "apachectl start" (or stop). If I start, it says something about using the /private/etc/httpd/user/remote.conf file. Furthermore, if I start apache via the terminal, I get the old version started (1.3).

I suppose I'm doing a lot of things wrong here, but I can't figure out what. Can anyone help a hand?
"Chance is irrelevant. We will succeed."
== 7 of 9 ==
     
Senior User
Join Date: Oct 2000
Location: Midwest
Status: Offline
Reply With Quote
Oct 15, 2004, 08:29 AM
 
I would start by looking at your logs. You can use the tail command in the Terminal
Code:
tail -25 /var/log/httpd/error_log
The -25 integer is arbitrary; it sets the number of lines from the end of the file that will be displayed.

You can also find and view that file in the Console.

Craig
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Oct 15, 2004, 09:24 AM
 
Well... you have a few difficulties you have to deal with:

It sounds like when you installed Apache 2 it got put in a different directory. This is not necessarily a bad thing, but it means that it probably has its own version of apachectl and configuration files. It also needs its own copy of PHP compiled for Apache 2.

Next you have to find where the other copy of apachectl is hiding (probably in the new Apache directory, in a /bin folder) and use that to kick it off... you will probably also want to change the startup item of apache to kik it off rather than the Apple installed one.

Next you will have to find where this new Apache 2 looks for its web folders, as it is probably different that the other... so you will have to either adjust that, or move your content...

In other words you are going to have to get used to a lot more about Apache if you are going to play around like this.
     
ervier  (op)
Dedicated MacNNer
Join Date: Nov 2000
Location: Netherlands
Status: Offline
Reply With Quote
Nov 14, 2004, 11:40 AM
 
It took a while, and it wasn't high on my priority list up til now, but I've fixed it tonight!

I added two lines to the apache config file:

AddType? application/x-httpd-php .php
LoadModule? php5_module modules/libphp5.so

and I copied the libphp5.so file to the modules folder of apache2. That solved everything. It took me a while to figure this out, but I'm glad I found it. Thanks for the tips!
"Chance is irrelevant. We will succeed."
== 7 of 9 ==
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:52 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2