رسالة الخطأ: تعتمد خدمة "uri_signer" على معلمة غير موجودة "kernel.secret". هل تقصد هذا: "kernel.charset"؟
تفاصيل index.php هي:
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
use App\Kernel;
require './vendor/autoload.php';
// 开启调试
Debug::enable();
// 实例化请求
$request = Request::createFromGlobals();
// 实例化内核
$kernel = new Kernel('dev', true);
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
تفاصيل التطبيق / Kernel.php هي:
<?php
namespace App;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
class Kernel extends BaseKernel{
public function registerContainerConfiguration(LoaderInterface $loader)
{
// $confDir = $this->getProjectDir() . "/config";
// $loader->load($confDir . "/app.php");
// $this->set
}
public function registerBundles()
{
$contents = [
\Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
];
foreach ($contents as $class => $envs) {
if (isset($envs["all"]) || isset($envs[$this->environment])) {
yield new $class();
}
}
}
protected function configureContainer(ContainerBuilder $container) {
// code invalid
$container->setParameter("kernel.secret", "abck");
}
}
تفاصيل composer.json هي:
{
"require": {
"php": "^7.2.0",
"symfony/http-foundation": "^4.1",
"symfony/http-kernel": "^4.1",
"symfony/config": "^4.1",
"symfony/dependency-injection": "^4.1",
"symfony/framework-bundle": "^4.1"
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
}
}
التشغيل التالي ، اعرض:
استخدمت مكون symonfy واحدًا تلو الآخر للتثبيت ثم التشغيل ، ووجدت أن الموجه لا يمكنه العثور على kernel.secret. لم أجد حلًا لـ Google لفترة طويلة ، والجواب عبر الإنترنت هو حل إطار عمل symfony الحالي. أتمنى أن تخبرني عن كيفية حل هذه المشكلة. شكرا لكم