This action might not be possible to undo. Are you sure you want to continue?
This tutorial shows you two ways of configuring your PHP development environment on the Windows operating system. The first and most convenient way is to install and configure an AMP (Apache, MySQL, PHP) package. This tutorial shows you how to install the XAMPP package. The second way is to install and configure each component separately. Contents
Using an AMP Package
o o o •
Installing and Configuring the XAMPP Package Checking XAMPP Installation Installing and Enabling the XDebug Debugger
Installing the Components Separately
o o o o o
Apache HTTP Server PHP Engine MySQL Database Server XDebug Setting Up the Environment
To follow this tutorial, you need the following software and resources.
Software or Resource NetBeans IDE A PHP engine A web server
Version Required PHP download bundle Version 5. Included in XAMPP-Windows. Apache HTTP Server 2.2 is recommended. Included in XAMPP Windows. MySQL Server 5.0 is recommended. Included in XAMPP Windows.
A database server
A PHP debugger (optional) XDebug 2.0 or later.
where these problems are fixed. and so on). The current version enables using a local server.0. Installing and Configuring the XAMPP Package The section describes how to download. NetBeans IDE for PHP 6. PHP support can be added to a number of web servers (IIS. but using a debugger is optional. After the installation. Xitami.3 functions. Required Software To create. When the download is completed. You can use a Package. For help with the WAMP package.0.x and PHP 5. Typically development and debugging is performed on a local web server.1 or later. you need to set up the environment that all the software components work properly with each other. The provided documents describe the work with this version. and debug your PHP projects you need the following software: • • The NetBeans IDE for PHP. A web server. but most commonly Apache HTTP Server is used. Use version 1. You can use various database servers while one of the most popular ones is the MySQL server. and the MySQL database server specified automatically. not PHP 5. Note: Starting with XAMPP 1.3.7. Using a remote server with FTP access will be supported in future versions. that contains the required software. fully supports PHP 5. Click here for information on how to install and configure Apache 2. NetBeans IDE for PHP version 6.x does not support the new PHP 5. Warning: Do NOT use XAMPP 1.3. Using an AMP Package To have all the configuration settings for the PHP engine.x. The supported version is PHP5. the Apache HTTP Server. Setting up a remote web server is described in Deploying a PHP Application on a Remote Web Server Using the NetBeans IDE. use an AMP package. while the production environment is located on a remote web server.2. The recommended version is XDebug 2. click here. The PHP debugger. while the production environment is located on a remote web server.2. The NetBeans IDE for PHP allows you to use XDebug. run. install. and configure the XAMPP package. Downloads are available here. Xitami.8. run the . but most commonly Apache HTTP Server is used. Downloads are available here. development and debugging is performed on a local web server.exe file. Download the XAMPP installer package. For information on installing and configuring Apache HTTP server standalone.2. Downloads are available here.Typically. and so on). There are significant problems with XDebug in this version.0 or higher as it is compatible with PHP5.7. A database server. PHP support can be added to a number of local web servers (IIS. (XAMPP Lite does not include XDebug. Note: The recommended version of the product is MySQL Server 5.7. XAMPP comes with PHP 5.) 2.2. • • • The PHP engine. Also note that Xdebug installation differs between PHP 5. Apache HTTP server is included in the XAMPP AMP package used in this tutorial. or install each component separately. This tutorial has you set up a local web server.3. currently available as a development build.7. . please see the NetBeans XDebug Wiki. This tutorial gives instructions only for the XAMPPWindowspackage. 1.
exe file. you will not have to start them manually through the XAMP Control Panel. but it does require you to start the module manually. open the XAMP Control Panel. Warning: The winmysqladmin. Disable UAC while you are installing XAMPP.) When you open the XAMPP Control Panel. See http://bugs. See Microsoft support for more information.xampp. 6. Uninstalling a Windows service does not uninstall the module. note that the modules that are installed as services are already running. after the archive is extracted.exe will not run. 4. (You can open it manually by running the file XAMPP_HOME/xampp-control. You can install or uninstall Windows services by selecting or unselecting the Svc checkbox. the User Access Control feature blocks the PHP installer from updating the Apache httpd configuration. either.php?id=71.org/view.exe instead. You cannot launch winmysqladmin. If you are using the self-extracting archive. Warning: On Windows Vista sometimes xampp-control. You can run xampp- start. 3.) 5. which can only be stopped by manually terminating thewinmysqladmin process. The XAMPP control panel includes buttons for stopping and starting modules and opening their administration consoles. The Svc checkboxes indicate that a module is installed as a Windows service and will start automatically on system startup. run the file setup- xampp. You are given the option to install the Apache server and the MySQL database server as services.exe or from the Xampp Control Panel icon that is automatically placed on your desktop. (The XAMPP installer runs this file automatically. does not work. Note that you have the option to install or uninstall these services in the XAMPP Control Panel. If you install the Apache Server and MySQL as services. After configuration.exe from the command line. which is launched by the Admin button for MySQL.On Microsoft Vista.bat to configure the components of the package. A cascade of error messages appears. .
The XAMPP welcome page opens.Checking XAMPP Installation 1. Run your browser and enter the following URL: http://localhost. among other useful features. restart your operating system. To ensure that the Apache and MySQL servers have been installed as system services. run the browser. and enter the http://localhost URL again. Note that the XAMPP welcome page includes a menu in the left margin through which you can check the status of XAMPP components and run phpinfo(). The XAMPP welcome page opens: 2. phpinfo() returns a screen with configuration information about your XAMPP .
place the . or XAMPP 1. which bundles PHP 5.7.2.dll file in your php extensions directory. Installing and Enabling the XDebug Debugger You need to configure your PHP stack to use XDebug. XDebug on XAMPP 1.2.ini to find and use this file.7.3. and configure php.1 (PHP 5.1. Please see our wiki and the NetBeans PHP Editor Users' Forum for assistance.7. The process differs if you are using XAMPP 1. which bundles PHP 5. .6. Many users have experienced difficulties in getting XDebug to work on their systems.components.2) You must download XDebug.
profiler_enable=1 xdebug. To attach XDebug to the PHP engine.zend_extension_ts = ".ini files (directly beneath the [Zend] section. Note that all Xdebug settings have text explaining them.ini file. . . search for and comment out all properties related to Zend): 4.2 comes bundled with the appropriate Xdebug . Only Zend OR (!) XDebug 12.profiler_output_dir="<XAMPP_HOME>\tmp" Set the xdebug. Confirm which php.zend_optimizer. See our wiki and the XDebug documentation for more information on how to configure XDebug. Copy the .) 2.remote_enable=1 xdebug. Note: Make sure the paths you specify match the location of the corresponding files as determined during your installation. [Zend] 5. Download the latest thread-safe XDebug compatible with your version of PHP.ini file is active by running phpinfo() and searching for Loaded Configuration File.license_path = 10.[XDebug] . .dll" 6. (XAMPP_HOME refers to your XAMPP or XAMPP Lite installation directory.dll file.ini file for your XAMPP.zend_extension_ts = "C:\Program Files\xampp\php\zendOptimizer\lib\ZendExtensionManager.1.zend_extension_manager. In the active php. not "true" or any other value.. 16. 11.remote_host=127.2 (PHP 5.dll file to your XAMP_HOME/php/ext directory. XAMPP and XAMPP Lite 1. Port number must match debugger port number in NetBeans IDE Tools > Options > PHP xdebug.1 xdebug. you need to disable Zend optimizer. Locate and open the active php.remote_enable property to 1.0. xdebug.3) XAMPP 1.remote_handler=dbgp xdebug./php/ext/php_xdebug<-version-number>.ini. locate the following lines and delete them or mark as comments (To be safe. 3.7. This is located by default in the XAMPP_HOME/apache/bin directory.ini to use it.zend_optimizer.dll. add them if not there). You only have to configure php.remote_port=9000 14.7.dll" 13. .. Xdebug on XAMPP 1. . . such as C:\Program Files\xampp or C:\xampplite. Save php.optimizer_ts = "C:\Program Files\xampplite\php\zendOptimizer\lib\Optimizer" 7.0 and later come with a bundled xdebug at <XAMPP_HOME>/php/ext/php_xdebug.enable_loader = 0 8. The download links are listed under Releases. Some additional notes have been added. Run the XAMPP Control Panel Application and restart the Apache server.0. 15.7. without a version number.optimization_level=15 9. Because Zend optimizer blocks XDebug.zend_optimizer. uncomment the following lines in the php.
2. By default the file is located in C:\Program Files\Apache Software Foundation\Apache<version>\conf\ Locate the line Listen 80 and change the port number. 5.ini for editing.remote_port = 9000. Change the value of the setting from localhost to 127. Save the file. for example Skype. Open the Apache web server configuration file httpd. The installation wizard starts. Find and uncomment the line zend_extension = "XAMPP_HOME\php\ext\php_xdebug. Download the Apache2 HTTP server.remote_host=localhost. 3. change the port which the server listens to: 1. To check that the installation is successful. This port can be already used by other services.ini file in XAMPP 1.0.7. 4. do not install the Apache Server to the default location. Installing the Components Separately Apache HTTP Server 1. On Microsoft Vista.0.conf. Follow the instructions. 3. Run the installation file . This is the only php. 8. 2. the Apache server listens to port 80.remote_enable = 0. Save php. 4. Change 0 to 1. Run the XAMPP Control Panel Application and restart the Apache server. 2. 7. Locate and open XAMPP_HOME\php\php.msi. run the browser and enter the following URL: http://localhost/ The Apache welcome test page opens: Troubleshooting By default.ini. Find and uncomment the line xdebug. which is in Program Files. 2. When the installation is completed.dll".1. 6. restart the Apache server. Find and uncomment the line xdebug. All files in Program Files are write-protected. Find and uncomment the line xdebug. To solve the issue. . See our wiki and the XDebug documentation for more information on how to configure XDebug. Find and uncomment the line xdebug. for example 8080.1.remote_handler = "dbgp".
2. 5. 6. After the installation is completed. Restart the Apache web server.php. run the browser and enter the URL and specify the port number explicitly: http://localhost:8080 4. choose the Complete installation option or select the MySQL and MySQLi items in the Extensions list. If you want to use the MySQL database server. the default setting is C:\Program Files\Apache Software Foundation\Apache<version>\conf\. Check that the Apache server configuration file httpd. specify the directory where the httpd. The following page opens: Troubleshooting If the page does not open: 1. When the download is complete. ?> o o Save the file in the htdocs folder: C:\Program Files\Apache Software Foundation\Apache<version>\htdocs\test. To check that the web server works. run the . The installation wizard starts. In the Task Manager. Download the PHP5 engine. restart the Apache server. 3. 2. PHP Engine 1. On the Apache Configuration Directory panel. Restart the Apache server.conf contains the following lines: . create a file and type the following text: o <?php o echo "PHP has been installed successfully!".php Run the browser and enter the following URL: http://localhost:<port>/test. 4. select the relevant file name and click End Process. You can also stop the processes that possibly listen to port 80. The PHP processing will be enabled automatically.3.conf file is located. Find more information on installing and configuring the server here.msi installation file. To check that the PHP engine has been installed successfully and PHP processing has been enabled in the Apache configuration: o In the Notepad.
php page. choose Add or Remove Programs. If the lines are missing. On the Web Server Setup panel. add them. XDebug 1. AddType Application/x-httpd-php .dll" xdebug.conf.remote_enable=1 For any PHP 5. . 2. although other users do not: xdebug.3. choose Change and click Next. You will need the path to it to configure your environment. 3. specify the directory where the Apache configuration file httpd.remote_port=9000 . Install XDebug into the php/ folder.remote_handler=dbgp Click here for more information on how to configure XDebug.x Module.0. To be sure that previously installed PHP engine supports using the MySQL database server: a. choose the version of the Apache server . Note: Make sure the paths you specify match the names and locations of the corresponding files as determined during your installation.2. Click Next. To attach XDebug to the PHP engine.remote_enable=1 For a non-thread-safe PHP 5. PHP processing will be enabled automatically. On the Apache Configuration Directory panel.dll" 4. select the PHP <version number> area and click Change. save httpd. On the Control Panel.php LoadModule php5_module "c:/php/sapi/php5apache2_2. and restart Apache. locate the php.1 xdebug.ini file and add the following lines to it: For a thread-safe PHP 5. On the Add or Remove Programs panel.0.2 engine: zend_extension_nts="<path to the php folder>/php_xdebug-<versionnumber>. 5.dll" xdebug. repair or remove installation panel. c. On the Change. zend_extension_ts="<path to the php folder>/php_xdebug-<versionnumber>. Click Next.in our example it is Apache 2.remote_enable=1 Some users also find that they need to include the following lines. f.remote_host=127. Download XDebug.dll" xdebug.2 engine: 2. d. 1. Setting Up the Environment If your installation follows the default settings. Port number must match debugger port number in NetBeans IDE Tools > Options > PHP xdebug. MySQL Database Server Find detailed information on installing and configuring the MySQL database server. e. The PHP Setup Wizard starts.3 engine: zend_extension="<path to the php folder>/php_xdebug-<version-number>. Click Next.conf is located. b. Refresh the http://localhost:<port>/test. Click Start > Control Panel.
On the Ready to change PHP <version number> panel.g.org/kb/docs/php/configure-php-environmentwindows. expand the Extensions node and choose the MySQL and MySQLi items.html#installPHPEngine . click Change. On the Choose Items to Install panel. Click Next. http://netbeans. On the Completed the PHP <version number> Setup Wizard panel. h. click Finish. i.