[英]Symfony2.3 production page blank 500
在開發mod上進行項目工作后,我發現OVH上的prod有一些問題。 它顯示了一個空白頁! 我嘗試在app.php上關注該問題,發現執行$response = $kernel->handle($request);
問題仍然存在$response = $kernel->handle($request);
並且它不登錄生產。
所以當我更改app.php上的行時: $kernel = new AppKernel('prod', false);
使用$kernel = new AppKernel('dev', false);
它運作良好!
這是我的app.php
<?php
/*
* This file is part of the Sonata package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
umask(0000);
require_once __DIR__ . '/../app/bootstrap.php.cache';
require_once __DIR__ . '/../app/AppKernel.php';
//use Symfony\Component\HttpFoundation\Request;
// if you want to use the SonataPageBundle with multisite
// using different relative paths, you must change the request
// object to use the SiteRequest
use Sonata\PageBundle\Request\SiteRequest as Request;
$request = Request::createFromGlobals();
$kernel = new AppKernel('prod', false);
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
編輯:在開發和生產本地模式下測試它與
php app/console cache:clear --env=prod --no-debug
php app/console assets:install web_directory
php app/console assetic:dump web_directory
我應該在項目中添加或安裝php5嗎?
編輯:我的項目包含:奏鳴曲項目,fosUserBundle等...
編輯
問題出在config_prod.xml上
doctrine:
orm:
entity_managers:
default:
metadata_cache_driver: apc
query_cache_driver: apc
result_cache_driver: apc
現在提示后返回錯誤500! 為什么呢? 因為沒有啟用apc! 所以我的問題是如何在OVH pro上啟用apc!
轉到web / config.php並注釋以下幾行:
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
))) {
header('HTTP/1.0 403 Forbidden');
exit('This script is only accessible from localhost.');
}
這將使config.php可以從“ extern”中調用。 檢查完所有內容后,不要忘記刪除評論。
如果您在生產服務器上具有控制台訪問權限,請輸入項目的根目錄,然后調用php app/check.php
在控制台上運行檢查。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.