Tuesday 15 February 2011

php - http:// wrapper is disabled in the server? -



php - http:// wrapper is disabled in the server? -

the error message:

warning: include(): http:// wrapper disabled in server configuration 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 open stream: no suitable wrapper 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' inclusion (include_path='.;c:\xampp\php\pear') in c:\xampp\htdocs\ubergallery\multiple_image_upload\multiupload.php on line 27

i getting error message.

including stylesheet or jquery file absolute path work out, looking include php script absolute path.

here code:

<!doctype html> <html> <head> <title>upload multiple images using jquery , php</title> <!-------including jquery 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 compulsory. jpeg,png,jpg type image uploaded. image size should less 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>

i looking include "upload.php" absolute path.

when turn "allow_url_include" "on" still same error message. not sure if issue begin with.

any suggestions here?

from php docs on include:

if "url include wrappers" enabled in php, can specify file included using url (via http or other supported wrapper - see supported protocols , wrappers list of protocols) instead of local pathname. if target server interprets target file php code, variables may passed included file using url request string used http get. not strictly speaking same thing including file , having inherit parent file's variable scope; script beingness run on remote server , result beingness included local script.

by obvious inference, supposed utilize local pathname!

change line

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

to this

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

the reason allow_url_include=on doesn't work because didn't restart apache server after changing php.ini

php apache

No comments:

Post a Comment