.htaccess 启用 php 文件信息扩展

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20795149/
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-25 03:34:09  来源:igfitidea点击:

.htaccess enable php fileinfo extension

phpfile.htaccessfileinfo

提问by Sanganabasu

I've used shared host for hosting my application and the version is php5.3.27. I'm getting an error like

我使用共享主机托管我的应用程序,版本是php5.3.27. 我收到类似的错误

 Call to undefined function finfo_open() 

So I've gone through some articles where I suggested by enabling fileinfo extension in .htaccess. For the first time I'm getting this error. Please help me to get the solution. The work would be more appreciated.

所以我浏览了一些文章,我建议在 .htaccess 中启用 fileinfo 扩展名。我第一次收到这个错误。请帮助我获得解决方案。这项工作将更受欢迎。

回答by Jon Lin

See this answer:

看到这个答案

In your php.ini file, make sure you have something like this in it:

在你的 php.ini 文件中,确保你有这样的东西:

extension=fileinfo.so

or if you're on windows, php_fileinfo.dll.

或者,如果您在 Windows 上,php_fileinfo.dll.

回答by otongbae

It's easy actually to access and modify php.ini file to enable file info. I just know by accident. So you search software/service which is there is select PHP version. Click it, and you will see your PHP Version. Try to change first (downgrade or upgrade, up to you) and then you will see that below there is fileinfo which in default not checklist yet. All you have to is, return the version of your PHP, and then checklist fileinfo, and click save. Thats it.

实际上很容易访问和修改 php.ini 文件以启用文件信息。我只是偶然知道。因此,您搜索有选择 PHP 版本的软件/服务。单击它,您将看到您的 PHP 版本。尝试先更改(降级或升级,由您决定),然后您会看到下面有默认情况下还不是清单的文件信息。您所要做的就是返回您的 PHP 版本,然后检查文件信息,然后单击保存。就是这样。

回答by Sawtaytoes

In your .htaccess, put this line:

在您的 .htaccess 中,放置以下行:

Windows

视窗

php_value extension php_fileinfo.dll

*nix (Linux, Mac, etc)

*nix(Linux、Mac 等)

php_value extension fileinfo.so

回答by Combinu

If you are on shared hosting i continue with the answers above i.e. to include the extensions and is you are on go daddy just create a file in the root directory of your website and name it .user.inithis is how you change settings.

如果您在共享主机上,我继续上面的答案,即包含扩展名,并且您在旅途中,爸爸只需在您网站的根目录中创建一个文件并将其命名,.user.ini这就是您更改设置的方式。