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