Am trying to access a text file from one apache server to a other but i get following error

Warning: file_get_contents(http://popx.mplayer.biz:7999/web-cronjobs/data/updates/updates_today.txt) [function.file-get-contents]: failed to open stream: Connection refused in /home/mplayerb/public_html/index.html on line 227

but yet i can access the file just fine by typing url into my browser

<?php $updates_file = 'http://popx.mplayer.biz:7999/web-cronjobs/data/updates/updates_today.txt'; ?>

i added the popx.mplayer.biz to my host file on my 2nd apache server were am getting file from but i still get connection refused can anyone help me solve this please thanks alot.

Recommended Answers

All 7 Replies

Member Avatar for iamthwee

The link doesn't exist?

i think thats just Daniweb messing the click url up copy the url as text it should work

Member Avatar for iamthwee

i try to but it just keeps loading, been waiting five mins?

loads up for me with no wait time

Create a new PHP file and upload to the server where you are running the script above.

    <?php

        echo (ini_get('allow_url_fopen')? 'It is On' : 'It is off');

Direct your browser to this file. It should print "It is On" or "It is off".

It is On ? your PHP.ini file is good. You need to focus on troubleshooting your script.

It is Off ? Set allow_url_fopen directives to on . This can be done by editing the php.ini file.

If your Server API is apache module, you can set it to on by adding this on your .htaccess file in the root directory.

    php_value allow_url_fopen On

If it is a fast CGI or any derivatives of CGI, you can pretty much create a new file called php.ini file and upload it to the directory where your script is running.

    allow_url_fopen = On;

SECURITY WARNING!
Sometimes allow_url_fopen directives creates a security issues, when set to on. I strongly suggests to use cURL instead.

ok yes iamthwee i see now there a DNS issue i will fix this and get back to you give me few mins

i dont have php installed on my solaris server I will install it and see what happens

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.