php 解析错误:语法错误,意外的T_STRING,应为T_CONSTANT_ENCAPSED_STRING [关闭]

bzzcjhmw  于 2023-08-02  发布在  PHP
关注(0)|答案(1)|浏览(111)

**已关闭。**此问题为not reproducible or was caused by typos。它目前不接受回答。

此问题是由打印错误或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这一个是解决的方式不太可能帮助未来的读者。
7天前关闭
Improve this question
我想把我的laravel应用程序托管到apache服务器上。我已经完成了配置,但当我加载我的网站时,它显示一个解析错误:语法错误,意外的T_STRING,应为T_CONSTANT_ENCAPSED_STRING或“('。
我已经找过index.php了,但唯一可能导致这个问题的是index.php中声明的使用内核和请求。
这里是我的index.php

<?php

use Illuminate\Contracts\Http\Kernel;
use Illuminate\Http\Request;

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Check If The Application Is Under Maintenance
|--------------------------------------------------------------------------
|
| If the application is in maintenance / demo mode via the "down" command
| we will load this file so that any pre-rendered content can be shown
| instead of starting the framework, which could cause an exception.
|
*/

if (file_exists($maintenance = __DIR__ . '/../storage/framework/maintenance.php')) {
    require $maintenance;
}

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| this application. We just need to utilize it! We'll simply require it
| into the script here so we don't need to manually load our classes.
|
*/

require __DIR__ . '/../vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request using
| the application's HTTP kernel. Then, we will send the response back
| to this client's browser, allowing them to enjoy our application.
|
*/

$app = require_once concat(dirname(__FILE__) , '/../bootstrap/app.php');

$kernel = $app->make(Kernel::class);

$response = $kernel->handle(
    $request = Request::capture()
)->send();

$kernel->terminate($request, $response);

字符串

gmol1639

gmol16391#

据我所知,命名空间支持PHP 5.3或更高版本。
确保你运行的PHP版本高于5.3。
请尝试5.6或更多。

相关问题