php – http://在服务器中禁用包装器?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了php – http://在服务器中禁用包装器?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2992字,纯文字阅读大概需要5分钟。
内容图文
错误消息:
Warning: include(): http:// 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(http://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 'http://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脚本.
这是代码:
<!DOCTYPE html>
<html>
<head>
<title>Upload Multiple Images Using jquery and PHP</title>
<!-------Including jQuery from google------>
<script src="http://ajax.googleapis.com/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("http://localhost/ubergallery/multiple_image_upload/upload.php"); ?>
</div>
<!-- Right side div -->
<div id="formget"><a href=http://www.formget.com/app><img src="formget.jpg" alt="Online Form Builder"/></a>
</div>
</div>
</body>
</html>
我希望用绝对路径包含“upload.php”.
当我将“allow_url_include”变为“On”时,我仍然会收到相同的错误消息.此外,我不确定这是否是问题的开始.
有什么建议在这做什么?
解决方法:
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.
通过明显的推断,你应该使用本地路径名!
改变这一行
<?php include("http://localhost/ubergallery/multiple_image_upload/upload.php"); ?>
对此
<?php include($_SERVER['DOCUMENT_ROOT']."/ubergallery/multiple_image_upload/upload.php"); ?>
allow_url_include = On的原因不起作用是因为您可能在更改php.ini后没有重新启动Apache服务器
内容总结
以上是互联网集市为您收集整理的php – http://在服务器中禁用包装器?全部内容,希望文章能够帮你解决php – http://在服务器中禁用包装器?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。