当我调用控制器时,输出是:
{success:true}
代替:
{success:true}
我已经尝试grep并找到类似:" <?php"
I got nothing.
我检查了我添加的每一个类确保它们没有打印出来,它们没有。
我发现这一点已经有3个小时了。我在源代码控制中没有提示/
如何进行调试?
如果没有,我是否可以在找到问题并通过某种拦截使其消失之前钩住laravel ?
我找到文件:public/index.php,然后输入:
ob_start();
$response = $kernel->handle(
$request = Illuminate'Http'Request::capture()
);
$output = ob_get_clean();//$output will have the 4 spaces
所以现在问题被隐藏了,但仍然需要修复它,因为$output有4个隐藏的空格。
更新2
整个文件
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Illuminate'Contracts'Http'Kernel::class);
ob_start();
$response = $kernel->handle(
$request = Illuminate'Http'Request::capture()
);
$output = ob_get_clean();//$output will have the 4 spaces
$response->send();
$kernel->terminate($request, $response);
谢谢
请检查您的config/filesystems.php文件,我认为在php打开标签之前有一个制表符(或4个空格)。
必须使用Phpstorm进行全面搜索例如,搜索
'r<?php 'n<?php [space]<?php 't<?php
在我的例子中,我在routes.php中有一个'n