|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesFile (last revision 2010-07-09 12:56 UTC by milicicivan3510 at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-02-11 15:48 UTC] sniper@php.net
[2003-02-11 15:52 UTC] laudanp at yahoo dot com
[2003-02-11 15:59 UTC] nicos@php.net
[2003-02-11 16:05 UTC] laudanp at yahoo dot com
[2003-02-11 18:01 UTC] wez@php.net
[2003-02-11 18:15 UTC] wez@php.net
[2003-02-11 18:19 UTC] laudanp at yahoo dot com
[2003-02-11 18:22 UTC] wez@php.net
[2003-02-11 18:22 UTC] laudanp at yahoo dot com
[2003-02-14 05:29 UTC] hholzgra@php.net
[2003-02-14 11:29 UTC] laudanp at yahoo dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 27 23:00:01 2025 UTC |
A php script I have worked fine under PHP 4.2.3, but after the upgrade to PHP 4.3 whenever I try running it I get these errors: Warning: fopen() expects parameter 1 to be string, resource in ... on line 353 Warning: fwrite(): supplied argument is not a valid stream resource in ... on line 354 Warning: fclose(): supplied argument is not a valid stream resource in ... on line 355 Warning: getimagesize(Resource id #4) [function.getimagesize]: failed to create stream: No such file or directory in ... on line 361 The following blocks of code surround the problematic lines from above: if ($input = fopen($image, "rb")) { $image_data = fread ($input, 2048576); fclose($input); if (!$tmp_image = @tmpfile()) { exit("Cannot create tempfile using tmpfile()."); } 353: $output = fopen($tmp_image, "wb"); 354: fwrite($output, $image_data); 355: fclose($output); 356: } else { 357: exit("Cannot access ".$image." for reading. (Does not exist or has wrong permissions)"); 358: } 359: 360: // Create Image from file by type, get and set size 361: list($width,$height,$type) = getimagesize($tmp_image); 362: I'm having difficulty determining what the problem is since the code worked with PHP 4.2.3. Thanks for your help.