failed to open stream: no suitable wrapper could be found

匿名 (未验证) 提交于 2019-12-03 02:20:02

问题:

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 implemented php files:

http://www.holidaysavers.ca/europe-destinations-canada.php

basically the php files i am importing from one website into another are identical , however they work on the original website but when i implement them into a new website it does not work anymore.

could you assist me in trying to get this resolved?

thank you

回答1:

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'); 


回答2:

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



回答3:

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!