|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-03-27 07:45 UTC] phpbugs at bob7 dot com
The following does not work. It spawns scores of processes, which fortunately all die after 30 seconds.
<?
echo shell_exec("(path to php)/php.exe -h");
?>
I looked at the bug reports about possibly needing command.com but these do not work either: (same result)
<?
echo shell_exec("command -c (path to php)/php.exe -h");
?>
<?
echo shell_exec("CMD /C (path to php)/php.exe -h");
?>
Why would I want to do this? To send html email using the PEAR mime mail class, i.e.
<?
$htmlBody = shell_exec("(path to php)/php.exe mimebody.php?param1=yada");
//rest of code to send mail...
?>
I downloaded and installed the standard windows installer, and the path to php is C:\Inetpub\PHP
I have the same problem using back ticks as well.
Thanks very much for looking at this.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
Works w/ CLI, not PHP Bug => Bogus As to using a stream to get the output of processing another PHP file: Unfortunately the document you want processed (using this method) MUST be in a publicly accessable document tree. All the php stream does is pretend its a browser making a page request. What you *can* do, if you want to be able to do this the easy way but not have the document be publicly accessable is give it a password. // In your main script: <?php $message = file_get_contents("http://localhost/generateemail.php?password=secret"); ?> // In generateemail.php: <?php if ($_GET['password'] != 'secret') die("Don't hack!"); // Do the rest of your magic ?> Hope that helps.