Professional Web Applications Themes

#40214 [NEW]: Bad File Descriptor, Please help me - PHP Bugs

From: support at vikoshosting dot com Operating system: Linux Kernel version 2.6.9-42.0. PHP version: 5CVS-2007-01-24 (snap) PHP Bug Type: Filesystem function related Bug description: Bad File Descriptor, Please help me Description: ------------ When I create a file using the FOPEN function and then try to change permissions on the file it says it cant be done because Bad File Descriptors. PHP version 5.1.6 Reproduce code: --------------- $conn_id = chmod_open(); $ourFileName = "testFile.txt"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); fclose($ourFileHandle); function chmod_open() { // Use your own FTP info $ftp_user_name = 'vikoshos'; $ftp_user_pass = 'frath0pr'; $ftp_root = '/'; $ftp_server ...

  1. #1

    Default #40214 [NEW]: Bad File Descriptor, Please help me

    From: support at vikoshosting dot com
    Operating system: Linux Kernel version 2.6.9-42.0.
    PHP version: 5CVS-2007-01-24 (snap)
    PHP Bug Type: Filesystem function related
    Bug description: Bad File Descriptor, Please help me

    Description:
    ------------
    When I create a file using the FOPEN function and then try to change
    permissions on the file it says it cant be done because Bad File
    Descriptors. PHP version 5.1.6

    Reproduce code:
    ---------------
    $conn_id = chmod_open();

    $ourFileName = "testFile.txt";
    $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
    fclose($ourFileHandle);

    function chmod_open()
    {
    // Use your own FTP info
    $ftp_user_name = 'vikoshos';
    $ftp_user_pass = 'frath0pr';
    $ftp_root = '/';
    $ftp_server = 'localhost';
    $conn_id = ftp_connect($ftp_server);
    $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
    return $conn_id;
    }

    function chmod_file($conn_id, $permissions, $ftpath)
    {
    echo "$ftpath";
    if (ftp_site($conn_id, 'CHMOD ' . $permissions . ' ' . $ftp_root .
    $ftpath) !== false)
    {
    return TRUE;
    }
    else
    {
    return FALSE;
    }
    }

    chmod_file($conn_id, 0777, $ourFileName);

    Expected result:
    ----------------
    Change the file mod to 777

    Actual result:
    --------------
    Warning: ftp_site() [function.ftp-site]: Could not change perms on
    newfile.txt: Bad file descriptor in code.php on line 168

    --
    Edit bug report at [url]http://bugs.php.net/?id=40214&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40214&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40214&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40214&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40214&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40214&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40214&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40214&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40214&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40214&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40214&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40214&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40214&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40214&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40214&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40214&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40214&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40214&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40214&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40214&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40214&r=mysqlcfg[/url]
    support at vikoshosting dot com Guest

  2. #2

    Default #40214 [Opn->Bgs]: Bad File Descriptor, Please help me

    ID: 40214
    Updated by: [email]tony2001php.net[/email]
    Reported By: support at vikoshosting dot com
    -Status: Open
    +Status: Bogus
    Bug Type: Filesystem function related
    Operating System: Linux Kernel version 2.6.9-42.0.
    PHP Version: 5CVS-2007-01-24 (snap)
    New Comment:

    Sorry, but your problem does not imply a bug in PHP itself. For a
    list of more appropriate places to ask for help using PHP, please
    visit [url]http://www.php.net/support.php[/url] as this bug system is not the
    appropriate forum for asking support questions. Due to the volume
    of reports we can not explain in detail here why your report is not
    a bug. The support channels will be able to provide an explanation
    for you.

    Thank you for your interest in PHP.




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

    [2007-01-24 04:40:23] support at vikoshosting dot com

    Description:
    ------------
    When I create a file using the FOPEN function and then try to change
    permissions on the file it says it cant be done because Bad File
    Descriptors. PHP version 5.1.6

    Reproduce code:
    ---------------
    $conn_id = chmod_open();

    $ourFileName = "testFile.txt";
    $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
    fclose($ourFileHandle);

    function chmod_open()
    {
    // Use your own FTP info
    $ftp_user_name = 'vikoshos';
    $ftp_user_pass = 'frath0pr';
    $ftp_root = '/';
    $ftp_server = 'localhost';
    $conn_id = ftp_connect($ftp_server);
    $login_result = ftp_login($conn_id, $ftp_user_name,
    $ftp_user_pass);
    return $conn_id;
    }

    function chmod_file($conn_id, $permissions, $ftpath)
    {
    echo "$ftpath";
    if (ftp_site($conn_id, 'CHMOD ' . $permissions . ' ' . $ftp_root .
    $ftpath) !== false)
    {
    return TRUE;
    }
    else
    {
    return FALSE;
    }
    }

    chmod_file($conn_id, 0777, $ourFileName);

    Expected result:
    ----------------
    Change the file mod to 777

    Actual result:
    --------------
    Warning: ftp_site() [function.ftp-site]: Could not change perms on
    newfile.txt: Bad file descriptor in code.php on line 168


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40214&edit=1[/url]
    tony2001@php.net Guest

Similar Threads

  1. Air extension could not create app descriptor file
    By johntmcii in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 3
    Last Post: October 22nd, 10:17 PM
  2. Error parsing the Tag Library Descriptor file
    By Tiger Lady in forum Coldfusion Server Administration
    Replies: 1
    Last Post: August 10th, 05:07 PM
  3. Dup 2: Bad File Descriptor...Whuzzat mean?
    By Michael in forum Linux Setup, Configuration & Administration
    Replies: 4
    Last Post: September 25th, 03:25 PM
  4. #25475 [NEW]: Direct IO access to raw file descriptor
    By mbostrom at syrah dot us in forum PHP Development
    Replies: 0
    Last Post: September 10th, 07:10 PM
  5. Read/Write IO on socket file descriptor
    By Patrick LeBoutillier in forum PERL Miscellaneous
    Replies: 1
    Last Post: July 20th, 02:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139