【问题标题】:Class 'Image' not found in laravel 4在 laravel 4 中找不到类“图像”
【发布时间】:2015-10-25 16:14:04
【问题描述】:

我在我的系统上下载了一个在 laravel4 上开发的网站,并在我的 localhost 上运行它。某些页面无法正常工作。

当我尝试上传 Image 时。发生以下错误。

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
HELP
Class 'Image' not found

所以我用谷歌搜索并知道我必须在我的 cocomposer.json 文件中添加干预/图像我更改了 json 数组的代码

"require": {
        "laravel/framework": "4.2.*",
        "intervention/image": "1*"
    },

"require": {
        "laravel/framework": "4.2.*",
        "intervention/image": ""2.3.0""
    },

然后我做了composer update,我收到以下错误

有什么线索吗??

C:\Users\User\Desktop\ideconnect>composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for intervention/image 2.3.0 -> satisfiable by interv
ention/image[2.3.0].
    - intervention/image 2.3.0 requires ext-fileinfo * -> the requested PHP exte
nsion fileinfo is missing from your system.

谢谢

【问题讨论】:

    标签: php json laravel-4


    【解决方案1】:

    你得到的错误很清楚:

    您的系统中缺少请求的 PHP 扩展 fileinfo

    这意味着您尝试安装的软件包依赖于您的特定 PHP 安装所没有的 PHP 扩展。这是可以修复的,但可能特定于您的环境。

    首先要做的是检查您的php.ini 并查看扩展是否被简单地注释掉了。如果您使用的是 Windows,它在php.ini 中可能看起来像这样:

    ;extension=php_fileinfo.dll
    

    你应该像这样取消注释:

    extension=php_fileinfo.dll
    

    完成此操作后,您需要重新启动网络服务器。

    如果这不起作用,您需要在 PHP 手册中查找更多信息:http://php.net/manual/en/fileinfo.installation.php

    【讨论】:

    • 我按照您的指示下载了文件干预/图像和 guzzel 仍然成功它说找不到图像我应该做些什么吗?
    • 您能否确认该扩展确实安装正确?运行此命令检查:php -r "var_dump(extension_loaded('fileinfo'));"
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-07
    • 2013-03-20
    • 2021-10-24
    • 2014-09-25
    相关资源
    最近更新 更多