Intervention/Image requires FileInfo

房东的猫 提交于 2019-12-10 16:53:05

问题


Im having trouble with Intervention/image, Laravel #composer install

- intervention/image 2.1.1 requires ext-fileinfo * -> the requested PHP
extension fileinfo is missing from your system.

I understand that it is trying to retrieve the extension fileinfo however I am having 0 luck with getting the extension to load.

I believe that as of PHP 5.4 the extension fileinfo is automatically enabled, however it isnt showing up in #php -m modules.

#pecl install fileinfo doesnt work either because my php version doesnt suit any versions of fileinfo.

My PHP version is:

PHP 5.4.37 (cli)

Operating System:

Linux
CentOS 6.5 cPanel 11.46 / Softaculous x64

Ive tried adding

extension = "fileinfo.so"

to the php.ini however to no luck, it does nothing.

NOTE: I managed to get the extension for windows version of php 5.4 working... Its just when I have uploaded my website to my server, I have been unable to get it to load, well get that library (Intervention/Image) to load.


Other details:

  • Server is a VPS with access to WHM and cPanel
  • Website works. Everything except the Intervention/Image

回答1:


I've bumped to the same issue, and after couple of hours of searching for a solution, I've followed this tutorial: https://www.opensource-excellence.com/blog/item/464-how-to-install-fileinfo-in-whm.html, and it works :)

After rebuilding Apache, fileinfo extension is loaded, and intervention image package successfully installed via composer.




回答2:


go to 'Select PHP version ' under Software section in your cPanel. Then check fileinfo checkbox. Then save. That's it.




回答3:


To fix this issue, you just have to enable your fileinfo from your php configuration.

To do so :

  1. Go to php.ini in your php install folder ( for me since I used bitnami on windows, it is located at C:\Bitnami\wappstack-5.6.31-0\php )

  2. Uncomment the line ;extension=php_fileinfo.dll by removing the semicolon. ( on linux you should have extension=php_fileinfo.so )

  3. Restart php ( use the command line on unix, or on windows through the manager of the soft you use, for instance if you have bitnami it's in C:\Bitnami\wappstack-5.6.31-0 and the exe you have to use is manager-windows.exe then click on php and restart ).

This is it.



来源:https://stackoverflow.com/questions/28507943/intervention-image-requires-fileinfo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!