ketchumdev Posted March 6, 2011 Share Posted March 6, 2011 My PHP page: http://bocce.tongie.me/add_user.php Throws the error message: Warning: include(/connections/ketchumdevread.php) [function.include]: failed to open stream: No such file or directory in /home/content/86/7345486/html/bocce/login.php on line 1 This functions flawlessly in my local testing environment (XAMPP). Somehow, the code I have refuses to locate my “connections” folder on the remote server. I have confirmed spelling, capitalization, folder location, and attempted every conceivable combination of ../../. Also, due to the fact that this is located under a subdomain, I have attempted to use the path /bocce/connections/ketchumdevread.php This really feels like an elementary problem, I just can’t find the solution. I’m stumped. Any suggestions? Here are the first few lines of the add user page (copied from the remote server): <?php include('/connections/ketchumdevwrite.php'); ?> <?php if (isset($_POST['password'])) { $_POST['password'] = sha1($_POST['password']); } Thank you all very much. Quote Link to comment https://forums.phpfreaks.com/topic/229816-failed-to-open-stream-no-such-file-or-directory-in/ Share on other sites More sharing options...
redarrow Posted March 6, 2011 Share Posted March 6, 2011 When you go localhost, in the browser should see the XAMPP stuff.... If you then goto the www directory, your see php files there, add yours then do it agin with the new file name. localhost/what_ever.php should see your php page... Quote Link to comment https://forums.phpfreaks.com/topic/229816-failed-to-open-stream-no-such-file-or-directory-in/#findComment-1183735 Share on other sites More sharing options...
ketchumdev Posted March 6, 2011 Author Share Posted March 6, 2011 PHP-Real, thank you for your response. But I don't get your meaning. In the online directory there aren't any files called localhost, and nothing in the pages attempts to point to localhost. The page will load, it just throws the warning "failed to open stream: No such file or directory in ..." It fails to make the link to my connection file. The files are there, my path is just wrong somehow. I'm overlooking something obvious. Thanks again Did I mention this is my first crack at PHP? Quote Link to comment https://forums.phpfreaks.com/topic/229816-failed-to-open-stream-no-such-file-or-directory-in/#findComment-1183748 Share on other sites More sharing options...
redarrow Posted March 6, 2011 Share Posted March 6, 2011 sorry mate thort you was dong all this at home so sorry. This would help, but you can not find the home page. <?php echo $_SERVER['PHP_SELF']; ?> Surly the web company, you got going there, can help email them? Didnt you get any intuduction, papers emails?. Quote Link to comment https://forums.phpfreaks.com/topic/229816-failed-to-open-stream-no-such-file-or-directory-in/#findComment-1183750 Share on other sites More sharing options...
litebearer Posted March 6, 2011 Share Posted March 6, 2011 try using an absolute path ie the full ball of wax - http://blah/blah/file also show us your folder hierarchy Quote Link to comment https://forums.phpfreaks.com/topic/229816-failed-to-open-stream-no-such-file-or-directory-in/#findComment-1183751 Share on other sites More sharing options...
DavidAM Posted March 7, 2011 Share Posted March 7, 2011 Do NOT use include('http:// ... Warning: include(/connections/ketchumdevread.php) [function.include]: failed to open stream: No such file or directory in /home/content/86/7345486/html/bocce/login.php on line 1 Where is the connections folder in relation to login.php. Is it in the same directory? or is it in one of the directories above it? By putting a slash at the beginning of it, you are telling PHP to look in the root of the file system of the server. You can pretty much bet that it is NOT there. If connections is a folder in bocce (where login.php is), take the leading slash off. Otherwise, post your folder hierarchy, and we'll see what we can do. Quote Link to comment https://forums.phpfreaks.com/topic/229816-failed-to-open-stream-no-such-file-or-directory-in/#findComment-1183767 Share on other sites More sharing options...
litebearer Posted March 7, 2011 Share Posted March 7, 2011 the reference to absolute path was to test it in his browser. Quote Link to comment https://forums.phpfreaks.com/topic/229816-failed-to-open-stream-no-such-file-or-directory-in/#findComment-1183769 Share on other sites More sharing options...
DavidAM Posted March 7, 2011 Share Posted March 7, 2011 the reference to absolute path was to test it in his browser. sorry, I didn't read it that way. Quote Link to comment https://forums.phpfreaks.com/topic/229816-failed-to-open-stream-no-such-file-or-directory-in/#findComment-1183776 Share on other sites More sharing options...
ketchumdev Posted March 7, 2011 Author Share Posted March 7, 2011 DavidAM, The connections folder is in the bocce folder, removing the slash at the beginning leads me to another error. I think I might have an issue in my connections file. I'm gonna try to work this out. I seem to learn more if I work things on my own. Thanks to everyone for the responses, I appreciate the help. Quote Link to comment https://forums.phpfreaks.com/topic/229816-failed-to-open-stream-no-such-file-or-directory-in/#findComment-1183780 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.