从5.1升级到Laravel 5.2后,在CircleCI上运行artisan优化,运行PHP 5.6.14时,我得到了
[ErrorException] php_strip_whitespace(/var/laravel/project/root): failed to open stream: No child processes
其中/ var/laravel/project/root是composer.json和vendor所在的目录.
该命令在运行PHP 5.6.11-1ubuntu3.1的开发盒上运行正常.我按照官方的5.1到5.2升级指南.
Exception trace: () at /var/laravel/project/root/vendor/classpreloader/classpreloader/src/ClassPreloader.php:124 Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() at n/a:n/a php_strip_whitespace() at /var/laravel/project/root/vendor/classpreloader/classpreloader/src/ClassPreloader.php:124 ClassPreloader\ClassPreloader->getCode() at /var/laravel/project/root/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php:83 Illuminate\Foundation\Console\OptimizeCommand->compileClasses() at /var/laravel/project/root/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php:64 Illuminate\Foundation\Console\OptimizeCommand->fire() at n/a:n/a call_user_func_array() at /var/laravel/project/root/bootstrap/cache/compiled.php:1217 Illuminate\Container\Container->call() at /var/laravel/project/root/vendor/laravel/framework/src/Illuminate/Console/Command.php:169 Illuminate\Console\Command->execute() at /var/laravel/project/root/vendor/symfony/console/Command/Command.php:256 Symfony\Component\Console\Command\Command->run() at /var/laravel/project/root/vendor/laravel/framework/src/Illuminate/Console/Command.php:155 Illuminate\Console\Command->run() at /var/laravel/project/root/vendor/symfony/console/Application.php:787 Symfony\Component\Console\Application->doRunCommand() at /var/laravel/project/root/vendor/symfony/console/Application.php:186 Symfony\Component\Console\Application->doRun() at /var/laravel/project/root/vendor/symfony/console/Application.php:117 Symfony\Component\Console\Application->run() at /var/laravel/project/root/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:107 Illuminate\Foundation\Console\Kernel->handle() at /var/laravel/project/root/artisan:36
有关如何解决这个问题的任何想法吗?
我在https://laracasts.com/discuss/channels/laravel/laravel-optimize-error上找到了答案,其中johnwheal提到这config/compile.php
是错误的.
事实证明,文件数组在config/compile.php
2015年4月的提交中被清空,但我看不到升级指南中提到的更改.它已被添加到升级指南中.
要解决这个问题:
清空文件数组 config/compile.php
要么
从中删除BusServiceProvider.php
和ConfigServiceProvider.php
从文件数组中删除config/compile.php
.