启用了fileinfo,但仍然收到错误的WordPress插件要求 [英] Enabled fileinfo but still getting an error WordPress plugin requiement

查看:312
本文介绍了启用了fileinfo,但仍然收到错误的WordPress插件要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我将文件上传到了实时服务器上,并且遇到了如下所示的错误,但是在本地服务器上一切正常.

Recently I uploaded my file on live server and facing this error shown below but everything is working good on my local server.

致命错误:在插件/文档中找不到类'finfo' 第71行的management/view/add_doc.php网站正在运行 技术难点.请检查您的网站管理员电子邮件收件箱以获取 说明.

Fatal error: Class 'finfo' not found in plugins/doc management/view/add_doc.php on line 71 The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

代码

$file = file_get_contents($url);
$filesize = strlen($file);
$file_info = new finfo(FILEINFO_MIME_TYPE);
$mime_type = $file_info->buffer(file_get_contents($file));
if(in_array($extension, $allowedExts)){ 
chmod(ABSPATH.'/wp-content/uploads/2019/07/',0777);
$upload = file_put_contents(ABSPATH.'/wp-content/uploads/2019/07/'.$name,$file);

到目前为止,我为消除该错误所做的尝试.

What I have tried so far to get rid of this error.

尝试通过.htaccess文件启用了fileinfo,但这样做后无法获取500个内部服务器错误页面.我试图将它们添加到.htaccess文件的末尾

tried to enabled fileinfo via .htaccess file but getting 500 internal server error page is not working after doing that. I tried to add them in the end of the .htaccess file

php_value extension=php_fileinfo.dll

php_admin_flag extension=php_fileinfo.dll

解决方案2:我尝试添加ini_set('extension', 'php_fileinfo.so'); 启用fileinfo但在添加文件后仍会出现相同的错误.

Solution2: I tried to add ini_set('extension', 'php_fileinfo.so'); to enable fileinfo but stil getting the same error after adding it.

解决方案3: 我试图在公共HTML页面的根文件夹中创建一个php.ini文件,以用我的文件覆盖php.ini文件,但仍然无法解决出现相同错误的问题.

solution 3: I tried to create a php.ini file in the root folder of the public HTML page to override the php.ini file with mine but it still won't work out getting the same error.

我的WordPress网站位于public_html目录的子文件夹中.根目录上有html index.html页面作为登录页面.

my WordPress site is inside a subfolder of the public_html directory. there is html index.html page on the root as a landing page.

我不知道如何检查它是否已启用.我创建了info.php文件并添加了phpinfo()函数以查看其显示的PHP详细信息,但我不知道在那里有什么finfo可以找到它.尝试搜索但无法正常工作.

I don't know how to check that it is enabled or not. I create info.php file and added phpinfo() function to see the PHP details it is showing but I don't know what finfo is there how to find it. tried to search out but won't work.

我正在尝试访问Cpanel,但没有解决.我尝试过的方法,我拥有的PHP 5.6大于PHP 5.3

I am having Cpanel access tried but not working out. the ways I tried and I am having PHP 5.6 which is greater than PHP 5.3

我签出了phpinfo();并在配置中显示...

I checked out phpinfo(); and in configuration, it is showing...

--enable-fileinfo=shared'

但是,我仍然遇到相同的错误.

but still, I am getting the same error.

表示已启用fileinfo.但是在服务器上phpinfo()没有显示fileinfo可用.

on my localhost when I use phpinfo() it shows that fileinfo is enabled. but on the server phpinfo() is not showing that fileinfo is availabe.

推荐答案

仅出于这些原因,我已停止使用插件,如果您将使用urself进行编码,则在任何环境下都不会出现任何问题.

for these reasons only I have stopped using plugins, If u will code from urself, u won't have any issue in any environment.

尝试逐个停用您的插件,并检查是哪个插件导致了该问题,如果可能的话,请检查另一个具有相同功能的插件,或者可以自己制作(最好的方法).

try to deactivate your plugins one by one and check, which plugin is causing the issue, if it's possible check another plugin with same features, or can make your own (best way).

您的某些插件需要finfo(fileinfo)-是可选的php扩展名.您可以通过CPanel或在php.ini中启用它,具体取决于您的托管.

Some of your plugin requires finfo (fileinfo)- is an optional php extension. You can enable it through CPanel or in php.ini, depending on your hosting.

如果您正在使用专用主机,则您可以自己对其进行编辑;如果没有,请致电您的托管服务提供商.

这篇关于启用了fileinfo,但仍然收到错误的WordPress插件要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