【问题标题】:Symfony3 console errorsSymfony3 控制台错误
【发布时间】:2017-05-16 19:45:31
【问题描述】:

我使用控制台命令:php bin/console dictionary:database:create Symfony 部署在 VPS 服务器上,Ubuntu 14.04

并返回错误:

php bin/console doctrine:database:create  
PHP Warning:  Uncaught exception 'Symfony\Component\Debug\Exception\ContextErrorException' with message 'Warning: require_once(/var/www/www-root/data/www/likezakaz.ru/../../../apache/htdocs/delivery/app/AppKernel.php): failed to open stream: No such file or directory' in /var/www/www-root/data/www/likezakaz.ru/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:142
    Stack trace:
    #0 /var/www/www-root/data/www/likezakaz.ru/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php(142): Symfony\Component\Debug\DebugClassLoader->loadClass()
    #1 [internal function]: Symfony\Component\Debug\DebugClassLoader->loadClass('AppKernel')
    #2 /var/www/www-root/data/www/likezakaz.ru/bin/console(26): spl_autoload_call('AppKernel')
    #3 {main}
      thrown in /var/www/www-root/data/www/likezakaz.ru/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php on line 142
    PHP Fatal error:  Symfony\Component\Debug\DebugClassLoader::loadClass(): Failed opening required '/var/www/www-root/data/www/likezakaz.ru/../../../apache/htdocs/delivery/app/AppKernel.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/www-root/data/www/likezakaz.ru/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php on line 142

注意,apache/htdocs/delivery 是我的本地服务器中的路径

【问题讨论】:

    标签: symfony console


    【解决方案1】:
    composer install --no-dev --optimaze-autoloader
    

    【讨论】:

    • 您能解释一下您的代码以及为什么它可以解决问题吗? 仅代码答案通常没有那么有用。
    猜你喜欢
    • 1970-01-01
    • 2019-08-05
    • 2016-05-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多