Jump to content


Photo

Fopen Issue In Php 5.1.4


  • Please log in to reply
2 replies to this topic

#1 sherife

sherife
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 28 June 2006 - 02:55 AM

I have a script that parses xml and it used to work in php 4.. Now my host upgraded
to php 5.1.4 and it always times out when it does a fopen ( see message below )

I looked in the php site for doc with little help.
do you know if there is another function that I can use instead of fopen or have any ideas what
I can do or where I can look?

Thank you much.


Warning: fopen( http://.....) [function.fopen]: failed to open stream: Connection timed out in /home/sw/public_html/functions/ParseXML.php on line 10


#2 Drumminxx

Drumminxx
  • Members
  • PipPipPip
  • Advanced Member
  • 92 posts
  • LocationUSA

Posted 28 June 2006 - 03:17 AM

if all your doing is parsing xml then you can use file_get_contents.

if your writing to xml then you'll need to use fopen.

as to the stream problem the file path is causing this. check if your php setting "allow_url_fopen" is off and if it is and you cannnot change the setting then try:

$_ENV['DOCUMENT_ROOT'] . 'path/ofmyfile.xml'

I just use file_get_contents though and it works everytime for parsing xml
:: gucci.com ::
:: blockbuster.com ::

--------------------

#3 sherife

sherife
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 28 June 2006 - 01:15 PM

Hi Drumminxx

Thank you for your response.

My setting for allow_url_fopen is On under local and master value.
I tried using file_get_contents and got the same timeout problem like with fopen.

Could there be another setting that I need to look at?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users