Re: Win2k3 - IIS 6.0 - PHP5 - EXEC Function - Stopping/starting a Service

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



it should have quotes before the 'net' and after 'servicename'

<?php
exec("net stop servicename");
?>

also, if php's safe_mode is on, you can only run programs in the safe_mode_exec_dir folder, which would need to be 'C:/WINDOWS/system32' if you are using the net command.

Jayvd wrote:

I'm trying to start and stop a service with PHP.

I've given cmd.exe the right permissions (so IIS can execute etc.) but it still doesn't work.

The script I use:
<?php exec(net stop SERVICENAME);
?>

Does anyone know how to solve this problem?


--------------=  Posted using GrabIt  =----------------
------=  Binary Usenet downloading made easy =---------
-=  Get GrabIt for free from http://www.shemes.com/  =-


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux