2016-06-10 76 views
2

我遇到了Laravel 5.2應用程序的問題。我試圖將我的存儲庫安裝到Forge,並且一直收到「提供的無效文件名」錯誤,導致安裝無法完成。問題運行php artisan優化

爲了在本地機器上模擬此操作,我將我的.env文件更改爲生產模式並運行php artisan optimize,這是Forge安裝卡住的地方。我得到相同的錯誤,這裏是我的laravel.log文件的輸出。

[2016-06-10 03:14:39] local.ERROR: RuntimeException: Invalid filename provided. in /{{ APP_PATH }}/vendor/classpreloader/classpreloader/src/ClassPreloader.php:114 
Stack trace: 
#0 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php(83): ClassPreloader\ClassPreloader->getCode(false, false) 
#1 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php(64): Illuminate\Foundation\Console\OptimizeCommand->compileClasses() 
#2 [internal function]: Illuminate\Foundation\Console\OptimizeCommand->fire() 
#3 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array) 
#4 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array) 
#5 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php(259): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 
#6 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 
#7 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(844): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 
#8 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Foundation\Console\OptimizeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 
#9 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(123): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 
#10 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 
#11 /{{ APP_PATH }}/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 
#12 {main} 

config/compile.php文件有沒有在filesproviders陣列。我的composer.json的腳本部分更新爲當前版本。這裏是我的整個composer.json文件:

{ 
    "name": "laravel/laravel", 
    "description": "The Laravel Framework.", 
    "keywords": ["framework", "laravel"], 
    "license": "MIT", 
    "type": "project", 
    "require": { 
     "php": ">=5.5.9", 
     "laravel/framework": "5.2.*", 
     "authorizenet/authorizenet": "^1.8", 
     "inacho/php-credit-card-validator": "^1.0", 
     "geoip2/geoip2": "^2.3", 
     "doctrine/dbal": "^2.5", 
     "laravelcollective/html": "^5.1", 
     "pingdevelopment/usps-php-api": "@dev", 
     "barryvdh/laravel-debugbar": "^2.0", 
     "mobiledetect/mobiledetectlib": "^2.8", 
     "phpmd/phpmd": "^2.3", 
     "ext-curl": "*", 
     "jms/serializer": "xsd2php-dev as 0.18.0", 
     "barryvdh/laravel-dompdf": "^0.6.1", 
     "easypost/easypost-php": "^3.0" 
    }, 
    "repositories": [{ 
      "type": "vcs", 
      "url": "https://github.com/goetas/serializer.git" 
     }], 
    "require-dev": { 
     "fzaninotto/faker": "~1.4", 
     "mockery/mockery": "0.9.*", 
     "phpunit/phpunit": "~4.0", 
     "phpspec/phpspec": "~2.1", 
     "goetas/xsd2php": "2.*@dev", 
     "goetas/xsd-reader": "2.*@dev", 
     "symfony/dom-crawler": "~3.0", 
     "symfony/css-selector": "~3.0" 
    }, 
    "autoload": { 
     "classmap": [ 
      "database" 
     ], 
     "psr-4": { 
      "App\\": "app/", 
      "{{ APP NAME }}\\": "app/{{ APP NAME }}" 
     } 
    }, 
    "autoload-dev": { 
     "classmap": [ 
      "tests/TestCase.php" 
     ] 
    }, 
    "scripts": { 
     "post-root-package-install": [ 
      "php -r \"copy('.env.example', '.env');\"" 
     ], 
     "post-create-project-cmd": [ 
      "php artisan key:generate" 
     ], 
     "post-install-cmd": [ 
      "Illuminate\\Foundation\\ComposerScripts::postInstall", 
      "php artisan optimize" 
     ], 
     "post-update-cmd": [ 
      "Illuminate\\Foundation\\ComposerScripts::postUpdate", 
      "php artisan optimize" 
     ] 
    }, 
    "config": { 
     "preferred-install": "dist" 
    } 
} 

我真的失去了這裏。

+0

您是否嘗試過'php artisan optimize --force' –

+0

是的,當我運行'php artisan optimize'和'php artisan optimize --force'時出現錯誤 –

回答

1

我經歷了每一個依賴,我找到了罪魁禍首。原來是"authorizenet/authorizenet": "^1.8"。他們提到"goetas/xsd2php": "2.*@dev",這已被放棄。他們仍在努力修復以整合新的存儲庫,但與此同時,新增了一個熱修復。該依賴關係應替換爲"goetas/xsd2php": "2.0.x-dev#fdc2ab0bb3f2b3ab796ca567cf8c0f3446a7ea3a"