Blue and gold Cloud patterns Dawn at the pier Abstract weed Capybara

26th April, 2004

Installing PHP locally

Filed under: Technology, — bsag @ 05:04 PM

Now that I’m doing more PHP-based web development, I decided that it might be time to install PHP properly on my laptop and run Apache locally to test my sites. PHP is great, but there’s great potential for messing things up royally, and in full and embarrassing view of your users.

There’s a series of great tutorials on MacDevCenter starting here, which gives you a good overview of using Apache as a development server. Sitepoint.com has some useful pointers if you want to set up VirtualHosts, so that you can have:

http://test.blog.com/

point to the directory /Users/me/Sites/blog. You can set up as many of these as you like, so that links rooted in your online site still work in the test server.

I got all of that working fine, with a lot of help from the incredibly easy packages available at Server Logistics. They have Apache 2, PHP with all the bells and whistles on and MySQL, all of which can be installed with an easy *.dmg package. There are also useful preference panes for Apache and MySQL, which let you quickly turn the server on and off and edit the config files, which is very convenient. It all went amazingly smoothly. Now I should be able to tinker away to my heart’s content in the privacy of my own machine.

  1. 1

    2004/04/26 21:58 On RSS----- I got half way through reading the post and was going to say ‘You should try Server Logistics…!’. Thankfully I read on before I impulsively posted a comment. Hope your PHP development goes well. I found having a local copy of the PHP docs served from my Apache install a helping hand too.

    by Rob @ 26/04/2004 8:04 pm • Permalink

  2. 2

    Wait long enough to do something, and someone else will figure out the easiest way. grin

    Thanks muchly for the time saved, bsag. I’m a big fan of PHP, but laziness had, until now, kept me from taking the trouble to install it locally. The Server Logistics installs worked really well, and now I can serve this site I’m working on:

    www.morethanyouthought.com

    from my adorable 12″ PowerBook.

    Oh, and about laziness. To navigate various sites locally, rather than setting up virtual hosts, I just bookmark the containing directory and then use the virtual directory structure to move around. Nice to see all of the sites as one kinda-sorta meta-site.

    Thanks again!

    Paul B.

    by Paul B. @ 27/04/2004 4:04 am • Permalink

  3. 3

    Ah, but half the fun of using PHP live is to give you the added incentive to get things right. grin If you can make all the errors in the privacy of your own home/laptop, I suspect the learning curve is rather shallower than when trialling things on a live site. smile

    by Lyle @ 27/04/2004 7:04 am • Permalink

  4. 4

    Rob: The Server Logistics stuff is great. The ‘check syntax’ button for the config file has saved me a lot of headaches already. However, I did speak slightly too soon. WordPress uses mod_rewrite rules to make the nice URIs, and I can’t seem to get this working locally. If anyone has any tips, I would be very grateful.

    Paul B. You’re welcome. Yes, virtual hosts aren’t strictly necessary - I was just trying to be flash!

    Lyle: I think that’s probably true. But for the sake of my nerves, I prefer tinkering in private! It also means that I can work without a network connection.

    by bsag @ 27/04/2004 8:04 am • Permalink

  5. 5

    I’m about to do the very same thing - spooky timing!

    by Gordon @ 27/04/2004 7:04 pm • Permalink

  6. 6

    Gordon: There must be something in the water…

    by bsag @ 28/04/2004 6:05 pm • Permalink

blog comments powered by Disqus

Powered by ExpressionEngine :: © www.rousette.org.uk, 2002-2008 :: [XHTML] [CSS] [508]