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

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

问题描述

我将gif上传到我的网站.上传完成后,我会看到此错误:

I upload a gif to my website. When is upload complete, i can see this error:

Warning: exec() has been disabled for security reasons in /data/web/virtuals/28995/virtual/www/include/functions/main.php on line 306

Fatal error: Call to undefined function execute() in /data/web/virtuals/28995/virtual/www/include/functions/main.php on line 309

这是main.php的一部分

And this is part from main.php

$owh = $width_old."x".$height_old;
$nwh = $final_width."x".$final_height;
if(!file_exists($temppic))
{
    $runinbg = "convert ".$file." -coalesce ".$temppic;
    $runconvert = execute("$runinbg");
}
$runinbg = "convert -size ".$owh." ".$temppic." -resize ".$nwh." ".$output;
$runconvert = execute("$runinbg");
return true;

谢谢您的帮助! :-)

Thank you for help! :-)

推荐答案

仅作为附加信息:

有一个名为disable_functions的php.ini指令. PHP将禁用添加到此列表的功能,并且当您尝试执行这些功能时,会出现此错误.如前所述,您的托管服务提供商很可能已将exec添加到了禁用列表中.这是共享托管中的常见做法.如果您确实要运行exec(或某些提供pseudo-exec功能的托管服务提供商),则需要一台专用服务器. It is a bad idea to trust a shared hosting provider who allows you to run exec unrestrained .

There is a php.ini directive called disable_functions. Functions added to this list will be disabled by PHP and when you try to execute those functions, you get this error. As mentioned, in all probability your hosting provider has added exec to the disabled list. This is a common practice in shared hosting. You will need a dedicated server if you really want to run exec (or some hosting provider who provides pseudo-exec functionality). It is a bad idea to trust a shared hosting provider who allows you to run exec unrestrained.

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

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