failed to open stream: no suitable wrapper could be found

后端 未结 4 1307
没有蜡笔的小新
没有蜡笔的小新 2021-01-01 16:33

hello i am implementing php files from one website into another and here is the following error message i am getting when trying to open the following page with implemente

相关标签:
4条回答
  • 2021-01-01 16:35
    Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/content/91/8151691/html/HolidaySavers.ca/europe-destinations-canada.php on line 52
    

    says it all. I believe this is called XXS. It appears you're attempting to include a URL based file which is denied in your server configuration which is either one of two things.

    1. You're attempting to include the file on site B from site A which you would then use instead of include('WhateverFile'); file_get_contents('WhateverFile'); however this will only return the client side data as it is an HTTP request;

    2. You've duplicated the file on site B and forgot to update the domain configuration. Be sure that the include path reflects the site you're running the script on ie.

      include(dir($_SERVER['SCRIPT_FILENAME']) . DIRECTORY_SEPARATOR . 'WhateverFile.php');
      

    In any case. I would have to actually examine the line 52 on the said file to see why PHP is complaining to you in detail lol

    0 讨论(0)
  • 2021-01-01 16:42

    You can't include a PHP script that is on an external website/server into your local script - unless you enable allow_url_include on your php.ini (if you have access to it)

    Instead, you can let that website/server render the page and get the resulting html output on your local script.

    Replace this line in your script:

    include('http://www.holidaysavers.ca/europe-canada.php?detour');
    

    With this:

    echo file_get_contents('http://www.holidaysavers.ca/europe-canada.php?detour');
    
    0 讨论(0)
  • 2021-01-01 16:47

    I don't really know what kind of host you are using or if you are using Xampp, I do have an easy fix to it, for xampp and possibly other web server software. Go to your php.ini file, which you can search for or just look for it in c:\\xampp\php\php.ini, the php.ini should be in the php folder in the server software folder. Now search for allow_url_include in the php.ini file and than replace Off with On, if it isn't already on or something. This is most likely the fix because it worked for me.

    I might be able to help further if I know if you are using a hosting or home server. If you are using a hosting website than please share what kind of hosting service you are using so I could inspect it further.

    0 讨论(0)
  • 2021-01-01 16:58

    Could you post the code from "europe-destinations-canada.php"? It looks like the script is asking to do stuff that's not configured in your php setup on this new site/server

    0 讨论(0)
提交回复
热议问题