警告:出于安全原因已禁用了exec() [英] Warning: `exec()` has been disabled for security reasons
问题描述
我将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屋!