php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25861 bug in php 4.2
Submitted: 2003-10-14 08:21 UTC Modified: 2003-10-14 08:56 UTC
From: kailash at sarksoft dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.1 OS: redhat 9.0
Private report: No CVE-ID: None
 [2003-10-14 08:21 UTC] kailash at sarksoft dot com
Description:
------------
I am using register_shutdown_function which is not working under
php-4.2.2-17
httpd-2.0.40-21
Redhat 9.0


The function does not getting called at all. Also there are no errors reported in  error_log as specified in php manual.


Apparently the php script seems to working on
mod_php4-4.3.1-24
apache-1.3.27-38
Suse 8.2
Here there is a error in error_log as per php manual
PHP Fatal error:  Unknown(): Unable to open testDW.php in Unknown on line 0


This is the code I am using to check for download from broswer

#test.php

<?php
register_shutdown_function("myshutdown");
                                                                                
header ("Content-Type: application/octet-stream");
readfile("html-without-uploadsDir-27-09.tar.gz");
                                                                                
function myshutdown(){
    if(connection_aborted()==0){
#        exec ("net send ZXC connection_aborted()==0");
                 exec ("php -q testDW.php 0");
    } else {
#        exec ("net send ZXC connection_aborted()!=0");
                exec ("php -q testDW.php 1");
    }
}
                                                                                
?>

#testDW.php

<?php
$cmdarr=$_SERVER['argv'];
$arg=$cmdarr[1];
                                                                                
if($arg==1)
{
        $fp=fopen("/var/www/html/utilities/files/newsletter/download.txt","w");        fputs($fp,"unsuccessful");
fclose($fp);
}
else
{
        $fp=fopen("/var/www/html/utilities/files/newsletter/download.txt","w");        fputs($fp,"successful");
fclose($fp);
}
                                                                                
?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-14 08:56 UTC] sniper@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

PHP 4.3.3 is the latest release.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 19:01:29 2024 UTC