TubePress: WordPress Plugin for YouTube Download & Import Videos

Aug
26
URL file-access is disabled in the server configuration
Posted by Mario Mansour in TubePress

It has came to my attention that some of you are having problems running TubePress.NET on their hosting servers.
If you are getting Warning Messages like this one
Warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration in /xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/wp-content/plugins/tubepress.net/tubepress.php on line 384
Where xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is the path to the wordpress installation on your server

This means that your server configuration is blocking external file access, which in consequence blocks TubePress from accessing Youtube.
Solution:
allow_url_fopen should be ON in PHP configuration (php.ini). Probably, you don’t have access to edit this file and it could also be that your hosting company has restricted changing the allow_url_fopen value. In this case, you should refer to them and ask them to set the value of allow_url_fopen to ON.

On my side, TubePress will try to change the value of allow_url_fopen but if this action is restricted, it will ask you to contact your web hosting provider.
Many users have been asking me to recommend a good hosting. To be honest none cheap web hosting provider is perfect, you have to make a compromise between budget and requirements. It is obvious that the more you require from your server the more you will need to pay and the more you disregard features the more your hosting bills will shrink.
Good web hosting companies that have affordable hosting plans are mediatemple, dreamhost, ThinkHost. I would also recommend you to have a dedicated server instead of a shared hosting, it gives more freedom and saves you some headaches.

20 Responses to “URL file-access is disabled in the server configuration”

  1. Gary Says:

    Thanks for the reply.

    It is not an option for me to use this – is there any adjustment that can be made to the code to allow compatibility with shared hosting, since many wordpress users utilize shared hosting?

  2. Mark RObertson Says:

    I added to my php.ini file and still not working.

  3. Mark RObertson Says:

    What about this problem that I am all of a sudden getting?

    Warning: Invalid argument supplied for foreach() in /home/content/s/e/o/seoreel/html/wp-content/plugins/tubepress.net/tubepress.php on line 441

  4. Venkadesan Tharshan Says:

    thanks

  5. Piyush Says:

    URL file-access is disabled in the server configuration
    how can i solve this problem without contacting to host provider

  6. cwxwwwxdfvwwxwx Says:

    well, hi admin adn people nice forum indeed. how’s life? hope it’s introduce branch ;)

  7. AssauraFer Says:

    crzammctrnnwmukvwell, hi admin adn people nice forum indeed. how’s life? hope it’s introduce branch ;)

  8. lymnMyncanaeX Says:

    archetypal buy cialis feigned

  9. Acuscuhtush Says:

    not counting cialis photoduplication

  10. Azmeer Says:

    usually you can have a local copy of the php.ini file with all the mods you need. This local copy gets priority from the web server (I believe).

  11. papsy Says:

    Assuming that cURL is enabled (which it usually is), you can easily get around that restriction by creating your own custom function to carry out the same actions. I’m not familiar with ‘TubePress’ or whatever it is that most of you are having issues with, but if you’re comfortable with PHP, you could do a simple replacement:

    Replace this:
    file_get_contents

    With this:
    curl_get_contents

    In all files/folders.

    Then create a file (with any name, extension .php, e.g. myinc.php), with the contents:

    Then in any file which originally made a call to file_get_contents, at the top, add:

    Although somewhat tedious (depending on how many replacements you’ll have to do, I have no idea, having never used the software) – it should work in most cases.

  12. papsy Says:

    I’m guessing the owner of this blog is using strip_tags() for security.

    Let’s try this:

    <?php
    /////////////////////////////////////////////
    // copyright (c) 2009 adam@papsy.net etc etc
    /////////////////////////////////////////////
    if (!defined("ch"))
    {
    function setupch()
    {
    $ch = curl_init();
    $c = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    return($ch);
    }

    define("ch", setupch());

    function curl_get_contents($url)
    {
    $c = curl_setopt(ch, CURLOPT_URL, $url);
    return(curl_exec(ch));
    }
    }
    ?>

  13. papsy Says:

    So to summarize:

    1) Replace all occurrences of file_get_contents with curl_get_contents
    2) Add the following code to the top of any file you made that replacement in:
    <?php
    require_once("myinc.php");
    ?>
    3) Create a new file (named myinc.php), with the contents being:
    <?php
    /////////////////////////////////////////////
    // copyright (c) 2009 adam@papsy.net etc etc
    /////////////////////////////////////////////
    if (!defined("ch"))
    {
    function setupch()
    {
    $ch = curl_init();
    $c = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    return($ch);
    }

    define("ch", setupch());

    function curl_get_contents($url)
    {
    $c = curl_setopt(ch, CURLOPT_URL, $url);
    return(curl_exec(ch));
    }
    }
    ?>

  14. Alexwebmaster Says:

    Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

  15. How to Get Six Pack Fast Says:

    I can tell that this is not the first time at all that you mention the topic. Why have you decided to touch it again?

  16. Paul Byers Says:

    Thank you papsy, that would have stumped me for days…

  17. koss Says:

    Thank you very much! It was very use full inforamtion!

  18. samiemathews82 Says:

    this sucks i had the same error but with another service. I was hoping to find a solution here but the php stuff i dont really understand that well. Im still in search of a simple solution to this.

  19. srowens Says:

    @samiemathews82: papsy’s response #13 is the simple solution.

    Some servers have allow_url_include disabled for better security. Starting with PHP 5.2.X allow_url_include is disabled by default. So you only two easy solutions are to:

    1. Convince your web host to turn allow_url_fopen and allow_url_include on. Unlikely but they might do it.

    2. Use CURL. papsy’s response #13 is really the easiest way to do this.

  20. Jules Says:

    It’s much easier to use the built in WordPress HTTP API:

    $url = ‘http://www.example.com/file.cfm’;
    $request = new WP_Http;
    $result = $request->request( $url );
    echo $result['body'];

Leave a Reply

You must be logged in to post a comment.