Phpxdebug compilation and installation and configuration instructions

Source: Internet
Author: User
The compilation, installation, and configuration of phpxdebug indicate that a PHP minor asked me about the Xdebug extension of php today, so I wrote this note again. In fact, this installation configuration is very simple, taking into account the understanding of new users, we can just skip the steps of the graphic design and actual simulation.

First open the linux Terminal and execute the command git clone git: // github.com/xdebug/xdebug.git to download the xdebug extension package. for example: (if you do not have git, install git first)


Run the following command to switch to the xdebug file package directory:
[Happy @ localhost www] $ cd xdebug
Run the phpize command in the xdebug Directory (replace it with the path of the phpize file in your actual PHP Installation Path)
[Happy @ localhost xdebug] $/usr/local/php/bin/phpize (the execution result shows the php version date)

Compile the xdebug extension package
[Happy @ localhost xdebug] $./configure -- with-php-config =/usr/local/php/bin/php-config
[Happy @ localhost xdebug] $ make (if the following information is displayed, make is successful)

Then execute make install to complete the installation.
[Happy @ localhost xdebug] $ make install
The installation is successful and the directory where the php extension is located is displayed.

Now you can see that the xdebug. so extension file has been installed in the PHP extension directory.

Add the PHP. INI file to the XDEBUG extension
[Xdebug]
Zend_extension = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug. so"
Xdebug. remote_enable = true
Xdebug. remote_host = localhost
# The default port 9000
# Xdebug. remote_port = 9000
Xdebug. profiler_enable = on
Xdebug. trace_output_dir = "/var/www/phpxdebug"
Xdebug. profiler_output_dir = "/var/www/phpxdebug"
Xdebug. auto_trace = On
Xdebug. show_exception_trace = On
Xdebug. remote_autostart = On
Xdebug. collect_vars = On
Xdebug. collect_return = On
Xdebug. remote_handler = dbgp
Xdebug. max_nesting_level = 10000
After modifying the php. ini configuration parameters, you can call the phpinfo () function on the PHP page to view the Xdebug extension information and related parameter options on the page. here I set the parameters:

Php xdebug parameters (for more information, seeExtract stars from the skyPrevious logs about xdebug) zend_extension = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug. so "# load the extension file xdebug. remote_enable = truexdebug. remote_host = localhost # xdebug. remote_port = 9000 # default port 9000xdebug. profiler_enable = onxdebug. trace_output_dir = "/var/www/phpxdebug" xdebug. profiler_output_dir = "/var/www/phpxdebug" # Other parameters # enable automatic tracking xdebug. auto_trace = On # enable exception tracking xdebug. show_exception_trace = On # enable remote debugging to automatically start xdebug. remote_autostart = On # collect variable xdebug. collect_vars = On # collect the returned value xdebug. collect_return = On # The application layer communication protocol xdebug for zend studio remote debugging. remote_handler = dbgp # if it is too small, when the number of recursive calls in the function is too many, the system reports an error that exceeds the maximum number of embedded sets. xdebug. max_nesting_level = 10000
Zend_extension = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug. so"
Xdebug loading method, different systems and PHP versions have different writing methods Linux and Mac OS X: zend_extension = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug. so"
Windows Thread-Safe PHP: zend_extension_ts = "D: \ php \ ext \ xdebug. dll "Windows Non-Thread-Safe PHP: zend_extension =" D: \ php \ ext \ xdebug. dll "so only one debugging tool can be loaded on the same server, either Zend Debugger or Xdebug, but tested in the PHP5.5 environment. after PHP of Thread-Safe version, _ ts cannot be added and can only be written as zend_extension = xdebug. remote_enable = true allows remote IDE to debug xdebug. profiler_enable = on and the following directory "/var/www/phpxdebug" is used to enable the function of writing execution analysis files to the specified directory. You can also choose not to write the generated files, such as files named in the format of cachegrind. out.20.8. open the files in the editor to view details about the program running.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.