服务器中禁用了http://包装器?

编程入门 行业动态 更新时间:2024-10-12 05:51:02
本文介绍了服务器中禁用了包装器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

错误消息:

Warning: include(): wrapper is disabled in the server configuration by allow_url_include=0 in C:\xampp\htdocs\ubergallery\multiple_image_upload\multiupload.php on line 27 Warning: include(localhost/ubergallery/multiple_image_upload/upload.php): failed to open stream: no suitable wrapper could be found in C:\xampp\htdocs\ubergallery\multiple_image_upload\multiupload.php on line 27 Warning: include(): Failed opening 'localhost/ubergallery/multiple_image_upload/upload.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\ubergallery\multiple_image_upload\multiupload.php on line 27

我收到此错误消息.

包含样式表或带有绝对路径的jquery文件确实可以解决问题,为此,我希望包含带有绝对路径的PHP脚本.

Including a stylesheet or a jquery file with the absolute path does work out, with this I was looking to include a PHP script with the absolute path.

这是代码:

<!DOCTYPE html> <html> <head> <title>Upload Multiple Images Using jquery and PHP</title> <!-------Including jQuery from google------> <script src="ajax.googleapis/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="script.js"></script> <!-------Including CSS File------> <link rel="stylesheet" type="text/css" href="style.css"> <body> <div id="maindiv"> <div id="formdiv"> <h2>Multiple Image Upload Form</h2> <form enctype="multipart/form-data" action="" method="post"> First Field is Compulsory. Only JPEG,PNG,JPG Type Image Uploaded. Image Size Should Be Less Than 100KB. <hr/> <div id="filediv"><input name="file[]" type="file" id="file"/></div><br/> <input type="button" id="add_more" class="upload" value="Add More Files"/> <input type="submit" value="Upload File" name="submit" id="upload" class="upload"/> </form> <br/> <br/> <!-------Including PHP Script here------> <?php include("localhost/ubergallery/multiple_image_upload/upload.php"); ?> </div> <!-- Right side div --> <div id="formget"><a href=www.formget/app><img src="formget.jpg" alt="Online Form Builder"/></a> </div> </div> </body> </html>

我一直希望在绝对路径中包含"upload.php".

I was looking to include "upload.php" with the absolute path.

当我将"allow_url_include"设置为开"时,我仍然会收到相同的错误消息.另外,我不确定这是否是开始的问题.

When I turn "allow_url_include" to "On" then I still get the same error message. Also I was not sure if that was the issue to begin with.

任何建议在这里做什么?

Any suggestions what to do here?

推荐答案

来自 PHP文档在include :

如果在PHP中启用了"URL包含包装器",则可以使用URL(通过HTTP或其他受支持的包装器-参见受支持的协议和包装器"以获取协议列表)来指定要包含的文件,而不是本地路径名.如果目标服务器将目标文件解释为PHP代码,则可以使用与HTTP GET一起使用的URL请求字符串将变量传递到包含的文件中.从严格意义上讲,这与包括文件并让其继承父文件的变量作用域不同;该脚本实际上正在远程服务器上运行,然后将结果包含在本地脚本中.

If "URL include wrappers" are enabled in PHP, you can specify the file to be included using a URL (via HTTP or other supported wrapper - see Supported Protocols and Wrappers for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.

通过明显的推断,您应该使用本地路径名!

By obvious inference, you are supposed to use a local pathname!

更改此行

<?php include("localhost/ubergallery/multiple_image_upload/upload.php"); ?>

对此

<?php include($_SERVER['DOCUMENT_ROOT']."/ubergallery/multiple_image_upload/upload.php"); ?>

allow_url_include=On不起作用的原因是因为您可能没有在更改php.ini

The reason that allow_url_include=On doesn't work is because you probably didn't restart your Apache server after changing your php.ini

更多推荐

服务器中禁用了http://包装器?

本文发布于:2023-07-14 10:24:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1104101.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:器中   http

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!