php exec doesnt works on iis

altariamx2003
altariamx2003 used Ask the Experts™
on
I got a windows dedicated server with hostgator, there Im trying to add a exe script that receive some variables and after his process ends returns some result that the php page get and print, like this:

http://www.pvtcloudlab.com/test10.php
<?php
exec("files\\solver.exe 0 1 2 3 4 2>&1",$out,$exitcode);
echo "<br />EXEC: ( exitcode : $exitcode )";
echo "<hr /><pre>";
print_r($out);
echo "</pre>";

$output = shell_exec("whoami");  
echo "<pre>$output</pre>";
?>

Open in new window


But no matter what config i change I allways get the following error:
EXEC: ( exitcode : 1 )

Array
(
    [0] => This program is blocked by group policy. For more information, contact your system administrator.
)

Open in new window


From the screens "iie-screen1.jpg" to "iie-screen5.jpg" its all changes that I do in IIS
iie-screen1iie-screen2iie-screen3iie-screen4iie-screen5
And also this is my web.config file that im using on this site:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="rule seccion" stopProcessing="true">
	                <match url="^section/([a-zA-Z0-9-]*)$" />
	                <action type="Rewrite" url="//section/plantilla.php?rpl={R:1}" />
                </rule>
                <rule name="casos" stopProcessing="true">
	                <match url="^cases/([a-zA-Z0-9-]*)$" />
	                <action type="Rewrite" url="//cases/layout.php?rpl={R:1}" />
                </rule>
                <rule name="cursos" stopProcessing="true">
	                <match url="^trainning/courses/([a-zA-Z0-9-]*)$" />
	                <action type="Rewrite" url="//trainning/courses/plantilla.php?rpl={R:1}" />
                </rule>
                <rule name="otros" stopProcessing="true">
	                <match url="^trainning/others/([a-zA-Z0-9-]*)$" />
	                <action type="Rewrite" url="//trainning/others/plantilla.php?rpl={R:1}" />
                </rule>
                <rule name="talleres" stopProcessing="true">
	                <match url="^trainning/workshops/([a-zA-Z0-9-]*)$" />
	                <action type="Rewrite" url="//trainning/workshops/plantilla.php?rpl={R:1}" />
                </rule>
                <rule name="diplomados" stopProcessing="true">
	                <match url="^trainning/diploma/([a-zA-Z0-9-]*)$" />
	                <action type="Rewrite" url="//trainning/diploma/plantilla.php?rpl={R:1}" />
                </rule>
                <rule name="especialidades" stopProcessing="true">
	                <match url="^trainning/specific/([a-zA-Z0-9-]*)$" />
	                <action type="Rewrite" url="//trainning/specific/plantilla.php?rpl={R:1}" />
                </rule>
                <rule name="maestrias" stopProcessing="true">
	                <match url="^trainning/masters/([a-zA-Z0-9-]*)$" />
	                <action type="Rewrite" url="//trainning/masters/plantilla.php?rpl={R:1}" />
                </rule>
                <rule name="doctorados" stopProcessing="true">
	                <match url="^trainning/doctoral/([a-zA-Z0-9-]*)$" />
	                <action type="Rewrite" url="//trainning/doctoral/plantilla.php?rpl={R:1}" />
                </rule>
                <rule name="webinars" stopProcessing="true">
	                <match url="^trainning/webinars/([a-zA-Z0-9-]*)$" />
	                <action type="Rewrite" url="//trainning/webinars/plantilla.php?rpl={R:1}" />
                </rule>
            </rules>
        </rewrite>
        <handlers>
            <remove name="prueba solver" />
            <add name="prueba solver" path="C:\inetpub\vhosts\pvtcloudlab.com\httpdocs\files\solver.exe" verb="*" modules="CgiModule" scriptProcessor="C:\inetpub\vhosts\pvtcloudlab.com\httpdocs\files\solver.exe" resourceType="File" requireAccess="Script" />
        </handlers>
    </system.webServer>
</configuration>

Open in new window



Thinking that maybe the problem was about the users and his permissions i add this two lines add the end of the test
$output = shell_exec("whoami");  
echo "<pre>$output</pre>";

Open in new window

to see who is the owner of the process, that result was "pvtc\iwpd_1(pvtadmin)", thats way I add him all permissions to the folder where i got the script(iie-screen6.jpg and iie-screen7.jpg).
iie-screen6iie-screen7
Before to change the domain to the windows dedicated server with hostgator, I had my page pointed to another windows dedicated server where i has the page using xampp and all works without a problems
link: http://201.159.192.204/test1.php
<?php
  $salida = array();
  exec("C:\\inetpub\\vhosts\\pvtcloudlab.com\\httpdocs\\solver.exe 0 1 2 3 4",$salida);
  echo $salida[0]; 
?>

Open in new window


What im missing???

Wha im doing wrong???
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
You'll have to ask Hostgator.  If it's "group policy", they must have set it.

Author

Commented:
but the configuration is ok???
Fixer of Problems
Most Valuable Expert 2014
Commented:
I don't know but it doesn't matter if the program is 'blocked by group policy'.  It looks like you're trying to execute a file that is in a user upload area.  Hosting companies don't like running programs uploaded by users.  'whoami' runs because it is a system program, not one uploaded by a user.

Author

Commented:
ok thx dave

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial