Installing and Configuring XAMPP with PhpStorm IDE. Tweet This tutorial will walk you through choosing and downloading the appropriate edition of XAMPP, downloading and installing the package, starting its components, and integrating them with the PhpStorm IDE. XAMPP is a cross-platform package consisting of an Apache HTTP server, MySQL database, PHP interpreter, and Perl interpreter. Now that you have folders on your PC, let's make it easy to work with them in PHPStorm. PHPStorm has projects. A project is a set of files. For us, a project is a folder. You can see where I put everything (1), in a folder inside XAMPP's web root (D:xampphtdocs). I made folders for each part of the course (2), and inside. Install XAMPP in the default directory C:xampp, or you might encounter permission troubles later on. The first time you start XAMPP you will get language selection screen. After you choose the language you prefer, you will see the main screen of XAMPP. Now you need to start the Apache server. If everything is correct, the Apache label will become green, and you will see the default ports – 80.
First of all to create PHP projects you need to install and configure XAMPP with PhpStorm IDE. The very detailed JetBrains tutorial for this you can find here.
Phpstorm And Xampp
For most people it is not convenient to keep all PHP projects in the default folder C:xampphtdocs. This tutorial will walk you through changing of deployment settings of PhpStorm and XAMPP configuration.
PHP Code Sniffer together with PHPStorm editor is a great and powerful combination as you get all these code checks in real time, as you type your code. There are many great tutorials on how to install PHP Code Sniffer with PHPStorm on Mac, but we did not find any article explaining how to install and configure these tools on Windows.
PhpStorm deployment settings
Let’s change Phpstorm deployment settings.
- Open PhpStorm -> File -> Settings or simply press Ctrl+Alt+S. From the left side choose deployment.
- In the Connection tab choose type of connection -> Local or mounted folder. Then choose folder for the uploading/ downloading of project files. Also choose web server root URL. By default it is http://localhost, but you can choose yours (the same as you have chosen in C:xamppapacheconfhttpd.confconfiguration file).
- In the Mappings tab choose the same local path as you have chosen in the folder for the uploading/ downloading of project files. In the form Web path on server insert “/” (without quotes).
Let’s configure XAMMP. We need to open C:xamppapacheconfhttpd.confconfiguration file. On line 243 change your DocumentRoot to your project folder and on line 244 change the <Directory> also to your project folder. Or just comment defaults and add a new entry. Save changes.
Phpstorm Xampp Debugger
The project directory is changed. Enjoy!