From:             phpbugs at bob7 dot com
Operating system: Windows 2000 server
PHP version:      4.3.1
PHP Bug Type:     Program Execution
Bug description:  Cannot call PHP from shell_exec

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.
-- 
Edit bug report at http://bugs.php.net/?id=22926&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22926&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22926&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22926&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22926&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22926&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22926&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22926&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22926&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22926&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22926&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22926&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22926&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22926&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22926&r=gnused

Reply via email to