2

Okay so I have a confession first off … I've been messing … and I've broken the way that my local machine is behaving.

With that out of the way, here is some basics.

  • I'm running OS X 10.6.7
  • I Removed the default Apache install and replaced it with the lastest version from Apache.
  • I can now serve HTML from /usr/local/apache2/htdocs/ through 'localhost' which is okay.
  • I can't serve any PHP (it just shows up as plain text).

I'm sure that to get a solution I'm going to have to post some config files here but I'm not sure what you'd need; what'll be?

Here is my httpd.conf

4
  • Have you installed PHP or just Apache? If just Apache, you now need to install PHP.
    – Anonymous
    May 23, 2011 at 22:19
  • Not the exact answer to your particular setup but you may want to try MAMP if you just "want to get something up and running" mamp.info/en/index.html
    – Anonymous
    May 23, 2011 at 22:20
  • Hi. This question belongs on another of the sites in the Stack Exchange eco-system due to its contents. Please check the FAQ for more information about what are appropriate question on Stack Overflow, and also take a look at the similar FAQ on the site I am migrating your question to. Thanks. May 24, 2011 at 12:14
  • PHP is installed with OS X isn't it? I've not done an additional install.
    – Shaun
    May 25, 2011 at 13:54

3 Answers 3

5

Did you enable PHP within the Apache configuration file?

Default location:

/private/etc/apache2/httpd.conf

Remove the # before the following line:

LoadModule php5_module        libexec/apache2/libphp5.so

Finally restart Apache.

1
  • There is no LoadModule lines in my httpd.conf - see my httpd.conf
    – Shaun
    May 25, 2011 at 13:44
3

Normally on OS X to enable PHP you have to edit /etc/apache2/httpd.conf and make sure the line that starts with this is uncommented (i.e. doesn't start with "#"):

LoadModule php5_module

This may help you. Or not. Not enough info to say.

1
  • There is no LoadModule lines in my httpd.conf - see my httpd.conf
    – Shaun
    May 25, 2011 at 13:52
0

If PHP has been installed, have you configured Apache correctly to hand .php file to the PHP CGI executable or Apache module? To do that, you'll need an AddHandler or AddType directive somewhere in your Apache configuration.

See steps 7 and 8 on this page (http://www.php.net/manual/en/install.unix.apache2.php) for the specific directives you'll need.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .