服务器环境
系统版本:centos 6.3
PHP版本:php 5.3.3
安装步骤
第一步是使用pecl安装扩展,也需要用到编译功能,所以执行以下三行命令安装一些软件,即使这些软件已经安装在你的系统上。 执行以下命令不会产生错误。
sudo yum install php-devel
sudo yum install php-pear
sudo yum install gcc gcc-c++ autoconf automake
第二步,使用pecl命令安装xdebug
sudo pecl install Xdebug
第三步,开始编辑配置文件,因为在centos 6.3系统下,如果使用yum命令安装,那么php加载模块的配置在/etc/php.d/目录下,所以我们需要 在 php.d 目录下,创建一个 xdebug.ini 并进行配置。
sudo vim /etc/php.d/xdebug.ini #这里的xdebug.ini中的文件名可以随便取,只要后缀是.ini,那么就能正确的载入
第四步,打开文件后,在文件中加入以下代码
extension=xdebug.so #开启扩展
[Xdebug]
xdebug.profiler_enable=On
xdebug.auto_trace=On
xdebug.var_display_max_depth = 10
第五步,保存文件,先按ESC键,然后输入:wq(冒号和wq,w表示写入文件,q表示保存文件),最后按一下回车键。
开启xdebug,并输入xdebug的配置,然后保存文件
第六步,重启apache 服务
sudo service httpd restart
第七步,去phpinfo里看一下xdebug是否安装成功了吧。
(Server environment
System version: CentOS 6.3
PHP version: PHP 5.3.3
Installation steps
The first step is to use PECL to install the extension, which also needs the compilation function, so execute the following three lines of commands to install some software, even if these software have been installed on your system. Executing the following command will not produce an error.
sudo yum install php-devel
sudo yum install php-pear
sudo yum install gcc gcc-c++ autoconf automake
Step 2: use PECL command to install Xdebug
sudo pecl install Xdebug
Step 3: start editing the configuration file, because under CentOS 6.3 system, if you use Yum command to install, the configuration of PHP loading module is in / etc / PHP D / directory, so we need PHP D directory, create an Xdebug Ini and configure it.
sudo vim /etc/php. d/xdebug. Ini # here Xdebug The file name in ini can be taken at will, as long as the suffix is Ini, then it can be loaded correctly
Step 4: after opening the file, add the following code to the file
extension=xdebug. So # enable extension
[Xdebug]
xdebug. profiler_ enable=On
xdebug. auto_ trace=On
xdebug. var_ display_ max_ depth = 10
Step 5: to save the file, first press ESC, then enter: WQ (colon and WQ, w means to write the file, Q means to save the file), and finally press enter.
Open Xdebug, enter the configuration of Xdebug, and then save the file
Step 6: restart the Apache service
sudo service httpd restart
Step 7: go to phpinfo to see if Xdebug has been successfully installed.
)
|