php 工匠清除编译返回错误代码 255

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42570359/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 02:38:21  来源:igfitidea点击:

artisan clear-compiled return error code 255

phplaravelcomposer-phpartisan

提问by sazr

When runnning composer installon my laravel project I get the error:

当捉迷藏composer install我laravel项目中,我得到的错误:

Script php artisan clear-compiled handling the post-install-cmd event returned with error code 255

脚本 php artisan clear-compiled 处理返回的 post-install-cmd 事件,错误代码为 255

Any advice on what could be the issue? Note composer installs all the vendor packages. The full output is below:

关于可能是什么问题的任何建议?注意 composer 安装所有供应商包。完整输出如下:

[user@some_path]$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> php artisan clear-compiled
Script php artisan clear-compiled handling the post-update-cmd event returned with error code 255

[user@some_path]$ composer update
使用包信息加载 composer 存储库
更新依赖项(包括 require-dev) 无需
安装或更新
生成自动加载文件
> php artisan clear-compiled
Script php artisan clear-compiled 处理 post-update-cmd 事件返回错误代码 255

回答by Zoltán Jére

Makse sure your storage/ & bootstrap/cachedirectory writeable.

确保您的storage/ & bootstrap/cache目录可写。

Make sure your .env file doesent contain any spaces.

确保您的 .env 文件不包含任何空格。

Ex: key=value istead of key=va lue

前任: key=value istead of key=va lue

remove the bootstrap/cache/config.phpfile. then

删除 bootstrap/cache/config.php文件。然后

composer dumpautoload
composer update

Try to remove /bootstrap/compiled.php( if you have it )

尝试删除/bootstrap/compiled.php(如果有)

回答by Serjas

step 1 - Check your php version. If your laravel is old , then it wont support 7.x, you need to switch (checkthis if you are using mac) to PHP 5.6 in this case.

第 1 步 - 检查您的 php 版本。如果您的 laravel 是旧的,那么它将不支持 7.x,在这种情况下,您需要切换(如果您使用的是 mac,请检查此选项)到 PHP 5.6。

Step 2 - remove composer.lock and run composer install

第 2 步 - 删除 composer.lock 并运行 composer install

回答by user3280979

I assume the problem can come from multiple sources. In my case, I had a syntax error in my config/app.php. Reverted to a previous version and the remade my edits.

我认为问题可能来自多个来源。就我而言,我的 config/app.php 中有一个语法错误。恢复到以前的版本并重新进行了我的编辑。

回答by patricus

The only thing that command does is delete the bootstrap/cache/services.phpfile, if it exists. Most likely, the file exists, but the permissions aren't set correctly to allow you to delete it.

该命令唯一能做的就是删除bootstrap/cache/services.php文件(如果存在)。最有可能的是,该文件存在,但权限设置不正确以允许您删除它。

回答by Vishal

i found the solution. Here is list of extensions that causes this problem.

我找到了解决方案。这是导致此问题的扩展列表。

extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
extension=php_pdo_mysql.dll

you have to uncomment all of these extensions from your php.ini

您必须从 php.ini 中取消注释所有这些扩展

E:\wamp64\bin\php\php7.1.9\php.ini

E:\wamp64\bin\php\php7.1.9\php.ini

Note :: Must check your database credential into your .envfile

注意 :: 必须将您的数据库凭据检查到您的.env文件中