note 68149 added to function.phpversion

From: Date: Fri, 14 Jul 2006 23:33:20 +0000
Subject: note 68149 added to function.phpversion
Groups: php.notes 
Request: Send a blank email to php-notes+get-114799@lists.php.net to get a copy of this message
When PHP is running under fastcgi, script from ground-pilot at net-pilots.com didn't work as expected. Otherwise, the php (fcgi one) is waiting for input and causing idle php-cgi processes showed in 'ps aux'. I think this is because in fastcgi mode, direct execution to php fcgi binary is waiting for input. So, giving it /dev/null as input is a workaround for this situation. First, we build a script from PHP which we will executed and then unlink() it after a success. The output script might look like: <? $script=<<<HEREDOC #!/bin/sh /usr/local/bin/php-cgi -v < /dev/null \n HEREDOC; $file = "/tmp/phpgetvercmd" . rand ( ); $fh = fopen ( $file , "w" ); fwrite ( $fh, $script ); fclose ( $fh ); chmod ( $file, 0755 ); echo trim( substr ( shell_exec ( $file ), 3, 6 ) ); unlink ( $file ); ?> ---- Server IP: 66.163.161.117 Probable Submitter: 203.153.119.131 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.phpversion.php Edit -- http://master.php.net/note/edit/68149 Del: integrated -- http://master.php.net/note/delete/68149/integrated Del: useless -- http://master.php.net/note/delete/68149/useless Del: bad code -- http://master.php.net/note/delete/68149/bad+code Del: spam -- http://master.php.net/note/delete/68149/spam Del: non-english -- http://master.php.net/note/delete/68149/non-english Del: in docs -- http://master.php.net/note/delete/68149/in+docs Del: other reasons-- http://master.php.net/note/delete/68149 Reject -- http://master.php.net/note/reject/68149 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#114799) next »