简体   繁体   English

如何在PHPStorm中调试Laravel应用程序?

[英]How to debug Laravel app in PHPStorm?

I have a AngularJS + Laravel application and not able to setup debugging. 我有一个AngularJS + Laravel应用程序,无法设置调试。 On project root folder I have a PHP file and the debugger breaks at this file always. 在项目根文件夹上,我有一个PHP文件,调试器总是在这个文件中断。 I use PHPStorm and have unchecked the "First Line Setting" 我使用PHPStorm并取消选中“第一线设置”

server.php server.php

<?php
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$uri = urldecode($uri);
$paths = require __DIR__.'/bootstrap/paths.php';
$requested = $paths['public'].$uri;

// This file allows us to emulate Apache's "mod_rewrite" functionality from the  
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' and file_exists($requested))
{
    return false;
}
require_once $paths['public'].'/index.php';

Xdebug Configuration Xdebug配置

zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=0

I use php artisan serve on my local dev machine. 我在我的本地开发机器上使用php artisan serve

my Xdebug Conf. 我的Xdebug Conf。

[XDebug] [了XDebug]

zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
;xdebug.profiler_append = 0
xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
;xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_port=9001
;xdebug.trace_output_dir = "C:\xampp\tmp"
xdebug.idekey = "PhpStorm"

and debug settings on phpstorm 和phpstorm上的调试设置 在此输入图像描述

then put breakpoints anywhere on routes.php. 然后在routes.php的任何地方放置断点。 start debug and check url port, abc....com...../rapor?XDEBUG_SESSION_START=12360 <= its changes every time. 启动调试并检查url端口,abc .... com ..... / rapor?XDEBUG_SESSION_START = 12360 <=每次更改它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM