glassfish Posted October 9, 2014 Share Posted October 9, 2014 The Error Message: 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 I am getting this error message. 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. Here is the code: <!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> I was looking to include "upload.php" with the absolute path. Any suggestions what to do here? Link to comment https://forums.phpfreaks.com/topic/291531-http-wrapper-is-disabled-in-the-server/ Share on other sites More sharing options...
glassfish Posted October 9, 2014 Author Share Posted October 9, 2014 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. Link to comment https://forums.phpfreaks.com/topic/291531-http-wrapper-is-disabled-in-the-server/#findComment-1493134 Share on other sites More sharing options...
Frank_b Posted October 9, 2014 Share Posted October 9, 2014 Believe me, you dont want to include a php file over the http. To include php files into your script you need to have the php files installed on the same server and then you need to use a systempath e.g. linux: /home/frank/domain.com/libraries/functions.php or with a windows server: c:\path\to\webroot\libraries\functions.php if you have troubles to find the right path you could use this in your scriptfile to get it: echo __DIR__; Link to comment https://forums.phpfreaks.com/topic/291531-http-wrapper-is-disabled-in-the-server/#findComment-1493141 Share on other sites More sharing options...
glassfish Posted October 9, 2014 Author Share Posted October 9, 2014 I have used $_SERVER['DOCUMENT_ROOT']; Then I have gotten a new error message: Warning: move_uploaded_file(uploads/1f77f7e78f36847859c0604e9645f112.jpg): failed to open stream: No such file or directory in C:\xampp\htdocs\ubergallery\multiple_image_upload\upload.php on line 17 Warning: move_uploaded_file(): Unable to move 'C:\xampp\tmp\phpE035.tmp' to 'uploads/1f77f7e78f36847859c0604e9645f112.jpg' in C:\xampp\htdocs\ubergallery\multiple_image_upload\upload.php on line 17 1).please try again!. I have looked for the permissions, and the folder "uploads" was set to "read-only", I have tried to "uncheck" this yet it sets itself back to "read-only" again. I am also not sure how and from where this folder gets set to "read-only". Do you have a suggestion? EDIT: Sorry, this may be a whole new question, then. Link to comment https://forums.phpfreaks.com/topic/291531-http-wrapper-is-disabled-in-the-server/#findComment-1493153 Share on other sites More sharing options...
jcbones Posted October 9, 2014 Share Posted October 9, 2014 Not sure what OS you have, but here is a tutorial for changing permissions in Win7 http://http://www.sevenforums.com/tutorials/122666-permissions-allow-deny-users-groups.html Link to comment https://forums.phpfreaks.com/topic/291531-http-wrapper-is-disabled-in-the-server/#findComment-1493196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.