bomb Posted January 4, 2010 Share Posted January 4, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/187096-disabled-exec/ Share on other sites More sharing options...
gizmola Posted January 4, 2010 Share Posted January 4, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/187096-disabled-exec/#findComment-988036 Share on other sites More sharing options...
bomb Posted January 4, 2010 Author Share Posted January 4, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/187096-disabled-exec/#findComment-988061 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.