一.根据官方文档指导,做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