php 无法安装 Laravel 包 - 干预图像
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24109991/
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
Cannot Install Laravel Package - Intervention Image
提问by Deveram
So I am following the tutorial on tuts+ Premium from Jeffrey Way - Creating an Ecommerce App in Laravel 4 and I am stuck with this problem. He is installing a package by just editing the composer.json file with this line "intervention/image": "dev-master"
and then just types 'composer update' into his console. I try the same but it won't work.
所以我正在学习 Jeffrey Way 的 tuts+ Premium 教程 - 在 Laravel 4 中创建电子商务应用程序,但我遇到了这个问题。他只是通过用这一行编辑 composer.json 文件来安装一个包"intervention/image": "dev-master"
,然后在他的控制台中输入“composer update”。我尝试同样的但它不会工作。
It displays this error
它显示此错误
" Problem 1 - intervention/image 2.0.2 requires ext-fileinfo * -> the requested PHP exte nsion fileinfo is missing from your system. - intervention/image 2.0.1 requires ext-fileinfo * -> the requested PHP exte nsion fileinfo is missing from your system. - intervention/image 2.0.0 requires ext-fileinfo * -> the requested PHP exte nsion fileinfo is missing from your system. - Installation request for intervention/image 2.* -> satisfiable by interven tion/image[2.0.0, 2.0.1, 2.0.2]."
" 问题 1 - 干预/图像 2.0.2 需要 ext-fileinfo * -> 系统中缺少请求的 PHP 扩展文件信息。 - 干预/图像 2.0.1 需要 ext-fileinfo * -> 请求的 PHP 扩展文件信息是您的系统中缺少。 - 干预/图像 2.0.0 需要 ext-fileinfo * -> 系统中缺少请求的 PHP 扩展文件信息。 - 干预/图像 2.* 的安装请求 -> 干预/图像可满足[ 2.0.0、2.0.1、2.0.2]。”
I have tried following their instructions on http://image.intervention.io/getting_started/installationbut it wouldn't work.
我曾尝试按照他们在http://image.intervention.io/getting_started/installation上的说明进行操作,但它不起作用。
I don't know how to handle this issue. Please help. I also read somewhere that I should edit the php.ini file and uncomment a line for fileinfo but after restarting Apache again it did not work.
我不知道如何处理这个问题。请帮忙。我还在某处读到我应该编辑 php.ini 文件并取消注释 fileinfo 的一行,但是在再次重新启动 Apache 后它不起作用。
I am using Windows 8 with wamp and Laravel.
我正在使用带有 wamp 和 Laravel 的 Windows 8。
Any help would be appreciated greatly.
任何帮助将不胜感激。
回答by The Alpha
Make sure that, you have php_fileinfo.dll
is installed/available in your php\ext
folder and also make sure that, the following line is not commented in php.ini
file:
确保php_fileinfo.dll
您的php\ext
文件夹中已安装/可用,并确保以下行未在php.ini
文件中注释:
extension=php_fileinfo.dll
If it's commented like this:
如果是这样评论的:
;extension=php_fileinfo.dll
Then just remove that ;
from the beginning of the line and then restart the wamp/apache
server.
然后只需;
从行的开头删除它,然后重新启动wamp/apache
服务器。
Update:
更新:
However, some web servers are confusing because they do not use the php.ini located alongside your PHP executable. To find out where your actual php.ini resides, look for its path in phpinfo():
但是,一些 Web 服务器令人困惑,因为它们不使用位于 PHP 可执行文件旁边的 php.ini。要找出实际的 php.ini 所在的位置,请在 phpinfo() 中查找其路径:
After activating an extension, save php.ini, restart the web server and check phpinfo() again. The new extension should now have its own section.
激活扩展后,保存 php.ini,重新启动 Web 服务器并再次检查 phpinfo()。新扩展现在应该有自己的部分。
Also check the Installing a PHP extension on Windows
(Resolving problems) on PHP
manual.
还要检查手册上的Installing a PHP extension on Windows
(解决问题)PHP
。
回答by GTCrais
There are 2 php.ini files:
有 2 个 php.ini 文件:
wamp\bin\php\php5.4.3\php.ini
wamp\bin\apache\Apache2.4.4\bin\php.ini
wamp\bin\php\php5.4.3\php.ini
wamp\bin\apache\Apache2.4.4\bin\php.ini
Make sure the extension is uncommented in both, then restart apache.
确保扩展名在两者中都未注释,然后重新启动 apache。
回答by Andrew
I had this problem. The trouble is that the php.ini file that Apache uses is different than the CLI one. Just search for php.ini in your wamp folder and change it in all of the files...
我有这个问题。问题是 Apache 使用的 php.ini 文件与 CLI 文件不同。只需在 wamp 文件夹中搜索 php.ini 并在所有文件中更改它...
回答by Webinan
Apparently it is because there are separate php.ini
files for web/apache and CLI and as composer uses the CLI and phpinfo() uses the main php.ini
the problem occurs.
显然这是因为php.ini
web/apache 和 CLI有单独的文件,并且 composer 使用 CLI 而 phpinfo() 使用 mainphp.ini
出现问题。
If you run php -m
in CLI and don't see the module's name you should find the CLI php.ini
(in my case php-cli.ini
and add the extension. e.g. extension=php_fileinfo.dll
如果您php -m
在 CLI 中运行并且没有看到模块的名称,您应该找到 CLI php.ini
(在我的情况下php-cli.ini
并添加扩展名。例如extension=php_fileinfo.dll
see: Composer: The requested PHP extension ext-intl * is missing from your system
回答by Deowebsolution
for me I just inserted in the list because i cannot find it
[ extension=php_fileinfo.dll
] after [ExtensionList]
对我来说,我只是插入列表中,因为我找不到它 [ extension=php_fileinfo.dll
][ExtensionList]
[ExtensionList]
**extension=php_fileinfo.dll**<br>
extension=php_mysqli.dll<br>
extension=php_mbstring.dll<br>
extension=php_gd2.dll<br>
extension=php_gettext.dll<br>
extension=php_curl.dll<br>
extension=php_exif.dll<br>
extension=php_xmlrpc.dll<br>
extension=php_openssl.dll<br>
extension=php_soap.dll<br>
extension=php_pdo_mysql.dll<br>
extension=php_pdo_sqlite.dll<br>
extension=php_imap.dll<br>
extension=php_tidy.dll<br>