Re: [PHP] Re: fopen never ends?

2008-02-19 Thread Paul van Brouwershaven
The timeout is not the problem, the probleem is I'm not getting the ssl (like the peer cert) info into the stream_context_get_options Jim Lucas wrote: Paul van Brouwershaven wrote: Nathan Rixham wrote: I don't think this is a php problem, just load the url up in a browser and you'll see the s

Re: [PHP] Re: fopen never ends?

2008-02-19 Thread Jim Lucas
Paul van Brouwershaven wrote: Nathan Rixham wrote: I don't think this is a php problem, just load the url up in a browser and you'll see the same, appears to be a misconfigured server at the otherside - probably confused about not being passed a name based "host" header in the request. I know

Re: [PHP] Re: fopen never ends?

2008-02-19 Thread Richard Lynch
On Tue, February 19, 2008 5:49 pm, Chris wrote: > >>> Perhaps concider moving to fsockopen or stream_socket_client with >>> timeout parameters to solve your issue. >> >> fsockopen has no context > > Maybe I'm missing something but it returns a resource just like fopen. > > http://php.net/fsockopen

Re: [PHP] Re: fopen never ends?

2008-02-19 Thread Chris
Perhaps concider moving to fsockopen or stream_socket_client with timeout parameters to solve your issue. fsockopen has no context Maybe I'm missing something but it returns a resource just like fopen. http://php.net/fsockopen -- Postgresql & php tutorials http://www.designmagick.com/ --

[PHP] Re: fopen never ends?

2008-02-19 Thread Paul van Brouwershaven
Nathan Rixham wrote: I don't think this is a php problem, just load the url up in a browser and you'll see the same, appears to be a misconfigured server at the otherside - probably confused about not being passed a name based "host" header in the request. I know that my browser is also waiting

[PHP] Re: fopen never ends?

2008-02-19 Thread Nathan Rixham
Paul van Brouwershaven wrote: When you run the folling script, it will never ends? I have seen this more then once, I know that there is no service running at the target host, but why is the script not printing the failed message? It's only with a few ip-number I have this problem. if ($fp =

