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

Post Reply
kapil1089theking
Forum Commoner
Posts: 46
Joined: Wed May 28, 2008 1:51 pm
Location: Kolkata, India
Contact:

Error file_get_contents()

Post by kapil1089theking »

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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Error file_get_contents()

Post by pickle »

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
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Error file_get_contents()

Post by McInfo »

Find this line in your php.ini:

Code: Select all

;extension=php_openssl.dll
Change it to

Code: Select all

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.
kapil1089theking
Forum Commoner
Posts: 46
Joined: Wed May 28, 2008 1:51 pm
Location: Kolkata, India
Contact:

Re: Error file_get_contents()

Post by kapil1089theking »

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//
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Error file_get_contents()

Post by McInfo »

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.
Post Reply