#21649 [Opn]: This this problem with fopen() function for windows

From: Date: Thu, 16 Jan 2003 16:44:03 +0000
Subject: #21649 [Opn]: This this problem with fopen() function for windows
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-30265@lists.php.net to get a copy of this message
ID: 21649 User updated by: lipinski7722@rogers.com Reported By: lipinski7722@rogers.com Status: Open Bug Type: Filesystem function related Operating System: win2000 server PHP Version: 4.3.0 New Comment: Hi So anybody have idea what to do with fopen(windows env) or should I go back to Unix which snapshots are more stable Best Regards W.J.Lipinski Previous Comments: ------------------------------------------------------------------------ [2003-01-15 20:53:24] lipinski7722@rogers.com Hi I just switch to Apache 1.3 old one from 2.43 this is what I got as well when I try ini_set('include_path', '.;c:\php4\pear c:\\'); echo ini_get('include_path'), '<br />'; $fp = fopen('C:\php4\pear\authenticate.txt','r',1); $auth_file = fread ($fp, filesize($fp)); fclose($fp); .;c:\php4\pear c:\ Warning: fopen(C:\php4\pear\authenticate.txt) [function.fopen]: failed to create stream: No such file or directory in c:\program files\apache group\apache\htdocs\authfile.php on line 4 Warning: fread(): supplied argument is not a valid stream resource in c:\program files\apache group\apache\htdocs\authfile.php on line 5 Warning: fclose(): supplied argument is not a valid stream resource in c:\program files\apache group\apache\htdocs\authfile.php on line 6 Well I this point I assume that this is not apache proble just binary windows dist 4.3 php is with bugs .How I can install latest snapshot ,please I need an anser not just maybe ,babe :)) :)) or anybody out there has some simmilar story Best Regards W.J.Lipinski ------------------------------------------------------------------------ [2003-01-15 19:17:59] lipinski7722@rogers.com Do I need a wininstaller to install snapshot if so How to do it ? Is ther Apache 1.3 win-32 with SSL ? Honestly to God I have less problems with Oracle 9.2.0.2 on my suse linux than that Best Regards W.J.Lipinski ------------------------------------------------------------------------ [2003-01-15 19:14:26] lipinski7722@rogers.com Hi Sorry Gents but nothing same error this is my include_path 1 ; Windows: "\path1;\path2" 2 ; include_path = ".;c:\php4\includes" 3 include_path=".;c:\php4\pear" 4 ; include_path="c:\php4\pear;c:\php4\php-4.3.0-Win32" Please notice with this path Pear Db doesn't work and complaining about files it has to open When I uncommented line 4 pear Db that I installed in c:\php4\pear works fine With all line commented phpinfo() shows me .;C:\php4\pear and Pear Db also works OK I tried all scenerio as 1. removing absolte path as Sniper suggested 2. puting this code ini_set('include_path', '.;c:\php4\pear c:\\'); echo ini_get('include_path'), '<br />'; $fp = fopen('authenticate.txt','r',1); $auth_file = fread ($fp, filesize($fp)); fclose($fp); That what I got it .;c:\php4\pear c:\ Warning: fopen(authenticate.txt) [function.fopen]: failed to create stream: No such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\authfile.php on line 6 Warning: fread(): supplied argument is not a valid stream resource in C:\Program Files\Apache Group\Apache2\htdocs\authfile.php on line 7 Warning: fclose(): supplied argument is not a valid stream resource in C:\Program Files\Apache Group\Apache2\htdocs\authfile.php on line 8 Hope this will help You.I'm tried maybe going back to apache 1.3 isn't but suggestion and instaling latest snapshot .Do I need win- ------------------------------------------------------------------------ [2003-01-15 15:02:17] msopacua@idg.nl With the following script, I can't reproduce it on a win2k apache-1.3 system, with yesterday's stable snapshot: <?php ini_set('display_errors', 1); error_reporting(E_ALL); // notice the space in the include_path where a semicolon should be // also with a solid path no error ini_set('include_path', '.;d:\php4\pear c:\\'); echo ini_get('include_path'), '<br />'; // also with 'foo.txt', it works, when include_path is valid $fp = fopen('c:\foo.txt', 'r', 1); var_dump($fp); if($fp) fclose($fp); ?> ------------------------------------------------------------------------ [2003-01-15 14:29:17] sniper@php.net You're using the 3rd param for fopen(), which says to look in the include path for the file, but you're still using the absolute path to it..what if you change it to plain 'authenticate.txt' ?? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21649 -- Edit this bug report at http://bugs.php.net/?id=21649&edit=1

« previous php.bugs (#30265) next »