ERROR Can't open remote URL!

Problems installing LinkMan?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

That's why you need to TEST the script before customizing it. Allow_url_fopen is enabled by default and any script that open remote URLs needs to have it enabled. Your host even lets you compile your own copy of PHP5 and enable this if they have it disabled:
http://wiki.dreamhost.com/Installing_PHP5
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
PHPnovice
Posts: 2
Joined: Mon Mar 24, 2008 3:23 am

Post by PHPnovice »

Please note my username.

I did test it! It worked FINE when I posted a link myself through my admin. Why would anyone--especially a PHP novice such as myself--assume that the system would falter when someone else tries to submit a link?

Your response does not address why you do not simply post a warning about allow_url_fopen on your site.

"Building my own version of PHP" is not a possibility.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Because the script works fine with the default PHP installation and if I wanted to include all the PHP features that are enabled by default and my scripts need and can be disabled in php.ini by the host I would have to keep a huge list.

BUT I appreciate feedback and I already took note of your comments, I will see if I can add a check in the admin panel to show a warning if the allow_url_fopen is disabled.

That's why the support forum is here :wink:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
thehun
Posts: 2
Joined: Tue Aug 19, 2008 5:06 am

LinkMan vs GoDaddy

Post by thehun »

Hi,

First of all thank you for the great script! Please let me describe my problem briefly:

