|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-10 13:49 UTC] tony2001@php.net
[2006-01-10 14:00 UTC] rquadling at gmail dot com
[2008-05-30 10:14 UTC] rquadling@php.net
[2008-06-06 09:35 UTC] rquadling@php.net
[2008-07-13 18:44 UTC] pajoye@php.net
[2008-07-15 10:11 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 22 23:00:01 2025 UTC |
Description: ------------ Within windows CMD32, the following works (obviously you will need to have a Windows system with Internet Explorer installed). "C:\Program Files\Internet Explorer\IEXPLORE.EXE" Will load Internet Explorer. In PHP run from the CLI ... <?php $sOutput = shell_exec('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"'); ?> Will load Internet Explorer and wait until it is closed. If you want to pass the program a parameter then you would wrap the parameter with double quotes. e.g. From the command line ... "C:\Program Files\Internet Explorer\IEXPLORE.EXE" "http://www.google.com" Will load Internet Explorer and place you at Google. If you try the same sort of thing in PHP ... <?php $sOutput = shell_exec('"C:\Program Files\Internet Explorer\IEXPLORE.EXE" "http://www.google.com"'); ?> You get an error of ... 'C:\Program' is not recognized as an internal or external command, operable program or batch file. Reproduce code: --------------- <?php $sOutput = shell_exec('"C:\Program Files\Internet Explorer\IEXPLORE.EXE" "http://www.google.com"'); ?> Expected result: ---------------- Internet Explorer loads with the Google page being displayed. Actual result: -------------- 'C:\Program' is not recognized as an internal or external command, operable program or batch file.