dqwh1201 2015-06-26 21:19
浏览 195
已采纳

尝试使用Composer安装Laravel 5时出现PHP致命错误

I'm trying to run composer to install Laravel 5.0.14, and am also trying to test this code out in Jenkins using the Jenkins php-template.

Whenever I run composer update, I get the following error:

Error Output: PHP Fatal error: Call to undefined method 
Illuminate\Foundation\Application::redirectIfTrailingSlash() 
  in /var/lib/jenkins/jobs/Demo/workspace/bootstrap/start.php on line 16

If I remove the offending line in start.php, I obtain the following error when attempting to run composer update:

Error Output: PHP Catchable fatal error: 
  Argument 1 passed to Illuminate\Foundation\Application::detectEnvironment() 
   must be an instance of Closure, array diven, called in 
   /var/lib/jenkins/jobs/Demo/workspace/bootstrap/start.php on line 32 
     and defined in 
   /var/lib/jenkins/jobs/Demo/workspace/vendor/laravel/framework/src/Illuminate
   /Foundation/Application.php
 on line 402

This is my composer.json file:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "5.0.14",
        "phpunit/phpunit": "4.7.*@dev",
        "theseer/fxsl": "1.0.*@dev",
        "theseer/phpdox": "0.6.6",
        "squizlabs/php_codesniffer": "1.4.6",
        "phpmd/phpmd": "2.0.0",
        "h4cc/phpqatools": "dev-master",
        "phploc/phploc": "2.0.2",
        "sebastian/phpcpd": "2.0.1",
    "monolog/monolog": "1.13.0",
    "patchwork/utf8": "1.2.1",
        "phpdocumentor/phpdocumentor": "v2.0.1",
        "mayflower/php-codebrowser": "1.1.0-beta1",
        "pear/console_commandline": "dev-trunk",
        "pear/log": "dev-master",
        "pear/pear_exception": "1.0.0",
        "phing/phing": "2.6.1"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "dev"
}

I can run composer update --no-scripts.

I've searched for any composer.php files with sudo find . -print | grep -i 'compiled.php'. The only one I have is

./vendor/symfony/dependency-injection/Tests/Fixtures/php/services9_compiled.php
which does not correspond with the compiled.php file several other people have suggested deleting for other people who have had this problem.
  • 写回答

2条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 “glmnet”运行出错
      • ¥30 如何用matlab表达以下公式?
      • ¥15 在arm架构芯片上基于32位linux操作系统做内存检查
      • ¥15 怎么样才能禁止VS自动调整Windows窗体布局
      • ¥15 mysql5.7.40安装到Initializing database报错,如何解决?
      • ¥30 如何降低hdfs中datanode的JVM内存用量
      • ¥15 Android URL如何转成视频/音频,可行吗?
      • ¥20 Hive SQL数据查询,子查询
      • ¥15 c++字符串分割问题
      • ¥15 vue+uniapp