Sky Sky - 6 months ago 17
PHP Question

How to configure PHP on Mac for developing

I'm doing the installation for PHP on Mac, following this tutorial .

I checked my

, which is a little different from mine for the following items.

  1. Load Module php5_module

  2. AddModule mod_php5.c AddType

  3. application/x-httpd-php .php

What I have is
Load Module php4_module
, I don't have the item 2 and item 3, so I added these to my
file. But after I restart my apache server with
apachectl restart
, it says that
This webpage is not available
. I checked the console of Chrome and found this
GET http://localhost/info.php net::ERR_CONNECTION_REFUSED

And I also found that:

  • If I didn't add item 2 and item 3 to the configuration file, the PHP
    script just shows on browser, seems it's not parsed.

  • If I just add itme 3, when I accessed
    from my browser,

    it's downloaded instead of being displayed.

Anyone knows what's going on here? Did I miss any more configuration?

By the way, it will be grateful if you can provide a proper tutorial for beginner to set up the envrionment for learning PHP, just found so many articles online, but no one can work correctly.

Sky Sky

Thanks for all your help. I found one useful tool to set up PHP environment quickly. It is XAMPP, which is really easy to set up the environment. Now I can start learning PHP freely. But, of course, I will study the configuration about all of this after I have a basic knowledge of PHP.

Thanks again for all your kindly help, hope will discuss with you later in the details.