Phpstorm Xampp

broken image


Installing and Configuring XAMPP / MAMP with PhpStorm. MAMP and XAMPP are packages that consist of an Apache HTTP server, MySQL database, PHP interpreter and some. من xampp رو به عنوان سرور وب نصب کردم. همچنین نرم افزار jetbrains phpstorm رو برای ادیت برنامه های php نصب کردم. ولی نمیدونم چطور باید php storm رو به xampp متصل کنم.

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.

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.

I've followed the following guide to set up PhpStorm with XAMPP. Installing and Configuring XAMPP with PhpStorm IDE. However, I got stuck when I reach the following page. At the Web server root URL, when I click open, I did not get the XAMPP page. PhpStorm is a PHP IDE which keeps up with latest PHP & web languages trends, integrates a variety of modern tools, and brings even more extensibility with support for major PHP frameworks.

PhpStorm deployment settings

Let's change Phpstorm deployment settings. Metallica enter sandman gp5.

  1. Open PhpStorm -> File -> Settings or simply press Ctrl+Alt+S. From the left side choose deployment.
  2. 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).
  3. 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).

XAMPP configuration

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 also to your project folder. Or just comment defaults and add a new entry. Save changes.

The project directory is changed. Enjoy!

With xdebug you can set breakpoints in your code, see all defined variable and even change them while running the code.

To start we need to download the latest Xdebug version from http://xdebug.org/download.php. You have to choose the right version for your installed php version. If you're using a newer XAMPP version you should already have this file installed under C:xamppphpextphp_xdebug.dll.

Now that we've installed the Xdebug extension we need to configure it to work with our Php and Phpstorm installation. First let's configure the our Php installation. For this we need to open our php.ini file (C:xamppphpphp.ini)

At the bottom of the file you should see the following commented section for the configuration of Xdebug.

We now need to replace this section with the following code:

Xampp

Now we need a browser extension to enable the debug mode. For this we can use Xdebug helper from the Chrome Web Store. For now just install the extension.

We can now open our PhpStorm project and enable the debugging mode in 'Run', 'Start Listening for PHP Debug Connections'. It's also a good idea to activate 'Break at first line of PHP scripts'. This will stop at every request even if you don't set a breakpoint.

Phpstorm
Xampp xdebug phpstorm

Now we need a browser extension to enable the debug mode. For this we can use Xdebug helper from the Chrome Web Store. For now just install the extension.

We can now open our PhpStorm project and enable the debugging mode in 'Run', 'Start Listening for PHP Debug Connections'. It's also a good idea to activate 'Break at first line of PHP scripts'. This will stop at every request even if you don't set a breakpoint.

Phpstorm And Xampp

Now add a breakpoint in your code which you want to debug. You can do this by clicking on the right of the line number. There should appear a red circle at the line which you clicked.

Now open the local website you want to debug and enable the debugging mode in the right corner of the address bar by clicking on debug in the dropdown.

Phpstorm Xampp Folder

S atom. If you now reload the website you should get a new dialog in your PhpStorm window.

Here we have to select the file in which the request starts. In this case it is the index.php in the api directory.

Xampp With Phpstorm

You can now view all the defined variables in your scope with the global variables like $_SERVER, $_COOKIE, $_GET and more. You can also set additional breakpoints, change the value by double clicking on a variable and go step by step through the request.

Phpstorm Xampp Setup

More information about the configuration is available here:
http://confluence.jetbrains.com/display/PhpStorm/Xdebug+Installation+Guide
https://www.jetbrains.com/phpstorm/quickstart/debugger.html





broken image