1. 程式人生 > >linux+phpstorm+xdebug配置步驟

linux+phpstorm+xdebug配置步驟

一.根據官方文件指導,做linux+phpstorm+xdebug配置
https://xdebug.org/wizard.php(看官方文件指導,下載對應版本和並執行提供的指令)


Tailored Installation Instructions
This page helps you finding which file to download, and how to configure PHP to get Xdebug running. Please paste the full output of phpinfo() (either a copy & paste of the HTML version, the HTML source or php -i output) and submit the form to receive tailored download and installation instructions. Do not paste the raw HTML (from view-source) into the form.

The information that you upload will not be stored. The script will only use a few regular expressions to analyse the output and provide you with instructions. You can see the code here.
(
定製安裝指令
此頁面幫助您找到要下載的檔案,以及如何配置PHP以使Xdebug執行。請貼上phpinfo()的完整輸出(HTML版本、HTML源或php-i輸出的拷貝和貼上),並提交表單以接收定製的下載和安裝說明。不要將原始HTML(從檢視源)貼上到表單中。

您上傳的資訊將不會被儲存。該指令碼將只使用幾個正則表示式來分析輸出並提供指令。你可以在這裡看到程式碼。
)

點選按鈕'Analyse my phpinfo() output'

得到資訊
Tailored Installation Instructions
Summary
Xdebug installed: no
Server API: Command Line Interface
Windows: no
Zend Server: no
PHP Version: 7.0.21
Zend API nr: 320151012
PHP API nr: 20151012
Debug Build: no
Thread Safe Build: no
Configuration File Path: /usr/local/php/etc
Configuration File: /usr/local/php/etc/php.ini
Extensions directory: /usr/local/php/lib/php/extensions/no-debug-non-zts-20151012


Instructions
1.Download xdebug-2.6.1.tgz
2.Unpack the downloaded file with tar -xvzf xdebug-2.6.1.tgz
3.Run: cd xdebug-2.6.1
4.Run: phpize (See the FAQ if you don't have phpize.

As part of its output it should show:

Configuring for:
...
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.

5.Run: ./configure
6.Run: make
7.Run: cp modules/xdebug.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20151012
8.Edit /usr/local/php/etc/php.ini and add the line
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so

[xdebug]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
xdebug.remote_host = 127.0.0.1
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req


If you like Xdebug, and thinks it saves you time and money, please have a look at the donation page.

二.configure: error: Cannot find php-config. Please use --with-php-config=PATH 
執行./configure遇到的錯誤,錯誤的解決方案
./configure --with-php-config=/usr/local/php/bin/php-config

 

linux phpstorm xdebug1

linux phpstorm xdebug2