问候所有人
我将我的symfony项目从localhost移到了cpanel。当我打开链接时,它显示config.php的内容 http://example.com/symfony/web/config.php
但是当我试图打开时 http://example.com/symfony/web/app_dev.php/我收到服务器500错误。我试图注释掉if语句,但我仍然收到Server 500错误。
请帮忙!
这是我的app_dev.php文件内容
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
umask(0000);
/*if(isset($_SERVER['HTTP_CLIENT_IP'])
||isset($_SERVER['HTTP_X_FORWARDED_FOR'])
||(in_array(@$_SERVER['REMOTE_ADDR'], ['my_ip_adress','127.0.0.1','fe80::1','::1']) || php_sapi_name() === 'cli-server')
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).'for more information.');
}*/
/**
* @var Composer\Autoload\ClassLoader $loader
*/
$loader = require __DIR__.'/../app/autoload.php';
Debug::enable();
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);