ID:               15746
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Feedback
 Bug Type:         Performance problem
 Operating System: Windows 2000 Server
 PHP Version:      4.1.1
 New Comment:

Could one of you guys try a CVS snapshot and alter the scripts to use
the new proc_open function?
It's possible that it might have better performance,
(and you can then redirect stderr too!)



Previous Comments:
------------------------------------------------------------------------

[2002-05-23 02:09:13] [EMAIL PROTECTED]

hi all,

just wanted to add to this:

im running windows 2000 (german), apache 1.3.24 with php 4.2.1.
(php4apache.dll). i have the same issue described above, with netpbm
just timing out, even when trying to do a simple "-version" in a
script. since i need to use netpbm for a gallery i run (which ran fine
on omnihttpd btw), i would like to know if there is a workaround, or if
this bug will be fixed anytime soon.

------------------------------------------------------------------------

[2002-02-28 14:24:11] [EMAIL PROTECTED]

This is a frequently reported problem on the Gallery Users mailing list
(http://gallery.sourceforge.net/)

------------------------------------------------------------------------

[2002-02-26 22:29:22] [EMAIL PROTECTED]

Summary:

Running a PHP script which calls exec() from withing Apache runs
terribly slow or times out.  Running same from the command prompt
returns in seconds.

Details:
I (and other NT users) have run into performance issues running PHP
4.1.1 with the NETPBM distribution.    When running thumbnailing
operations via. webpages, the performance (throughtput) of the system
is dismal.

Running the same PHP script manually from the command shell completes
operations in under a second which usually timeout when executed from a
webpage.

A full "ready to run" repro of this problem is available via. a small
ZIP file at http://www.green-bean.com/bugfiles/slowrepro.zip.   This
contains the required NETPBM files.   If these are already installed on
your system, you can run the script below with slight modifications.

Thanks,
Nigel.
----
Repro:

<?
// Full repro kit including executables available from
http://www.green-bean.com/bugfiles/slowrepro.zip
//

// Location of your NETPBM distribution
// We're using
http://prdownloads.sourceforge.net/gallery/netpbm1.1-gallery1.0-win32.tgz
// 
$pbmroot = "netpbm";

// JPG input file (from
http://www.green-bean.com/DallasChristmasHat.jpg)
$file = "DallasChristmasHat.jpg";


function fs_exec($cmd, &$results, &$status, &$time) {
    // We can't redirect stderr with Windows.  Hope that we won't need
to.
    $time_st = time();
    $x = exec("$cmd", $results, $status);
    $time = time() - $time_st;
}

$quiet = "-quiet";

// JPEG to PNM
$cmd_to_pnm    = "$pbmroot\\jpegtopnm $quiet $file > out\\$file.pnm";

print "<br>Exec: $cmd_to_pnm\n";
fs_exec($cmd_to_pnm, $results, $status, $elapsed);
print "<br>Elapsed: $elapsed secs\n<br>Status: $status";

// PNM to scaled PNM
$cmd_scale_pnm = "$pbmroot\\pnmscale  $quiet -xysize 150 150
out\\$file.pnm > out\\$file.scale.pnm";

print "<br>Exec: $cmd_scale_pnm\n";
fs_exec($cmd_scale_pnm, $results, $status, $elapsed);
print "<br>Elapsed: $elapsed secs\n<br>Status: $status";

// PNM scaled to JPG
$cmd_to_jpg    = "$pbmroot\\ppmtojpeg $quiet out\\$file.scale.pnm
--quality=150 > out\\tn_$file";

print "<br>Exec: $cmd_to_jpg\n";
fs_exec($cmd_to_jpg, $results, $status, $elapsed);
print "<br>Elapsed: $elapsed secs\n<br>Status: $status";

?>

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=15746&edit=1

Reply via email to