Php debug installation skills

Source: Internet
Author: User
Tags php debug php debugger superuser permission

I plan to configure ZendDebugger for debugging. After the configuration is completed for a long time, the configuration is not successful, and ZendDebugger does not take effect in phpinfo. It is found that it is a php5.3 problem and must be uninstalled first. This article describes how to use xdebug.

The software installation is too simple. Execute the following commands:

Sudo apt-get install apache2
Sudo apt-get install php5
Sudo apt-get install php5-cli
Sudo apt-get install php5-xdebug

Php configuration:

Php. ini contains three folders in/etc/php5/: apache2, cli, and conf. d. We should modify php under apache2 and cli. ini. in conf. d. There is an xdebug. the INI file records the xdebug file path.

Sudo vi/etc/php5/apache2/php. ini

Sudo vi/etc/php5/cli/php. ini
Use the superuser permission to open the above two php. ini, and add the following code:

[Xdebug]
Xdebug. remote_enable = 1
Xdebug_remote_host = "localhost"
Xdebug. remote_port = 9000
Xdebug. remote_handler = "dbgp"
Zend_extension =/usr/lib/php5/20090626 + lfs/xdebug. so

Restart apache: sudo/etc/init. d/apache2 restart

Configure the debugging and running environment of eclipse

Open the eclipse menu-[windows]-> [preferences]

Select php-debug and select xdebug from php debugger in the right window. The character set below is the same as the developed code character set and then applied.

Select "php executables" in the upper-right corner of the window. Name: php5; excute phth:/usr/bin/php5; ini file:/etc/php5/apache2/php. ini; type: cli; debugger: xdebug.

Now everything goes well, you can start the breakpoint debugging program.

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.