|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-01-15 02:03 UTC] lipinski7722 at rogers dot com
$fp = fopen("C:\authenticate.txt","r",1);
$auth_file = fread ($fp, filesize($fp));
fclose($fp);
in include_path I have
include_path c:\php4\pear;c:\ c:\php4\pear;c:\
That what I got
Warning: fopen(C:\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 3
Warning: fread(): supplied argument is not a valid stream resource in C:\Program Files\Apache Group\Apache2\htdocs\authfile.php on line 4
As You can see I have Apache2.
Since I'm more oracle guru than PHP I'd like to see
more consistent way You do bug reporting I will benefit
everbody.
Best Regards
W.J.Lipinski
PatchesJCfUZQsq (last revision 2020-05-14 13:24 UTC by sample at email dot tst)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 20:00:01 2025 UTC |
I just want to say that I included double \\ in path as well no luck $fp = fopen("C:\\authenticate.txt","r",1);Hi Sniper As You wish :)) This is what I got when I change a include_path as You suggested include_path .c:\php4\pear;c:\ .c:\php4\pear;c:\ look at 1.source <?php $fp = fopen("C:\\authenticate.txt","r",1); $auth_file = fread ($fp, filesize($fp)); fclose($fp); .... ?> 2.errors a) fopen() Warning: fopen(C:\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 3 Warning: fread(): supplied argument is not a valid stream resource in C:\Program Files\Apache Group\Apache2\htdocs\authfile.php on line 4 Warning: fclose(): supplied argument is not a valid stream resource in C:\Program Files\Apache Group\Apache2\htdocs\authfile.php on line 5 b) Pear db Warning: main(DB.php) [function.main]: failed to create stream: No such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\login_db.php on line 2 Fatal error: main() [function.main]: Failed opening required 'DB.php' (include_path='.c:\php4\pear;c:\') in C:\Program Files\Apache Group\Apache2\htdocs\login_db.php on line 2 be more systematic :)) :)) I say changing the path in php.ini doesn't do the trick I change it back to include_path="c:\php4\pear;c:\php4\php-4.3.0-Win32" and put my authenticate.txt afert kicking Apache I got from phpinfo() include_path c:\php4\pear;c:\php4\php-4.3.0-Win32 c:\php4\pear;c:\php4\php-4.3.0-Win32 read this portion and I need an anser please no more guess $fp = fopen("C:\\php4\\php-4.3.0-Win32\\authenticate.txt","r",1); $auth_file = fread ($fp, filesize($fp)); fclose($fp); Now I got Pear DB working and same error with fopen() this is a print out Warning: fopen(C:\php4\php-4.3.0-Win32\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 3 Warning: fread(): supplied argument is not a valid stream resource in C:\Program Files\Apache Group\Apache2\htdocs\authfile.php on line 4 Warning: fclose(): supplied argument I hope this will help You Best Regards W.J.LipinskiWith 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); ?>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-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.LipinskiYour include_path is wrong: include_path c:\php4\pear;c:\ c:\php4\pear;c:\ should read include_path="c:\php4\pear;c:\" an then you should fopen "c:\authenticate.txt" like this: $fp= fopen("autenticate.txt","r",1); because c:\ is already in your include path and you use 1 as your 3rd parameter. Christoph ChristophHi I just try your solution.It doesn't work. This is my path from <?php phpinfo();?> include_path c:\php4\pear;c:\ c:\php4\pear;c:\ Could You SEE IT!!!!!!!!!!!!! This is a code I'm tring to run <?php ini_set('include_path', 'c:\php4\pear;c:\\'); echo ini_get('include_path'), '<br />'; if(!$fp = fopen("authenticate.txt","r",1)) { die("<P>could not open password file"); } //$fp = fopen('C:\php4\pear\authenticate.txt','r',1); $auth_file = fread ($fp, filesize($fp)); fclose($fp); This is an error I'm getting 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\apache\htdocs\authfile.php on line 5 could not open password file Best Regards W.J.LipinskiUsing this script: <?php error_reporting(E_ALL); ini_set('include_path','.;c:\\'); $fp=fopen('autoexec.bat','r', 1); echo ini_get('include_path'); ?> I can't reproduce this (with PHP 4.3.2-dev) under Windows 2000. Please try it out.