enabling PHP on leopard - problems

Joined
Dec 5, 2010
Messages
2
Reaction score
0
Points
1
Your Mac's Specs
Macbook 2.16GHz
Hi,

This might have been discussed before so if anyone knows of the relevant thread please redirect me.

I've been trying to enable php on leopard but so far with limited success. At first I tried uncommenting the line:

LoadModule php5_module libexec/apache2/libphp5.so

in etc/apache2/httpd.conf

but kept getting a 403 error.

Then i tried the instructions on this page (which seems to have worked for some people):

Getting Apache & PHP to work with Leopard (OS X 10.5) - John Ford

But that didn't work either.

After undoing that, I installed the latest php from entropy.ch and instead of getting the 403 error, i got the same code as i see in dreamweaver:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<?
echo "Hello World!";
?>
</body>
</html>

Then I tried installing MAMP, which tells me I'm running PHP 5.2.13 and 5.3.2 and i can switch between the two. I get the same result in both.

The thing that really confuses me is this; when i check in terminal which php i'm using (by inputting php -v), it tells me that i have php 5.2.12

This would indicate to me that apache recognises PHP but either can't work with it properly or doesn't know which one to use.

Any ideas? This is driving me mad. Any help at all would be seriously appreciated. Otherwise i'll go back to using tiger.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
First off, have you restarted Apache? If you make changes to the conf file, you need to restart Apache for the changes to take effect.

If so, you may need to add the following to your httpd.conf file:
Code:
AddType application/x-httpd-php .php
I think you're going to want to add that to the "IfModule mime_module" section.

You might also be able to add the mime type to /private/etc/apache2/mime.types.
 
OP
O
Joined
Dec 5, 2010
Messages
2
Reaction score
0
Points
1
Your Mac's Specs
Macbook 2.16GHz
It worked! :D

Vansmith you are a genius!

Thankyou. Thankyou. Thankyou.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top