LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-26-2009, 03:08 AM   #1
anwar
Member
 
Registered: Aug 2005
Location: Philippines
Distribution: Slackware 11.0
Posts: 44

Rep: Reputation: 15
file_get_contents errors on CentOS 5.3


Hi, I got a freshly installed CentOS 5.3 box and I'm getting this error:

Code:
file_get_contents(http://www.google.com) [function.file-get-contents]: failed to open stream: HTTP request failed!
Do you guys have any idea what's causing this?
 
Old 06-26-2009, 10:51 PM   #2
pazzport
Member
 
Registered: Dec 2004
Posts: 47

Rep: Reputation: 16
1. I'm guessing you've tried the basics, i.e. you have a working network connection and you can ping www.google.com?

2. Where are you seeing this error? Is this in a log somewhere or in your browser? Can you post more details on your question. Thanks.
 
Old 06-27-2009, 08:26 PM   #3
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
Assuming you mean the PHP function file_get_contents(), you need to check your php.ini configuration for:

allow_url_fopen = On
allow_url_include = On

If they're set to "Off", change them. And after you make the change(s) restart Apache.
 
Old 06-28-2009, 10:05 PM   #4
anwar
Member
 
Registered: Aug 2005
Location: Philippines
Distribution: Slackware 11.0
Posts: 44

Original Poster
Rep: Reputation: 15
pazzport: yes i tried them. I tried wget-ting the file and I can get the file. Here's the error when I try it on the command line:

Code:
# php -r 'print_r(file_get_contents("http://mirror.facebook.net/centos/timestamp.txt"));'
PHP Warning:  file_get_contents(http://mirror.facebook.net/centos/timestamp.txt): failed to open stream: HTTP request failed!  in Command line code on line 1
sleddog: I followed your sintructions and it's still the same.
 
  


Reply

Tags
apache, centos, php



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
While centos bootup seems to have some errors ...how to stop the screen Elnegro8 Linux - Server 20 05-19-2011 11:39 PM
Errors with apache tomcat 6.0.18 on a centOS 5.2 Asagath Linux - Server 4 02-02-2009 11:11 AM
sipXecs errors with CentOS 5 sseeker Linux - Server 7 06-09-2008 10:31 AM
[centos] start/shutdown errors pcandpc Linux - Distributions 1 04-27-2007 09:55 AM
CentOS install errors on old machine larry_r Linux - General 2 01-24-2007 06:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration