#45738 [NEW]: php stream error

From: Date: Thu, 07 Aug 2008 01:21:58 +0000
Subject: #45738 [NEW]: php stream error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127697@lists.php.net to get a copy of this message
From: ajai73 at hotmail dot com Operating system: vista 32 PHP version: 4.4.8 PHP Bug Type: Streams related Bug description: php stream error Description: ------------ i have an error when loading csv widget on my site. -partial widget -navbar not show Error state. Warning: fopen(/path_to/uploads/content.csv) [function.fopen]: failed to open stream: No such file or directory in /mnt/w0500/d41/s13/b02e8f66/www/lnaelite.org/widget/libs/Content.php on line 6 Warning: fgetcsv(): supplied argument is not a valid stream resource in /mnt/w0500/d41/s13/b02e8f66/www/lnaelite.org/widget/libs/Content.php on line 7 Warning: fclose(): supplied argument is not a valid stream resource in /mnt/w0500/d41/s13/b02e8f66/www/lnaelite.org/widget/libs/Content.php on line 18 Reproduce code: --------------- <? function getCsv($parse) { $i = 0; $handle = fopen ($parse,"r"); while($data = fgetcsv ($handle, 1000, ",")) { if ($i == 0) { $key_arr = $data; } reset($key_arr); while(list($index,$name) = each($key_arr)) { $temp_arr[$name] = $data[$index]; } $result[$i] = $temp_arr; $i++; } fclose ($handle); return $result; } Expected result: ---------------- no database required for widget. ftp widget files to writable dir/. (use excel docs. widget appears fully functional. Actual result: -------------- widget functional with basketball stats. roster. images. -- Edit bug report at http://bugs.php.net/?id=45738&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45738&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45738&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45738&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45738&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45738&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45738&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45738&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45738&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45738&r=support Expected behavior: http://bugs.php.net/fix.php?id=45738&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45738&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45738&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45738&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45738&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45738&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45738&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45738&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45738&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45738&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45738&r=mysqlcfg

« previous php.bugs (#127697) next »