警告:出于安全原因已禁用exec() [英] Warning: exec() has been disabled for security reasons

查看:699
本文介绍了警告:出于安全原因已禁用exec()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面上收到此错误:

I get this error on my page:

警告:出于安全原因,在2036行的/home/a2297145/public_html/android/index.php中已禁用exec()

Warning: exec() has been disabled for security reasons in /home/a2297145/public_html/android/index.php on line 2036

代码如下:

//
// Determine the size of a file
// 
public static function getFileSize($file)
{
    $sizeInBytes = filesize($file);

    // If filesize() fails (with larger files), try to get the size from unix command line.
    if (EncodeExplorer::getConfig("large_files") == true || !$sizeInBytes || $sizeInBytes < 0) {
        $sizeInBytes=exec("ls -l '$file' | awk '{print $5}'");
    }
    return $sizeInBytes;
}

您能帮我解决这个问题吗?

Can you help me to solve this?

推荐答案

可以通过两种方法解决此错误:

This error can be resolved in two ways:

  1. 要么检查服务器上" php.ini "文件中的" disabled_functions "列表,然后从列表中删除exec().
  1. Either check for "disabled_functions" list in "php.ini" file on your server and remove exec() from the list.

OR

  1. 登录WHM并在左上方键入"multiPHP Manager"搜索框 在角落并转到multiPHP管理器.选择要禁用exec()或shell_exec()的php version部分中的域.并点击编辑PHP-FPM并向下滚动至disable_functions并通过在此处编辑列表来删除exec()或shell_exec().
  1. Login into WHM and type "multiPHP Manager" search box in top left corner and go to multiPHP manager. Choose the domain inside php version section in which you want to disable exec() or shell_exec(). and click on edit PHP-FPM and scroll down to disable_functions and remove exec() or shell_exec() by editing list there.

这篇关于警告:出于安全原因已禁用exec()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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