PHP fileinfo is undefined function

一个人想着一个人 提交于 2019-11-26 11:21:14

Have a look at your php.ini file and check that the fileinfo.soor php_fileinfo.dll is activated (depending on your platform and version).

There should be a line similar to

extension=fileinfo.so

in your php.ini file

If you using XAMPP, you enable extension=php_fileinfo.dll in php.ini

What version of PHP do you have? PHP 5.3.0 and later have Fileinfo built in, but on Windows you must enable it manually in your php.ini. You can find further information in the documentation.

If you are using WAMP then Go to PHP extensions and enbale PHP_fileinfo and restart all serverices.

Peter Moses

Windows users: just edit php.ini and uncomment this line:

extension=php_fileinfo.dll

I.e. remove the preceding semicolon from

;extension=php_fileinfo.dll

Remember to restart Apache for new php.ini to take effect.

For those have had it working fine, but then this error appears:

Some hosting providers (e.g., Dreamhost) allow customers to override default PHP settings in a configuration file, often with a path something like:

~/.php/5.4/phprc

That version number in the path can be a problem if you upgrade PHP (or it is upgraded on your behalf). Any custom settings from the prior version, including one enabling the fileinfo extension, will be missing in the newer version. Usually you can just copy the config file to the appropriate new config directory and restart the server.

I had this same issue with PHP.I did the following steps:

 - make sure that the fileinfo extension is already installed if you are using < PHP 5.3.0.

 - Then you have to add in php.ini ;extension=fileinfo.so or
   ;extension=php_fileinfo.dll

 -  If you want to uncomment remove the semicolon(;)
   extension=fileinfo.so or extension=php_fileinfo.dll

Then save and restart your web server.

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