I am trying to get your script to work on my website (URL: http://www.wrist-tattoo.com), but unfortunately even after reading everything here in this forum and several emails with GoDaddy it still doesn't work... Ok I am not a programmer, but I usually am able to set up scripts with a decent readme file and a forum...

The error message I right after signing in:

"Your hosting company doesn't permit PHP scripts to open URL addresses, because of this LinkMan will not work properly on this server (your visitors will not be able to add links to your link exchange)! To fix this issue contact your host and ask them to enable PHP setting allow_url_fopen for your website!"

The error when I want to change settings:

"Can't open file settings.php for writing, on Linux CHMOD it to 666 (rw-rw-rw-)!"

I sent this all with different screenshots to GoDaddy and I have received the following info:

"This (allow_url_fopen) PHP setting is enabled by default."

and

"Please note that this function would only work if you are pulling from a file that is uploaded to your account. If you are attempting to use this function with an external source, it would not work as intended.

I uploaded everything (except the update.php, as I had to delete that when I first accessed the linkman directory), and I cannot access the php.ini file (because it is a free hosting account or what..).

Do you have any idea what I should do, or what I should ask my host to do..? I would really appreciate any help!

For testing:

The form: http://www.wrist-tattoo.com/linkman/form.html
PHPinfo: http://www.wrist-tattoo.com/linkman/phpinfo.php

I would appreciate any help!!!
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Well from your phpinfo file I see that allow_url_fopen is turned Off (send them link to your phpinfo.php file). Contact GoDaddy and ask them to enable allow_url_fopen for you.

As for the other error ask GoDaddy to make sure php scripts have permission to write to linkinfo.txt file.

Maybe it would be a good idea if they move you from Windows to Linux server, from what I hear their Linux servers have a better PHP setup.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
thehun
Posts: 2
Joined: Tue Aug 19, 2008 5:06 am

LinkMan vs GoDaddy 2.

Post by thehun »

Hi Klemen,

So here is their answer from GoDaddy:

If allow_url_fopen is off in your account you can enable it by turning it on in a php.ini (???) file and uploading it to your hosting. (I didn't find a php.ini file uploaded already.. so I just create one and upload that?!)

As htaccess files will not function correctly under windows, if you need to modify permissions and cannot do so in IIS (???) you will need to switch to a Linux plan to use an htaccess file. (Could you please tell me what IIS is?)

So now what should I do?

Thanks again!

A
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Well I can't provide support for your hosting problems, but here are a few clues:

Try creating a text file, enter this inside:
allow_url_fopen On
Upload the file to your server in the main folder and rename it to php.ini

And for file permissions you can try it like this (it is for Hesk but it should be the same for LinkMan, just different file name):
viewtopic.php?t=1406
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
kontech
Posts: 7
Joined: Wed Aug 27, 2008 7:43 pm

Post by kontech »

puniksem wrote:
Klemen wrote:I was able to add punkisem.com to your exchange, but no external URLs. Although allow_url_fopen is On seems like your host is blocking PHP from opening remote URLs (maybe with a firewall?). Try asking your host why allow_url_fopen is enabled but you still can't open even simple requests lile

Code: Select all

$html = file_get_contents('http://www.google.com');
with PHP.
I've sent a request regarding this error and awaiting a reply, I will keep you informed of my results.
Hi,
It seems that I'm on the same boat. I'm with 1and1 shared hosting and they're not the easiest to work with.
url_fopen is On : http://s87620975.onlinehome.us/phpinfo.php
Here's my url: http://www.kontech.net/resources/links.php

Any thoughts are appreciated.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Try if this works (shows Google HTML code) or not (throws an error):

Code: Select all

<?php
$html = file_get_contents('http://www.google.com') or die('Can\'t open remote URL');
echo $html;
?>
Save into a text file (test.php) and upload to your server.

If it shows an error it's a PHP (or firewall?) problem and no one else but your host can help you with it.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
kontech
Posts: 7
Joined: Wed Aug 27, 2008 7:43 pm

Post by kontech »

Klemen wrote:Try if this works (shows Google HTML code) or not (throws an error):

Code: Select all

<?php
$html = file_get_contents('http://www.google.com') or die('Can\'t open remote URL');
echo $html;
?>
Save into a text file (test.php) and upload to your server.

If it shows an error it's a PHP (or firewall?) problem and no one else but your host can help you with it.
Hi,

I uploaded the file here: http://www.kontech.net/data-cabling.php
and I get the following error msg:

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /homepages/32/d87620957/htdocs/kontech/data-cabling.php on line 2

Warning: file_get_contents(http://www.google.com) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /homepages/32/d87620957/htdocs/kontech/data-cabling.php on line 2
Can't open remote URL

I'm not a developer but this sounds like hosting hosting company has disabled this feature. If that's the case I'll contact them again and reference this error, but 1and1 is a pain to work with.

Thank you for prompt response.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Yes, it's something your host has disabled. Unless the enable it for you I'm afraid you won't be able to use LinkMan or any other PHP script that tries to read URL addresses.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
kontech
Posts: 7
Joined: Wed Aug 27, 2008 7:43 pm

Post by kontech »

Hi,
After having waited for almost a week I received this response from 1and1:

Thank you for contacting us. Your problem lies in the fact that you are
using a php.ini file. You should be allowing url_fopen in an .htaccess
file. And the previous agent was mistaken by saying this is set to ON by
default. Only partly though because in PHP4, ON is the default. If users
decide to use PHP5 (in your case), the default is OFF.

Does this mean I have to allow url_fopen by adding this line to my .htaccess file: "php_value allow_url_fopen on" ?

Do I have to remove the php.ini file?

I'm not sure what they mean by saying that I use php ver 5 as I thought I was on php ver 4.4.9

http://s87620975.onlinehome.us/phpinfo.php

Thanks in advance
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Does this mean I have to allow url_fopen by adding this line to my .htaccess file: "php_value allow_url_fopen on" ?
Why not try it and see? :wink:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
kontech
Posts: 7
Joined: Wed Aug 27, 2008 7:43 pm

Post by kontech »

I did. getting interal server error 500 error messages.
I also learned that my site is running php ver 5.x and the "allow_url_fopen," is currently set to OFF
http://s87620975.onlinehome.us/kontech/info.php

I know noting about php, so perhaps I'm placing this line:
"php_value allow_url_fopen On" in a wrong place in .htaccess file
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Ah, it won't work with htaccess for PHP 5, it has to be changed either in php.ini or httpd.conf (source: http://www.php.net/manual/en/ini.php ). Seems like you will have to get back to your host again... :?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply