curl-and-php
pseudo-multithreads under windows
Date: Mon, 13 Mar 2006 16:13:31 +0300 (MSK)
Hello
My system is win XP SP2 and I have PHP 4.3.11 Apache 1.3.33 and cURL extention installed.
I have two scripts, say
#1.
[quote]<?php
for($i=0;$i<5;$i++)
{
$log="log".$i.".html";
$cmd='start /b c:/php/php.exe z:/home/multi/www/thread.php > z:/home/multi/www/[log]';
$cmd=str_replace("[log]", $log, $cmd);
echo "look thread #$i in <a target=_blank href=$log>$log</a><br>";
chdir ('c:/php');
pclose(popen($cmd, 'r'));
echo $cmd."<br>";
}
echo "DONE"; ?> [/quote]
and
#2. th.php
[quote]<?php
echo "hello world";
?> [/quote]
Together they allow me to start several processes in parallel, system() and exec() did not work for me under win environment
but this trick does not work with curl:
phpinfo() shows curl module in main script and no curl in the secondary, th.php script.
How can one get it running?
Unfortunately, dl() yields
[quote]Warning: dl(): Not supported in multithreaded Web servers - use extension statements in your php.ini in z:\home\multi\www\tmp.php on line 33 [/quote]
Looks like dl() cannot be used under windows, in contrast to what is written in PHP manual. (Check also http://bugs.php.net/bug.php?id=30152).
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-03-13