19th November, 2007

Enable PHP on Mac OSX 10.5

Filed under: General — admin @ 1:40 pm

Yes, I’ve got a new job (details will be forthcoming), but in the mean time I’ve got a shiny new Macbook (black, naturally) running Leopard.

As part of setting it up I wanted to run some of my web pages locally and realised that PHP wasn’t enabled out of the box. Luckily it is really easy to set up. Just sign in to a terminal session as a user with admin privileges and;

$ sudo vi /etc/apache2/httpd.conf

and then uncomment line 114, which starts out looking like this;

#LoadModule php5_module       libexec/apache2/libphp5.so

Then restart Apache by de- and then re-selecting ‘Web Sharing’ under the ‘Sharing’ pane of System Preferences. You don’t need to do anything else because the nice people at Apple thoughtfully provide an appropriate configuration file that is included when you enable the PHP module.

6 Comments

  1. Does it have to be vi, or can you use a proper editor? ;-)

    Anyway, PHP, man? What’s got into you?

    Comment by Simon — 19/11/2007 @ 7:02 pm

  2. Does it have to be vi, or can you use a proper editor? ;-)

    Anyway, PHP, man? What’s got into you?

    Comment by Simon — 19/11/2007 @ 7:02 pm

  3. Congrats on the job, BTW.

    Comment by Simon — 19/11/2007 @ 7:22 pm

  4. Congrats on the job, BTW.

    Comment by Simon — 19/11/2007 @ 7:22 pm

  5. We have a partisan approach to editors on this blog, inspired by Henry Ford; you can use anything as long as it is vi. Emacs users are just misguided and will come to realise the error of their ways in their own time.

    As for PHP, if I want a quick and dirty dynamic web page its easier to knock something up in PHP rather than Python. The right tool for the right job and all that. Besides broadening one’s language horizons is quite popular, I believe some of the readers of this blog may even program in Java ;-)

    Comment by Andy Todd — 19/11/2007 @ 7:35 pm

  6. We have a partisan approach to editors on this blog, inspired by Henry Ford; you can use anything as long as it is vi. Emacs users are just misguided and will come to realise the error of their ways in their own time.

    As for PHP, if I want a quick and dirty dynamic web page its easier to knock something up in PHP rather than Python. The right tool for the right job and all that. Besides broadening one’s language horizons is quite popular, I believe some of the readers of this blog may even program in Java ;-)

    Comment by Andy Todd — 19/11/2007 @ 7:35 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress