[ale] simple PHP question on proc_open
Jerry Yu
jjj863 at gmail.com
Sun Feb 11 13:18:36 EST 2007
hi, I installed a wordpress plugin. It did a proc_open for a command of
/usr/bin/convert. It always complains about 'sh: /convert no such file or
directory'.
To test the proc_open call, I wrote this snippet and found proc_open()
somehow stripps the leading path and replaces with '/'. Running this
following snippet, it complains about no '/date', no matter I have
/usr/bin/date' or 'date' in the proc_open call. This is on an up-to-date
Fedora Core 6/i386 with some secure configuration done for PHP.
Here is a snippet
============= j.php =================
<?php
$cmd = 'date';
$descriptors = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("file", "php://stderr", "w")
);
$process = proc_open('date', $descriptors, $fd_set);
if (is_resource($process)) {
print "got it\n";
} else { print "NO NO"; }
proc_close ($process);
?>
============= j.php =================
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ale
mailing list