UbuntuNetbeansXdebug debugging environment [real environment test]

Source: Internet
Author: User
Text: I have been using the Ubuntu system for a while and gradually become familiar with and like it, so that it is not only the first choice for setting up my development work, but also the first choice for my own entertainment system. Xdebug debugging has been used in Netbeans before, but it is all fragmented and has not been summarized. The following describes how to use the Netbeans and Xdebug environments to debug the PHP environment in Ubuntu. Currently, I have also referred to some other blogs, but the following is all about the code, if you have any questions

Body:

I have been using the Ubuntu system for a period of time and gradually become familiar with and fond of it, so that it is not only the first choice for setting up my development work, but also the first choice for my own entertainment system.

Xdebug debugging has been used in Netbeans before, but it is all fragmented and has not been summarized. The following describes how to use the Netbeans and Xdebug environments to debug the PHP environment in Ubuntu. Currently, I have also referred to some other blogs, but the following is all about the code, if you have any questions, Call Me in the following contact information. This is helpful! It is more important to learn from each other.

1. Open the terminal (Ctrl + Alt + T) and enter sudo apt-get install php5-xdebug (note: the System user is not root)

Ii. sudo pecl install xdebug

3. Search for the php. ini file. My local environment is LNMP.

4. Open the/etc/php5/fpm/php. ini file and add the following code at the bottom.

Zend_extension =/usr/lib/php5/20090626 + lfs/xdebug. so

Xdebug. remote_enable = 1

Xdebug. remote_handler = dbgp

Xdebug. remote_mode = req

Xdebug. remote_host = 127.0.0.1

Xdebug. remote_port = 9000

Port defined by myself, I here mainly php5-fpm occupies 9000, I use 9001

5. Configure Netbeans (Tools-> Options-> Debugging), set the port, and remove and stop at the first line.

Finally, test whether it is successful.

QQ: 249636292 mail: chenghuiyong1987@gmail.com

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.