473,394 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

PHP: FOPEN issue

Hello there,
WEIRD...fopen couldn't open any http file while it's working fine with any local file.
I've tried the following:
__________________________________________________ ______
1.
Expand|Select|Wrap|Line Numbers
  1. $fp = fopen("D:\Software\\test.txt","r"); 
  2. while($data = fgets($fp, 400)) 
  3. echo $data; 
  4. #--> Result OK 
  5.  
2.
Expand|Select|Wrap|Line Numbers
  1. $fp = fopen("http://www.google.fr","r"); 
  2. while($data = fgets($fp, 400)) 
  3. echo $data; 
  4. #--> Result: Warning: fopen() [function.fopen]: php_network_getaddresses: gethostbyname failed in C:\wamp\www\hotelGlobe\hotels_list4.php on line 4 
  5.  
  6. # Warning: fopen(http://www.google.fr) [function.fopen]: failed to open stream: No error in C:\wamp\www\hotelGlobe\hotels_list4.php on line 4
  7.  
__________________________________________________ _____________

P.S: I've tried with PHP4 and PHP5 but in vain.Same result with file_get_contents().
Please advise.
Thx in advance!
Configuration: Windows XP
Internet Explorer 6.0
Sep 27 '07 #1
2 2359
Atli
5,058 Expert 4TB
Hi Giorgio. Welcome to The Scripts!

If you want to use fopen() to open an URL, the 'allow_fopen_url' directive of the php.ini configuration must be enabled. This can not be set using ini_set() for security reasons.
Sep 27 '07 #2
Hi Atli,
Thanks for ur reply.
This is 2 inform u that 'allow_fopen_url' is already set to enabled.
I'm wondering if the cause comes from my proxy settings.
How can I check it ?
Any clues?

BRs,
Sep 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: paul brown | last post by:
Hi, I'm running Apache 1.3.29 and PHP 4.2.3 on Windows XP Pro. I built a page that runs phpinfo() and it works. The location of the php.ini is what I expect it to be, c:\winnt. But the values...
2
by: John C | last post by:
Hello all, First off thanks for reading this... The following code works fine on my redhat linux box at home, however it does not work when running on my webhost, whose server is also apache....
5
by: Chung Leong | last post by:
We're looking for a simple open source bug-tracking software. Any suggestion?
4
by: Brent | last post by:
I am having a problem with the coding of my website and I am very inexperienced with PHP. When using my web browser to go to my site. I notice that none of my images are appearing and any link that...
3
by: BPG | last post by:
Hi There, I'm running into a little problem using "file_get_contents". When i try to open a page just using my browser i can see the consents of the page, however, when i try to open this same...
1
omerbutt
by: omerbutt | last post by:
hi there i am new to php ,have been working in asp classic and access but now have switched to php and mysql,and for the practice sake i started to convert my asp and access based projects into php...
1
by: vagabond | last post by:
hello all i know this as been posted a billion times but I don't seem to have the same issue as every one else. running mysql server 5.0.19 running iis6.0 on windows server environment installed...
2
by: Harmony504 | last post by:
I am trying to connect to our DB2 DB with PHP using ADOdb. Below is my environment. Windows XP PHP 5.2.5 DB2 Run-Time Client 8.2 IIS I connect with the following code: ...
7
by: Virendra Maloo | last post by:
I have developed an (PHP)application which has been tested on different development servers. So when I login to the app and navigate to a specific page just after loggin-in, the app logs-out and I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.