Running PHP source code in Zend Studio 125 under Breakpoint debugging

Source: Internet
Author: User
Tags php cli php source code zend
This article addresses the following issues: Under Zend Studio inside the breakpoint and then debug Run (debug as PHP Web Application), but found that the site is running normally, the breakpoint is not effective at all.

The breakpoint does not take effect, mainly because the debugger is not configured properly.

In fact, Zend Studio has its own Zenddebugger debugger and is already integrated with the built-in PHP CLI environment. But to debug our own installed Web server + PHP program, we have to do additional configuration work.

Modify PHP.ini, add settings such as Zend_extension

At the end of PHP.ini, add the following settings:

zend_extension = "C:\Program Files\Zend\Zend Studio 12.5.1\plugins\com.zend.php.debug.debugger.php56.win32_12.5.0.v20150415-1131\resources\php56\ZendDebugger.dll"zend_debugger.allow_hosts = "127.0.0.1"

The value of Zend_extension, which is the full path file name of the Zend Debugger plug-in, is located in the Zend Studio installation directory and can be found by itself ZendDebugger.dll .
Note that this DLL in the Zend installation directory has two copies, one for PHP 5.6, and the other for PHP5.5, you need to choose the same version of your PHP installation. (Zend Official website is also available Zend debugger download separately.) )

After modifying the php.ini file and the disk, restart PHP (php-cgi, PHP-FPM, or Web server) to ensure that the php.ini is reloaded.

Note: Zenddebugger is the VC11 NTS version (Non Thread Safe) and must be used in conjunction with the NTS version of PHP. That is, the TS version of PHP cannot use Zenddebugger (load failed). See the PHP official website for instructions on TS and NTS versions.

Place dummy.php in the root directory of the WEB server

Create a file within the Ngninx document root HTML dummy.php , as follows:


  
   @ini_set('zend_monitor.enable', 0);if(@function_exists('output_cache_disable')) {    @output_cache_disable();}if(isset($_GET['debugger_connect']) && $_GET['debugger_connect'] == 1) {    if(function_exists('debugger_connect'))  {        debugger_connect();        exit();    } else {        echo "No connector is installed.";    }}

Start debugging

In the Zend Studio Project Management window, right-click index.php, click the Select Menu Debug as PHP Web application and confirm that the debugging process is started. The debugger will break at the first line of PHP code, you can also use the shortcut key Ctrl + Shift + B To set other breakpoints, F8 continue to run, break at the breakpoint at the expected interrupt operation, the above configuration is successful.

Copyright NOTICE: This article for Bo Master Liigo original, without authorization not reproduced.

The above is introduced in Zend Studio 125 in the next breakpoint debugging run PHP source code, including aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • Related Article

    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.