havietduc91 / experience

0 stars 0 forks source link

Experience XDebug #34

Open havietduc91 opened 8 years ago

havietduc91 commented 8 years ago

Step 1: Download Xdebug

- Download Xdebug at link: [http://xdebug.org/download.php]
Example: download version: [PHP 7.0 VC14 TS (32 bit)] we have file [php_xdebug-2.4.0-7.0-vc14.dll]

- Copy [php_xdebug-2.4.0-7.0-vc14.dll] to [C:\xampp\php\ext]

Step 2: Config php.ini

- Open file php.ini at link: [C:\xampp\php\php.ini]
- Insert bellow config at the end of file
[Xdebug]
zend_extension=php_xdebug-2.4.0-7.0-vc14.dll
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000

Step 3: Restart Apache server

After restart Apache, check installation by command
php --version

740109737-xdebug installation

Step 4: Setting Xdebug in PhpStorm

Restart PhpStorm if it running while setting Xdebug in PHP

1. File | Settings
Under Languages&Frameworks select PHP
In section [Interpreters] select button [...]

![740109737-xdebug installation] 3987695788-xdebug_phpstorm_1

2. Click button [+] select [C:\xampp\php\php.exe]. Click Apply and OK

3850822025-xdebug_phpstorm_2

3526914440-xdebug_phpstorm_3

3. Run | Edit Configurations
Click button [+] select [PHP Web Application]
- Name: NganHangUngVien
- Server: Click button [...]

4176193891-xdebug_phpstorm_4

3829706005-xdebug_phpstorm_6

4. Create server
- Name: Localhost
- Host: localhost
- Port: 80
- Debugger: Xdebug
Click Apply and OK

1936599710-xdebug_phpstorm_5

5. Click Apply and OK to finish
In IDE will display Task [NganHangUngVien]. You can click button Run or Debug

2497318219-xdebug_phpstorm_7