|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-13 22:26 UTC] abies@php.net
[2005-02-23 21:33 UTC] abies@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 28 02:00:01 2025 UTC |
Description: ------------ i query a db (firebird 1.5.1)for a resultset I use a loop to go to all the records in the record processing i fork () in there i use shell_exec with the no hup terminate the child in the parent i verify a log file if the string i want is there i kill the child wait for the child when i try to update the db using the same db connection, or one new its reports a broken pipe The script was originally built using Pear DB, but i change it to ibase function to garante that wasn't a Pear DB bug. I compiled php with the following configuration ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-ssl --with-libxml --with-interbase=/opt/firebird --with-pear --with-zlib --enable-sockets --enable-track-vars --enable-pcntl -enable-debug My compiled modules root@host:/usr/src/php-5.0.2# php -m [PHP Modules] ctype dom iconv interbase libxml pcntl pcre posix session SimpleXML sockets SPL SQLite standard tokenizer xml zlib Thanks in advance Rui Francisco Reproduce code: --------------- $pid=pcntl_fork(); if ($pid == -1) { echo "Erro ao efectuar o fork\n"; } else if ($pid) { // we are the parent $resultado='-----'; //sleep(4); while ($resultado=='-----') { sleep(2); $a=shell_exec("cat xsupplicant.log"); if (strpos($a,'Failure',0)) { $resultado='SC'; shell_exec('ifconfig '.$vInterface.' down'); shell_exec('killall xsupplicant'); sleep(2); shell_exec('ifconfig '.$vInterface.' up'); } if (strpos($a,'Authenticated',0)) $resultado='A'; } pcntl_wait($status); } else { // we are the child ob_start(); shell_exec('killall xsupplicant 2>&1'); shell_exec('rm /var/run/xsupplicant 2>&1'); ob_end_clean(); sleep(1); $a=shell_exec("nohup xsupplicant -c conf_teste.conf -i ".$vInterface." & "); exit (0); } echo $vDominio." - ".$resultado."\n"; Expected result: ---------------- update the database, no message Actual result: -------------- Warning: ibase_query(): Unable to complete network request to host "localhost". Error writing data to the connection. Broken pipe in /web/roam/test_connectivity.php on line 210 Unable to complete network request to host "localhost". Error writing data to the connection. Broken pipe