繁体   English   中英

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

[英]How to debug Laravel app in PHPStorm?

我有一个AngularJS + Laravel应用程序,无法设置调试。 在项目根文件夹上,我有一个PHP文件,调试器总是在这个文件中断。 我使用PHPStorm并取消选中“第一线设置”

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配置

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

我在我的本地开发机器上使用php artisan serve

我的Xdebug Conf。

[了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"

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

然后在routes.php的任何地方放置断点。 启动调试并检查url端口,abc .... com ..... / rapor?XDEBUG_SESSION_START = 12360 <=每次更改它。

暂无
暂无

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

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