d22552000 Posted September 8, 2007 Share Posted September 8, 2007 Warning: fopen(res:///PHP/C:\): failed to open stream: No such file or directory in *\server.exe on line 19 Warning: fread(): supplied argument is not a valid stream resource in *\server.exe on line 20 Warning: fclose(): supplied argument is not a valid stream resource in *\server.exe on line 21 And $header[1] is: /index.html I get those things when I use the following code: **CODE SNIPPED** $input="";$output="";$header="";$request="";$value="";$path="C:/"; $input = socket_read($spawn, 1024) or die("Could not read input\n"); $input = trim($input); $request = split("[\n\r\t]+", $input); $header = split("[ ]+", $request); if ($header[1]=="/") { print "\n User Requested /"; } foreach ($request as $value) { $totalvar .="\t".$value; } $f = fopen($path.$header[1],"r"); $output = fread($f,filesize($path.$header[1])); fclose($f); **CODE SNIPPED** and my web browser acessing the web server returns: The webpage did not respond. Uh, so why do I get these? Why does it add "res:///PHP/" befroe the request? Quote Link to comment https://forums.phpfreaks.com/topic/68519-fopen-problem/ Share on other sites More sharing options...
d22552000 Posted September 8, 2007 Author Share Posted September 8, 2007 oh cmon please, this is all I needd then my web server workd (more or less) I just need to add php support . Quote Link to comment https://forums.phpfreaks.com/topic/68519-fopen-problem/#findComment-344406 Share on other sites More sharing options...
d22552000 Posted September 8, 2007 Author Share Posted September 8, 2007 Warning: fopen(res:///PHP/C:\): failed to open stream: No such file or directory in *\server.exe on line 19 Warning: fread(): supplied argument is not a valid stream resource in *\server.exe on line 20 Warning: fclose(): supplied argument is not a valid stream resource in *\server.exe on line 21 And $header[1] is: /index.html I get those things when I use the following code: **CODE SNIPPED** $input="";$output="";$header="";$request="";$value="";$path="C:/"; $input = socket_read($spawn, 1024) or die("Could not read input\n"); $input = trim($input); $request = split("[\n\r\t]+", $input); $header = split("[ ]+", $request); if ($header[1]=="/") { print "\n User Requested /"; } foreach ($request as $value) { $totalvar .="\t".$value; } $f = fopen($path.$header[1],"r"); $output = fread($f,filesize($path.$header[1])); fclose($f); **CODE SNIPPED** and my web browser acessing the web server returns: The webpage did not respond. Uh, so why do I get these? Why does it add "res:///PHP/" befroe the request? Quote Link to comment https://forums.phpfreaks.com/topic/68519-fopen-problem/#findComment-344413 Share on other sites More sharing options...
d22552000 Posted September 9, 2007 Author Share Posted September 9, 2007 omg people PLEASE HELP ME Quote Link to comment https://forums.phpfreaks.com/topic/68519-fopen-problem/#findComment-344519 Share on other sites More sharing options...
d22552000 Posted September 9, 2007 Author Share Posted September 9, 2007 since you guys are being so "nice" il give you more information GET / HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */* Accept-Language: en-US UA-CPU: x86 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Host: 127.0.0.1 Connection: Keep-Alive is another example request to the server. I am trying to get the first line "GET / HTTP/1.1". I seperated it so each line is its own value $request[num] and each space seperated on line 1 is $header[num][ ALSO: [09-09-07_9:53:10] GET / HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */* Accept-Language: en-US UA-CPU: x86 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Host: 127.0.0.1 Connection: Keep-Alive\w is what my server logged it has good advanced logging. Quote Link to comment https://forums.phpfreaks.com/topic/68519-fopen-problem/#findComment-344528 Share on other sites More sharing options...
d22552000 Posted September 9, 2007 Author Share Posted September 9, 2007 How much more information do I need before I can get help!?!?!?!? uh.. php 4.4.4 using bambalam php compiler, im using windows xp vs.8987465765456497 compilation 2600 here is sysinfo: OS Name Microsoft Windows XP Professional Version 5.1.2600 Service Pack 2 Build 2600 OS Manufacturer Microsoft Corporation System Name INDRA System Manufacturer INTEL_ System Model D845GVSR System Type X86-based PC Processor x86 Family 15 Model 2 Stepping 9 GenuineIntel ~2666 Mhz BIOS Version/Date Intel Corp. VA84510A.86A.0023.P08.0309261501, 26/09/2003 SMBIOS Version 2.3 Windows Directory C:\WINDOWS System Directory C:\WINDOWS\system32 Boot Device \Device\HarddiskVolume1 Locale Canada Hardware Abstraction Layer Version = "5.1.2600.2562 (xpsp.040919-1030)" User Name INDRA\Administrator Time Zone Pacific Daylight Time Total Physical Memory 256.00 MB Available Physical Memory 55.75 MB Total Virtual Memory 2.00 GB Available Virtual Memory 1.95 GB Page File Space 2.23 GB Page File C:\pagefile.sys I use a shitty computer to program incase I screw somehting up. Quote Link to comment https://forums.phpfreaks.com/topic/68519-fopen-problem/#findComment-344538 Share on other sites More sharing options...
d22552000 Posted September 9, 2007 Author Share Posted September 9, 2007 Holy **** PLEASE HELP! Quote Link to comment https://forums.phpfreaks.com/topic/68519-fopen-problem/#findComment-344579 Share on other sites More sharing options...
Fadion Posted September 9, 2007 Share Posted September 9, 2007 Is your copy of windows genuine?? lool jk. No idea of your question(s). U have posted so much stuff that im confused. Quote Link to comment https://forums.phpfreaks.com/topic/68519-fopen-problem/#findComment-344600 Share on other sites More sharing options...
d22552000 Posted September 9, 2007 Author Share Posted September 9, 2007 lol ok my problem is that I get random errors hwen I try to fopen.. I am makingg a web server and it reads the file based on the persons request it adds res:///PHP/ before the filename and this scrwes up the whole request. WHY DOES FOPEN ADD RES:///PHP/ BEFORE THE FILE ENTRY? (PHP 4.4.4) Quote Link to comment https://forums.phpfreaks.com/topic/68519-fopen-problem/#findComment-344602 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.