PHP is open source scripting language. It\'s widely used to develop web applications.  Home Web Programming PHP Installing PHP on a Mac

Installing PHP on a Mac


image 1

As you might know, you can start the Apache server by switching to the sharing preferences and activating the option "Personal Web Sharing". If you now launch Safari and connect to "http://localhost" you should get Apaches's welcome page telling you that the server has been started successfully. By the way the content of your "sites" folder, located in your user home, can be accessed by appending "yourUsername" to the URL.

image 2

In order to determine whether the PHP module is already enabled or not, navigate to the "sites" folder and create a new PHP file called "phpinfo.php". Open the file and insert the following piece of code:

<?php phpinfo() ?>

image 3

Now if you open the file in your browser, you might notice that the php command is not interpreted by the server. This is because the PHP module is not enabled by default.

PHP4

In order to enable the preinstalled PHP4 module you have to open Apache's configuration file, located under /etc/http/http.conf. Open the file in your favorite editor and uncomment the lines containing "LoadModule php4module" and "AddModule modphp4.c". Save the file and restart your Apache.

If you now reload your phpinfo file you should get a detailed list, contaning information on the configuration of your PHP module. If you don't want to make use of PHP5's object oriented functionalities you can stop reading here and enjoy your new PHP enabled Apache server.

PHP5

But if you are like me and enjoy the new OOP functionality, navigate to Marc Liyanage's Website and download the PHP5 package for Apache 1.3. The size of the package is about 27MB - so it might take a while before the download is finished. Now mount the disk image and run the installer. Afterwards restart your server and once again display the phpinfo file - you will notice that the version 5.04 of PHP has been installed successfully. Enjoy.

Installing PHP on a Mac



Author's URL: Wolfgang Bartelme
PHP is open source scripting language. It\'s widely used to develop web applications. More PHP Tutorials: Featured Materials | Fresh Materials | More PHP Tutorials at LearnPHP.org

Reader's comments
comments credit loans June 12, 2011 says:
Houses and cars are not cheap and not everyone can buy it. But, mortgage loans was created to help people in such kind of hard situations.
Reply
comments LAKISHADouglas35 June 09, 2011 says:
All people deserve wealthy life and <a href=" loans</a> or just sba loan would make it better. Just because freedom bases on money.
Reply
Add comments to "Installing PHP on a Mac"

Captcha