我尝试在nginx prepod服务器上部署我的symfony 2.8应用程序。 Project在本地nginx服务器和其他nginx测试服务器上正常工作。
我跟着:
git clone the project
composer install --optimize-autoloader
cache:clear --env=prod
我在项目中没有使用学说我正在使用api。
我的nginx error.log中出现了几个错误,因为我尝试多次使用composer install和composer update,因为我认为这是供应商安装问题。
这是我得到的不同错误:
不能重新宣布上课 Symfony \ Component \ Config \ Resource \ SelfCheckingResourceChecker in /home/l4mmobile/public_html/v2/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/SelfCheckingResourceChecker.php 在第24行 无法重新声明类symfony \ component \ classloader \ apcclassloader 未找到接口'Symfony \ Component \ EventDispatcher \ EventDispatcherInterface' 在 /home/l4mmobile/public_html/v2/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php 在第29行“ 接口'Symfony \ Component \ Config \ Resource \ ResourceInterface'未找到 /home/l4mmobile/public_html/v2/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/SelfCheckingResourceInterface.php 在线21“ 未找到接口'Symfony \ Component \ Routing \ Matcher \ RequestMatcherInterface' 在/home/l4mmobile/public_html/v2/app/cache/prod/classes.php中 接口'Symfony \ Component \ Routing \ RequestContextAwareInterface'未找到 家用/ l4mmobile /的public_html / V2 /供应商/ symfony中/ symfony中/ src目录/ Symfony的/分量/路由/匹配器/ UrlMatcherInterface.php 在第24行“
app.php
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
$apcLoader = new ApcClassLoader('l4m_site_mobile_v2', $loader);
$loader->unregister();
$apcLoader->register(true);
require_once __DIR__.'/../app/AppKernel.php';
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
composer.json
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-4": {
"": "src/",
"SymfonyStandard\\": "app/SymfonyStandard/"
}
},
"require": {
"php": ">=5.4.4",
"symfony/symfony": "~2.8",
"doctrine/orm": "~2.2,>=2.2.3,<2.5",
"doctrine/dbal": "<2.5",
"doctrine/doctrine-bundle": "~1.4",
"symfony/assetic-bundle": "~2.4",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~4.0",
"sensio/framework-extra-bundle": "~3.0,>=3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"guzzle/guzzle": "3.9.*",
"guzzlehttp/guzzle" : "5.3.1",
"keeguon/oauth2-php": "1.3.6",
"facebook/php-sdk": "3.2.0",
"friendsofsymfony/facebook-bundle": "1.3.0",
"symfony/intl": "^2.8",
"monolog/monolog": "^1.20",
"twig/extensions": "^1.4"
},
"require-dev": {
"sensio/generator-bundle": "~2.3"
},
"scripts": {
"post-root-package-install": [
"SymfonyStandard\\Composer::hookRootPackageInstall"
],
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.8-dev"
}
}
}