Error file_get_contents()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Error file_get_contents()

Postby kapil1089theking » Fri Dec 11, 2009 2:59 pm

This is the error

Notice: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\wamp\www\paisa\web extractor.php on line 4

Warning: file_get_contents(https://mobile.bet365.com/wap?task=upda ... w!&login=F) [function.file-get-contents]: failed to open stream: No error in C:\wamp\www\paisa\web extractor.php on line 4
not found

I am using WampServer Version 2.0 with PHP Version 5.2.9-2
kapil1089theking
Forum Commoner
 
Posts: 46
Joined: Wed May 28, 2008 1:51 pm
Location: Kolkata, India

Re: Error file_get_contents()

Postby pickle » Fri Dec 11, 2009 3:35 pm

The errors are pretty self explanatory. Searching for them in Google usually gives good results.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
pickle
Briney Mod
 
Posts: 6432
Joined: Mon Jan 19, 2004 7:11 pm
Location: 53.01N x 112.48W

Re: Error file_get_contents()

Postby McInfo » Fri Dec 11, 2009 3:41 pm

Find this line in your php.ini:
Syntax: [ Download ] [ Hide ]
;extension=php_openssl.dll

Change it to
Syntax: [ Download ] [ Hide ]
extension=php_openssl.dll

(Remove the semicolon.)

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 3:37 pm, edited 1 time in total.
User avatar
McInfo
DevNet Resident
 
Posts: 1531
Joined: Wed Apr 01, 2009 1:31 pm

Re: Error file_get_contents()

Postby kapil1089theking » Fri Dec 11, 2009 3:47 pm

No I have wiped the semicolon and then Wamp exited then I started the wamp nothing change in the error,

Then I put a @before the function it worked but the problem is now the contents are not coming to my variable now the simple code is:

<?php
$url = 'https://www.google.com';
$contents = @file_get_contents($url) or die ("ERROR");
echo $contents;
?>

its printing nothig. Any help is appreciated//
kapil1089theking
Forum Commoner
 
Posts: 46
Joined: Wed May 28, 2008 1:51 pm
Location: Kolkata, India

Re: Error file_get_contents()

Postby McInfo » Fri Dec 11, 2009 4:11 pm

Make sure you are editing the correct php.ini file. Go to http://localhost/?phpinfo=1 and search the page for "Loaded Configuration File". Also search the page for "openssl" to confirm that OpenSSL is enabled.

Do not use the error control operator (@) when debugging. It hides errors from you. Just because you don't see an error doesn't mean that the script "worked".

Edit: This post was recovered from search engine cache.
User avatar
McInfo
DevNet Resident
 
Posts: 1531
Joined: Wed Apr 01, 2009 1:31 pm


Return to PHP - Code

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests