$username Posted February 23, 2010 Share Posted February 23, 2010 I ran into an issue running cmds through shell_exec. When you trigger a shell_exec it will open the exe as the Apache service user. By default Apache installs as a local system account. So if you need to connect to a remote server to run a cmd it will hang in the task manager. example shell_exec("psexec \\\\remoteComputer -i -d -s dnscmd /zoneadd domain.com /primary") When a cmd needs to access other servers you will need to make the Apache service run as a user that has access to other remote servers. http://httpd.apache.org/docs/2.2/platform/windows.html See the section about running Apache as a service This may not work for all cases but it seems to work for my issues when running cmds that needed more privileges -Brett Link to comment https://forums.phpfreaks.com/topic/193114-shell_exec-on-windows-with-apache/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.