OS X - Development and Darwin Discussion and questions about development for Mac OS X.

enabling PHP on leopard - problems


Post Reply New Thread Subscribe

 
Thread Tools
osbourne.cox

 
Member Since: Dec 05, 2010
Posts: 2
osbourne.cox is on a distinguished road
Mac Specs: Macbook 2.16GHz

osbourne.cox is offline
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.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,295
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog :: M-F IRC Channel - Chats every Sunday at 8PM EST.
QUOTE Thanks
osbourne.cox

 
Member Since: Dec 05, 2010
Posts: 2
osbourne.cox is on a distinguished road
Mac Specs: Macbook 2.16GHz

osbourne.cox is offline
It worked!

Vansmith you are a genius!

Thankyou. Thankyou. Thankyou.
QUOTE Thanks
S.Linus

 
S.Linus's Avatar
 
Member Since: Dec 18, 2010
Posts: 15
S.Linus is on a distinguished road
Mac Specs: MacBook (late '08)

S.Linus is offline
I don't think it can get any easier that MAMP
QUOTE Thanks

Post Reply New Thread Subscribe


« itunes loop | Xcode 3.2.5 Debugger Help »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Apache, php and mysql on leopard skorpyo Web Design and Hosting 1 01-18-2008 03:38 AM
Getting PHP to work on Leopard s.osullivan OS X - Development and Darwin 3 01-07-2008 01:11 PM
Leopard Problems on MacBook Fabian OS X - Operating System 5 10-29-2007 05:02 PM
Enabling PHP JGarcia Web Design and Hosting 3 03-05-2004 09:35 PM

All times are GMT -4. The time now is 12:56 AM.

Powered by vBulletin
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?