Laravel 5.2 Artisan Optimize-php_strip_whitespace无法打开流:无子进程 [英] Laravel 5.2 artisan optimize - php_strip_whitespace failed to open stream: No child processes

查看:95
本文介绍了Laravel 5.2 Artisan Optimize-php_strip_whitespace无法打开流:无子进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从5.1升级到Laravel 5.2之后,在CircleCI上运行 artisan Optimiz 并运行PHP 5.6.14时,我得到了

Since upgrading to Laravel 5.2 from 5.1, when running artisan optimize on CircleCI, running PHP 5.6.14, I am getting

[ErrorException]                                                                                 
php_strip_whitespace(/var/laravel/project/root): failed to open stream: No child processes

/var/laravel/project/root 是composer.json和供应商所在的目录.

Where /var/laravel/project/root is the directory where composer.json and vendor reside.

该命令在运行PHP 5.6.11-1ubuntu3.1的开发设备上运行良好.我遵循了官方的5.1到5.2升级指南.

The command runs fine on my dev box running PHP 5.6.11-1ubuntu3.1. I followed the official 5.1 to 5.2 upgrade guide.

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

请问我如何解决此问题的任何想法?

Any ideas on how I can resolve this please?

推荐答案

我在 https://laracasts.com/discuss/channels/laravel/laravel-optimize-error ,其中johnwheal提到config/compile.php是错误的.

I found the answer on https://laracasts.com/discuss/channels/laravel/laravel-optimize-error where johnwheal mentions that config/compile.php is wrong.

事实证明,config/compile.php中的文件数组在2015年4月的一次提交中已清空.,但我看不到升级指南 中提到的更改.此后已将其添加到升级指南.

It turns out that the files array in config/compile.php was emptied in a commit in April 2015 but I can't see the change mentioned in the Upgrade Guide. It has since been added to the Upgrade Guide.

要解决此问题,请执行以下操作:

To fix the problem either:

  • 清空config/compile.php
  • 中的文件数组
  • Empty the files array in config/compile.php

  • config/compile.php中的文件数组中删除BusServiceProvider.phpConfigServiceProvider.php .
  • Remove BusServiceProvider.php and ConfigServiceProvider.php from the files array in config/compile.php .

这篇关于Laravel 5.2 Artisan Optimize-php_strip_whitespace无法打开流:无子进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