Warning: `exec ()` is disabled for security reasons

I upload a gif to my website. When the download is complete, I 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 

And this is part of 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; 

Thanks for the help!: -)

+4
source share
2 answers

As well as additional information:

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 these functions, you will get this error. As already mentioned, your hosting provider has added exec to the list of disconnected ones. 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 that provides pseudo-exec functions). It is a bad idea to trust a shared hosting provider who allows you to run exec unrestrained .

+7
source

These errors only mean what they say.

 Fatal error: Call to undefined function execute() 

You call a function that does not exist.

 Warning: exec() has been disabled for security reasons 

Your web host has disabled the exec() method, you will not be able to run background scripts (as if you are trying to do). You need to find another way to achieve your goal or find another website.

+2
source

Source: https://habr.com/ru/post/1479553/


All Articles