wmguk Posted May 22, 2008 Share Posted May 22, 2008 I get these errors, when accessing a page on an HTTPS server, Warning: include(create.php?login=drewtest) [function.include]: failed to open stream: No such file or directory in /var/www/vhosts/domain.co.uk/httpsdocs/createadmin/uploadim.php on line 10 Warning: include() [function.include]: Failed opening 'create.php?login=drewtest' for inclusion (include_path='.:.:') in /var/www/vhosts/domain.co.uk/httpsdocs/createadmin/uploadim.php on line 10 this is line 1 to 10 <?php session_start(); if (!isset($_SESSION['myusername'])) { header("location:index.php"); exit; } $user = $_SESSION['myusername']; $login = $_POST['login']; include "../scripts/connection.php"; include "../scripts/ftpaccess.php"; include "create.php?login=$login" ; ?> this is the line affected : include "create.php?login=$login" ; however the create.php is in that same directory cant you pass a variable via an include? Link to comment https://forums.phpfreaks.com/topic/106842-solved-warning-includexx-functioninclude-failed-to-open-stream-errors/ Share on other sites More sharing options...
Dragen Posted May 22, 2008 Share Posted May 22, 2008 I don't think you can pass get variables via include. If you need to set the get vars you could try this: <?php $_GET['login'] = 'login'; include(create.php); ?> Link to comment https://forums.phpfreaks.com/topic/106842-solved-warning-includexx-functioninclude-failed-to-open-stream-errors/#findComment-547709 Share on other sites More sharing options...
wmguk Posted May 22, 2008 Author Share Posted May 22, 2008 I don't think you can pass get variables via include. If you need to set the get vars you could try this: <?php $_GET['login'] = 'login'; include(create.php); ?> wow, ok yh I did wonder if you could pass the vars... now i get this error: Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/var/www/vhosts/domain.co.uk/httpdocs/clients/login) is not within the allowed path(s): (/var/www/vhosts/domain.co.uk/httpsdocs:/tmp) /var/www/vhosts/domain.co.uk/httpsdocs/createadmin/create.php on line 8 Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(/var/www/vhosts/domain.co.uk/httpdocs/clients/login) is not within the allowed path(s): (/var/www/vhosts/domain.co.uk/httpsdocs:/tmp) in /var/www/vhosts/domain.co.uk/httpsdocs/createadmin/create.php on line 11 Failed to create directory... Contact Drew Warning: copy() [function.copy]: open_basedir restriction in effect. File(/var/www/vhosts/domain.co.uk/httpdocs/clients/getpics.php) is not within the allowed path(s): (/var/www/vhosts/domain.co.uk/httpsdocs:/tmp) in /var/www/vhosts/domain.co.uk/httpsdocs/createadmin/create.php on line 20 Link to comment https://forums.phpfreaks.com/topic/106842-solved-warning-includexx-functioninclude-failed-to-open-stream-errors/#findComment-547711 Share on other sites More sharing options...
Dragen Posted May 22, 2008 Share Posted May 22, 2008 I've never really looked into is_dir and similar, but it sounds as though you don't have permission to access that folder through those functions or that you're using direct urls when you should be using relative. Something like that. Could you post the code please? Link to comment https://forums.phpfreaks.com/topic/106842-solved-warning-includexx-functioninclude-failed-to-open-stream-errors/#findComment-547720 Share on other sites More sharing options...
wmguk Posted May 22, 2008 Author Share Posted May 22, 2008 excellent, I have just removed the open_basedir restriction between the http and https so now I dont get any errors between the two systems, however I now get: Warning: copy(/var/www/vhosts/domain.co.uk/httpdocs/clients/login/getpics.php) [function.copy]: failed to open stream: Permission denied in /var/www/vhosts/domain.co.uk/httpsdocs/createadmin/create.php on line 20 hmmm, permission denied implies that the chmod still didnt work... this is the code: <?php $thisdir = "/var/www/vhosts/domain.co.uk/httpdocs/clients"; $login = $_GET['login']; $getpics = "/var/www/vhosts/domain.co.uk/httpdocs/clients/getpics.php"; $newdir = "/var/www/vhosts/domain.co.uk/httpdocs/clients/$login/getpics.php"; if (is_dir($thisdir ."/$login") ) exit(); if(mkdir($thisdir ."/$login" , 0755, true)) { chmod($thisdir ."/$login", 4755); } else { echo "<p class='footer'>Failed to create directory... <br> Contact <a href='mailto:[email protected]'>Drew</a></p>"; } echo copy("$getpics", "$newdir"); //This is the line 20 with the issue ?> Link to comment https://forums.phpfreaks.com/topic/106842-solved-warning-includexx-functioninclude-failed-to-open-stream-errors/#findComment-547723 Share on other sites More sharing options...
wmguk Posted May 22, 2008 Author Share Posted May 22, 2008 Excellent, This is now resolved! not sure what was going on there, but just ran 4 tests, and each test worked, its created the folder, set to 0755 and copy getpics.php in to the directory!!!!! Thank you :) Link to comment https://forums.phpfreaks.com/topic/106842-solved-warning-includexx-functioninclude-failed-to-open-stream-errors/#findComment-547729 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.