Jump to content

Recommended Posts

Hey everyone, first post here, don't really know much about php but anyway here goes.

 

I have a script that uses the exec function, and my host refuses to enable it. I tried passthru and it is still disabled

 

I tried putting

 

Action php-script /interpreters/php-script
AddHandler php-script .php AddHandler php-script .php3

 

In my .htaccess file, the error while using the script goes, but it still wont execute. My host is telling me "there are other functions as alternatives to the dangerous exec function" but I can't seem to find any.

 

Is there a way I can edit and use this script?

 

Thanks, bomb.

Link to comment
https://forums.phpfreaks.com/topic/187096-disabled-exec/
Share on other sites

If they've disabled this, then you won't allow you to run any of the commands that allow php to execute os programs, so there's no workaround.  You are stuck using whatever internals, builtins and extensions that were included by your hosting company.  Since we don't know what the script in question does, there's no way to advise you of an alternative approach to accomplish the same thing, although there might be one.

Link to comment
https://forums.phpfreaks.com/topic/187096-disabled-exec/#findComment-988036
Share on other sites

Thankyou for your clear reply :)

 

<?
  require 'includes/configsexec.inc.php';//called instead of configs.inc.php to prevent overlap of functions
  require 'includes/mconfig.php';
  $status = 0;
  
  for($i=0;$i<count($mrr_1);$i++)
  { 
  $mrr=strtolower($mcon[$mrr_1[$i]][1]);
  $mrr_r=$mrr.'remote';
  $mrr_p=$mcon[$mrr_1[$i]][2];
  
  	if ((isset ($_POST_DATA[$mrr]) OR isset ($_POST[$mrr_r])))
    {
    exec ('' . $php_path . ' -c ' . $config_ini . ' ' . $mrr_p .' ' . $file_uid . ' ' . $status . ' >/dev/null &');
    }
  
  }

?>

 

There is the code :) Is there another way to do that?

Link to comment
https://forums.phpfreaks.com/topic/187096-disabled-exec/#findComment-988061
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.