note 86965 added to function.exec

From: Date: Wed, 12 Nov 2008 16:57:04 +0000
Subject: note 86965 added to function.exec
Groups: php.notes 
Request: Send a blank email to php-notes+get-146450@lists.php.net to get a copy of this message
if you are using exec on a w2k3 machine with IIS and after a few times the page or IIS just hangs, you should add: " && exit" to your command. this way the cmd will always exit. example: <?php $computername = "MyComputer"; $ip = gethostbyname($computername); exec("ping ".$ip." -n 1 -w 90 && exit", $output); print_r($output); ?> You could also try this when you have problems with the system-function or any other method you use to execute a program! Maybe also useful when using apache, but I'm not sure about that! ---- Server IP: 213.249.64.162 Probable Submitter: 81.70.142.155 ---- Manual Page -- http://www.php.net/manual/en/function.exec.php Edit -- https://master.php.net/note/edit/86965 Del: integrated -- https://master.php.net/note/delete/86965/integrated Del: useless -- https://master.php.net/note/delete/86965/useless Del: bad code -- https://master.php.net/note/delete/86965/bad+code Del: spam -- https://master.php.net/note/delete/86965/spam Del: non-english -- https://master.php.net/note/delete/86965/non-english Del: in docs -- https://master.php.net/note/delete/86965/in+docs Del: other reasons-- https://master.php.net/note/delete/86965 Reject -- https://master.php.net/note/reject/86965 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#146450) next »