Configuring PHP Development Environment in Mac OS X
This tutorial shows you how to set up PHP on Mac OS X. For your
convenience, the tutorial has you install the XAMPP AMP (Apache, MySQL, PHP) package, which
includes a web server, a database server, and other utilities for developing
in PHP.
Typically, development and debugging is performed on a local
web server, while the production environment is located on a remote web server.
Setting up a remote web server is described in Deploying a PHP Application on a Remote Web Server Using the NetBeans
IDE. This tutorial has you set up a local web server. PHP support
can be added to
a number of local web servers (IIS, Xitami, and so on), but most commonly Apache HTTP Server is used.
Apache HTTP server is included in the XAMPP AMP package used in this tutorial.
For information on installing and configuring Apache HTTP server standalone,
click here.
Installing and Configuring XAMPP
In this section you install and configure the XAMPP AMP (Apache, MySQL, PHP) package, which includes all the utilities you need to create PHP applications.
After the download is completed, run . dmg file. The Installer panel opens. Click the XAMPP for MacOS X.pkg icon. This starts the Install XAMPP for Mac OS X wizard.
Click Continue on the Introduction page.
In the Select a Destination panel, select Macintosh HD.
In the Easy Install on "Macintosh HD" panel, click Install.
In the Authenticate panel, enter your user name and password, then click OK.
In the Finish Up panel, click Close.
Locate the xampp application and run XAMPP Control Panel. In the Authenticate dialog box, enter your name and password, then click OK.
In the XAMPP Control Panel, click the Start button next to Apache, to start Apache HTTP server.
To start the MySQL database server, click Start next to MYSQL.
To check the active PHP engine version, click PHP version. The PHP version tab opens.
Checking XAMPP Installation
After you install XAMPP, check that all its components are installed and configured correctly.
Run your browser and enter the following URL: http://localhost. The XAMPP for MacOS X welcome page opens:
To check that PHP and MySQL are running, click phpMyAdmin on the left-hand panel menu on the XAMPP welcome page. The phpMyAdmin page opens:
Installing and Enabling the XDebug Debugger
Because XAMPP does not contain the XDebug debugger, you need to install and set up the XDebug as a component.
Download and compile XDebug source files. The download link for source files is listed under Releases.
Install XDebug into the ../xampplite/php/ folder.
Because Zend optimizer blocks XDebug, you need to disable Zend optimizer first. In the ../xampplite/php/php.ini file, locate the relevant lines and remove them or mark as comments.
Find more information about installing and configuring XAMPP Mac OS X here.
To send comments and suggestions, get support, and keep informed on the latest
developments on the NetBeans IDE PHP development features, join
the mailing list.