Re: [PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-30 Thread Richard Lynch
If it's a busy server, you may be running out of TCP connections... If PHP can't open ANY connection at all, it can't do a DNS lookup, and it would fail very fast, as it's hitting an OS limit/cap on the number of connections and not even getting to try to talk to the Internet. On Fri, December 28

Re: [PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-30 Thread Richard Lynch
DNS records are failing to lookup the domain name for you... Maybe just put the URL back into a queue to try later. You should also toy with nslookup or dig from the command line and see if you can get it to fail as often. On Thu, December 27, 2007 12:00 pm, Albert Wiersch wrote: > > Some additi

[PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-29 Thread Albert Wiersch
""Dan"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > You really need to filter your input more, have a list of what is > acceptable not what is unacceptable. That being, make it a requirement > that the url input has a TDL(.com, .net, .org, etc.) or is a valid IP(ping > it)

[PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-28 Thread Dan
""Albert Wiersch"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I noticed my script at http://onlinewebcheck.com was sometimes (fairly often) failing to open some URLs that users have entered. fopen() returns false very quickly, but when tried again with the same URL, sometimes

Re: [PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-28 Thread Albert Wiersch
"Wolf" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > DNS issues I think I've solved this. I found a problem with resolv.conf that contained some outdated DNS servers. After changing that and rebooting the server it seems to be working. It didn't seem to work after just changing

Re: [PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-28 Thread Wolf
DNS issues Albert Wiersch wrote: > I'm now using PHP 5.2.5. > > Well, it seems to still be happening. This describes the problem but I > haven't found a solution that works for me yet: > http://bugs.php.net/bug.php?id=11058 > > Is it a PHP problem or DNS? It works sometimes but not other times.

[PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-28 Thread Albert Wiersch
I'm now using PHP 5.2.5. Well, it seems to still be happening. This describes the problem but I haven't found a solution that works for me yet: http://bugs.php.net/bug.php?id=11058 Is it a PHP problem or DNS? It works sometimes but not other times.. something strange is going on. Example m

Re: [PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-27 Thread Albert Wiersch
""Albert Wiersch"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Yes, I have SSH access. I will keep that in mind. Upgrading to 5.2.5 may > have addressed this issue though. If not, then I'll concentrate on a > possible DNS resolution problem. Well, it seems to still be happe

Re: [PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-27 Thread Albert Wiersch
""Daniel Brown"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >That sounds like a DNS resolution error. If you have Telnet/SSH > or local console access, try doing a dig, traceroute, and ping series > on it. Hi Daniel, Yes, I have SSH access. I will keep that in mind. Upgr

Re: [PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-27 Thread Daniel Brown
On Dec 27, 2007 1:00 PM, Albert Wiersch <[EMAIL PROTECTED]> wrote: > > Some additional info. It seems I am getting these warnings when it fails: > > Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo > failed: Name or service not known That sounds like a DNS resolution er

[PHP] Re: fopen() for http:// sometimes working, sometimes not

2007-12-27 Thread Albert Wiersch
Some additional info. It seems I am getting these warnings when it fails: Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known Warning: fopen(http://wanganda2u.co.uk) [function.fopen]: failed to open stream: Now I have to find out why that

[PHP] Re: fopen: space character in filename

2006-07-28 Thread Jo�o C�ndido de Souza Neto
Did you read this? http://br.php.net/manual/en/function.fopen.php ""Christian Calloway"" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] > Hello all, > > this seems like an easy question, but I could sure as hell couldn't find > any responces to it through initial searched. I am

[PHP] Re: fopen failing, permission denied

2006-03-01 Thread Dan Baker
(SOLVED, see below) "Dan Baker" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Chris" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Dan Baker wrote: >>> I have the following code snippet: >>> $h = fopen("$path/file.txt", 'x+'); >>> >>> And it generates the foll

[PHP] Re: fopen failing, permission denied

2006-03-01 Thread Dan Baker
"Chris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dan Baker wrote: >> I have the following code snippet: >> $h = fopen("$path/file.txt", 'x+'); >> >> And it generates the following error: >> Warning: fopen(/home/./myarea/file.txt): failed to open stream: >> Permission deni

[PHP] Re: fopen

2005-10-26 Thread Petr Smith
Hi, yes, there could be some problem with your code. But it depends on what are you trying to archieve. If you are trying to put whole file to database, there is no reason to use fgets function. Just use $buffer=file_get_contents($filename); and put the buffer into SQL. No reason to read it

[PHP] Re: fopen for http://

2005-05-27 Thread Peter Brodersen
On Fri, 27 May 2005 13:57:12 -0500, in php.general [EMAIL PROTECTED] (Jay Paulson) wrote: >For example, in my Apache httpd.conf file I have it set up to where I >have a directory that is only accessible from certain IP addresses, one >of which is 127. (the localhost). The script I'm running is

[PHP] Re: fopen problems

2005-03-24 Thread Jason Barnett
AJ Lemke wrote: > Hello all, > > I have an install of php on a Red Hat Ent. server that is giving me fits. > I have been trying to use the fopen command to retreive files from external > sites and have been getting this error: > > Warning: fopen(http://us3.php.net/images/php.gif): failed to open st

Re: [PHP] Re: fopen

2005-03-22 Thread Richard Lynch
On Mon, March 21, 2005 9:29 pm, John Taylor-Johnston said: >> > flock($results, 2); #lock file for writing >> > fwrite($results, $filestr); #write $filestr to $results >> > flock($results, 3); #unlock file >> > fclose($results); #close file >> This is an incorrect way to try to flock a file fo

Re: [PHP] Re: fopen

2005-03-21 Thread John Taylor-Johnston
Richard, thanks. > > chmod($defaultfile, 666); > http://php.net/chmod > has examples that tell you exactly why this is wrong... > The 666 you want is Octal. chmod($defaultfile, 0666); Check. Thanks. Didn't pay enough attention to that. > > What does the at_sign mean at the start of this line? >

Re: [PHP] Re: fopen

2005-03-21 Thread John Taylor-Johnston
Thanks for that! John Richard Lynch wrote: > On Sat, March 19, 2005 6:48 am, John Taylor-Johnston said: > > chmod($defaultfile, 666); > > http://php.net/chmod > > has examples that tell you exactly why this is wrong... > > 666 is decimal. > > The 666 you want is Octal. > > They ain't the same nu

Re: [PHP] Re: fopen

2005-03-21 Thread Richard Lynch
On Sat, March 19, 2005 6:48 am, John Taylor-Johnston said: > chmod($defaultfile, 666); http://php.net/chmod has examples that tell you exactly why this is wrong... 666 is decimal. The 666 you want is Octal. They ain't the same number. > What does the at_sign mean at the start of this lin

Re: [PHP] Re: fopen

2005-03-19 Thread John Taylor-Johnston
Hi, W+ does not work either. I have resorted to adding a blank, 0 byte text file. But it needs chmod 666. Interesting, I add this line: chmod($defaultfile, 666); and it send back an illegal error, but it appears to work anyway - the data is written! What does the at_sign mean at the start of t

Re: [PHP] Re: fopen

2005-03-18 Thread Christopher Evans
try $results = fopen($datafilename, "w+"); I am newbie at php so that may not work. -- --chris 1-916-501-1423 http://bbx.flnet.org/nxdos/";>http://bbx.flnet.org/nxdos/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: fopen

2005-03-18 Thread John Taylor-Johnston
I could use: or die($php_errormsg); but it is turned off in my php.ini and I can't modify it myself. John > FOpen question. My script is dying. "Our results file could not be opened for > writing" > > What can I add to get more info from the die? > > $defaultfile = "ffmail.txt"; #default file

[PHP] Re: fopen

2005-03-18 Thread John Taylor-Johnston
P.S., I've checked the doc and tried "a+". It still does not create ffmail.txt. @ $results = fopen($datafilename, "a+"); # Open for reading and writing; place the file pointer at the end of the file. #If the file does not exist, attempt to create it It does not create it. John > FOpen question

Re: [PHP] Re: FOPEN

2005-02-19 Thread Rasmus Lerdorf
Al wrote: Diana Castillo wrote: How can I read the contents of a web page that uses basic authentication? I want to use fopen() but dont know how to do this and also send the username and password If the webpage is your script and it is going to check the authentication stuff, then simply us

[PHP] Re: FOPEN

2005-02-19 Thread Al
Diana Castillo wrote: How can I read the contents of a web page that uses basic authentication? I want to use fopen() but dont know how to do this and also send the username and password If the webpage is your script and it is going to check the authentication stuff, then simply use GET argu

[PHP] Re: fopen errors

2004-02-18 Thread Paul Furman
Admin wrote: Here is the code I am using: $fileHandle = fopen($fileUpload, "r"); $fileContent = fread($fileHandle, $fileUpload_size); $fileContent = addslashes($fileContent); Warning: fopen("C:\\0-temp\\100_0078.jpg", "r") -No such file or directory in /var/www/testbed/httpdocs/blob/grabfile.p

[PHP] Re: fopen does not open URL-files

2003-12-20 Thread Taras V. Panchenko
I tried, but I receive the new error: Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/manageme/public_html/try-test/fopen-test-http.php on line 7 Warning: fopen(http://www.management.kiev.ua/MO/main.php/): failed to open stream: Permission denie

[PHP] Re: fopen does not open URL-files

2003-12-18 Thread Eric Bolikowski
"Taras Panchenko" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have 2 questions: > 1) why gethostbyname() does not resolve my host name into IP? > 2) why fopen() (and file()) does not open an external (URL) file via http? > Please, see my example below: > -- > ht

[PHP] Re: fopen >> custom 404 issue

2003-12-10 Thread Justin Patrin
Mike D wrote: I am trying to read in a particular page to a variable. How do you handle if the page is a 404 and then redirects to a custom error page? Am I supposed to use fsockopen and read headers or ?? Ideally I need to pull the end-result page to search for a string in it. Here's the code $ha

[PHP] Re: fopen

2003-03-16 Thread Coert Metz
Hi If i'm reading your code in the right way, i think you can better use the file_exists function available in php Read the manual at: http://www.php.net/manual/nl/function.file-exists.php Many success Coert Metz Sebastian wrote: hello, i have this snippet of code, from what i can tell it works

Re: [PHP] Re: fopen/fgets

2003-03-07 Thread Bryan Koschmann - GKT
Thanks.. I feel stupid, I wasn't paying attention. *sigh* seems to work now :) Bryan On Fri, 7 Mar 2003, Adrian Ciutureanu wrote: |you close the input file in while loop ( fclose($fp); ) | |"Bryan Koschmann - Gkt" <[EMAIL PROTECTED]> wrote in message |news:[EMAIL PROTECTED] |> Can someon

[PHP] Re: fopen/fgets

2003-03-06 Thread Adrian Ciutureanu
you close the input file in while loop ( fclose($fp); ) "Bryan Koschmann - Gkt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Can someone give me a hand here? I am really lost as to what is going on. > I have a file that looks like this > > user1,Store 1 - ABC street > user2,Store

[PHP] Re: fopen

2003-03-05 Thread John Taylor-Johnston
Mat>To get data out of the file that you Mat>have opened, you will need to read() it n. Mat>http://www.php.net/manual/en/function.fread.php Ok, how about this? What about error checking if the file contains something as I include below? Is that enough? $contents";} else{echo "no contents there";

[PHP] Re: fopen

2003-03-05 Thread KK
the @ before the fopen just tells php to suppress the error message if it can't open the file. that's all it does. "John Taylor-Johnston" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > #http://www.php.net/manual/en/function.fopen.php > > $contents = fopen ("/home/pathto/file.txt", "

[PHP] Re: fOpen in append mode on a FTP Server

2002-12-30 Thread Elna Moorhouse
To see the error in action go to http://www.moorhouse.co.za/test.php Please help! Thanks "Elna Moorhouse" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What I want to do is very simple, I have a txt file on a ftp server, that contains the number of visit

[PHP] Re: fopen()

2002-09-19 Thread Jason Morehouse
Yup! On Thu, 19 Sep 2002 16:43:48 -0700, Donahue Ben wrote: > I have a php script that tries to write files in a > particular directory. When the script writes files > the ownership is "apache". The problem I have is the > particular directory that the script is trying to > create files in, it

[PHP] Re: fopen() and flock()

2002-09-02 Thread nicos
Hi, You should use a while(!feof) syntax so that can verify that the file is not empty. You should also use $text = implode("",@file($filename)); Thats the easiest way to read a file. It will put each lines into an array and you will just implode it into a variable -- Merci de nous avoi

[PHP] Re: fopen(http:...) problems

2002-08-19 Thread php
Why don't you try chmoding the file 777. Next use readfile: http://www.php.net/manual/en/function.readfile.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: fopen and sort by date modified

2002-08-14 Thread lallous
checkout: opendir() readdir() fstat() closedir() Elias "Electroteque" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hi there i was wondering how i could fopen a directory and then sort the > files by date modified is there a way ? > > -- PHP General Mail

[PHP] Re: Fopen errors out when opening a URL

2002-07-18 Thread Richard Lynch
>I am trying to do a simple fopen("http://www.weather.com/index.html";, "r"); >For some reason I cannot Open any URL's after trying several. > >I get the following error > >Warning: stat failed for Resource id #1 (errno=2 - No such file or >directory) It's possible that weather.com is sending c

[PHP] Re: fopen "r+" not working - how to add to beginning of txt file

2001-11-21 Thread Richard Lynch
Brian Tully wrote: > i've been going crazy trying to figure out how to add news items to the > top of an already existing txt file containng previous news posts. While > I'd love to change the system so everything is database-driven (as most of > the rest of the site is), this news area has so mu

[PHP] Re: fopen for ftp transfers

2001-10-29 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Scott) wrote: > I am attempting to transfer files from one server to another via ftp. I > am wondering if this is the best method to transfer files within PHP or > should I seek other methods. Here is the way I am doing it now: > > $sendfile

[PHP] Re: fopen !!!

2001-10-02 Thread Richard Lynch
If you are worried about this, you should probably use a database which will take care of this for you... It is possible to use http://php.net/flock to lock the file, pretty much like the example in the manual, and then 4999 users will have to wait until the one editor is finished... You'll stil

[PHP] Re: fopen

2001-09-30 Thread Kmarada
I read the manual but i still don't know how to use flock do you have an exemple? flock works on windows2000 ? Martin <[EMAIL PROTECTED]> escreveu nas notícias de mensagem:[EMAIL PROTECTED] > Kmarada schrieb: > > > is it possible to use fopen to open 5000 files differents simultaneous and > > edi

[PHP] Re: fopen

2001-09-30 Thread Martin
Kmarada schrieb: > is it possible to use fopen to open 5000 files differents simultaneous and > edit it simultaneous ? I think, this depends how many files your operating-system can handle. > i have one file. if four user edit it simultaneous what happen? there is > something to lock the file u

Re: [PHP] Re: fopen, fread

2001-09-22 Thread Philip Olson
Yeah, filesize() does not work with urls. Suggested file() and implode() earlier for this task and didn't mention fgets() as it may be appropriate here as well. http://www.php.net/fgets http://www.php.net/file Both manual entries have examples that do exactly what you want, "Put a url conte

[PHP] Re: FOPEN remote problems..

2001-09-17 Thread _lallous
I tried to get it via CURL but i failed, here's the output: * Connected to www.800.com (216.88.211.1) > GET /prod.asp?P=5261 HTTP/1.1 User-Agent: curl/7.8 (win32) libcurl 7.8 Host: www.800.com Pragma: no-cache Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* * Closing live connecti

Re: [PHP] Re: fopen a URL with = in it

2001-08-05 Thread Corey Chapman
L PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Friday, August 03, 2001 10:19 PM > Subject: Re: [PHP] Re: fopen a URL with = in it > > > > So you're saying that I should be able to pass the = sign in just fine > > into the fopen call with no errors? I understan

Re: [PHP] Re: fopen a URL with = in it

2001-08-03 Thread Corey Chapman
So you're saying that I should be able to pass the = sign in just fine into the fopen call with no errors? I understand what you mean that if = was what the variable was defined as, then THAT is where I'd use urlencode ;) I wasn't too sure about that, but now I am. Quite odd that it reports er

[PHP] Re: fopen(fd, "w") doesn't work?

2001-08-01 Thread Keith Jeffery
for the first part, make sure that you have write permission to the directory specified, and for the second, you can't open a file for writing from a remote location. Keith Jeffery [EMAIL PROTECTED] "Ibrahim Noor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

[PHP] Re: fopen not opening url

2001-07-31 Thread Richard Lynch
Their CGI *MIGHT* be checking all sorts of things and determining that you are not a real browser and denying access... -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little