thephpguy Posted March 12, 2007 Share Posted March 12, 2007 This is my set up: My server is a windows machine, on the same domain as python(also a windows machine). Apache is running as a service as an administrator. This is a test only environment to whom it may concern(I hate people telling me how insecure my system is) I'm just trying to run: $last_line = exec('dir \\python\c$', $retval, $g); print_r($retval); echo '<br>'.$g.'<br>'; echo '$last_line= '.$last_line.'<br>'; Which outputs: Array ( ) 1 $last_line= The command from the command line works fine. And apache can access directories that only administrators can access on the local machine. What's wrong??? Thanks in advance! -Tim Link to comment https://forums.phpfreaks.com/topic/42415-system-command-not-working-on-remote-system-windows/ Share on other sites More sharing options...
thephpguy Posted March 12, 2007 Author Share Posted March 12, 2007 Correction to myself, typically apache runs under user system, when doing a echo %username% in the cmd line this will echo the computers name instead of the username system. Right now when I do an "echo %username%" it echos the administrators user account username.(which is correct) Also just to doubly prove that the apache service is running as the admin, when looking in the task manager HTTPD.exe(both of them) is running under the admin account. I will add the group is N/A. also trying to run psexec gives me Array ( ) 1326 $last_line= Apache version = 2.2.4 PHP version = 5.2.1 Link to comment https://forums.phpfreaks.com/topic/42415-system-command-not-working-on-remote-system-windows/#findComment-205764 Share on other sites More sharing options...
thephpguy Posted March 13, 2007 Author Share Posted March 13, 2007 Bump Anyone? Link to comment https://forums.phpfreaks.com/topic/42415-system-command-not-working-on-remote-system-windows/#findComment-206211 Share on other sites More sharing options...
thephpguy Posted March 13, 2007 Author Share Posted March 13, 2007 Ok I think I got part of it figured out. It is indeed a permissions issue.... $command="psexec "; \\removed command for my privacy $output=shell_exec($command." 2>&1"); //system call print "<pre>$output</pre>\n"; //show output outputs PsExec v1.71 - Execute processes remotely Copyright © 2001-2006 Mark Russinovich Sysinternals - www.sysinternals.com Logon failure: unknown user name or bad password. PsExec could not start \server_name: Link to comment https://forums.phpfreaks.com/topic/42415-system-command-not-working-on-remote-system-windows/#findComment-206394 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.