469,654 Members | 1,807 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,654 developers. It's quick & easy.

Failed opening required with file

does any1 here know why i got this error message when i try to run my program in php

Warning: require_once(http://localhost/own work/sql.inc.php) [function.require-once]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\wamp\www\own work\config.inc.php on line 30

Fatal error: require_once() [function.require]: Failed opening required 'http://localhost/own work/sql.inc.php' (include_path='.;C:\php5\pear') in C:\wamp\www\own work\config.inc.php on line 30
Mar 22 '07 #1
3 10038
does any1 here know why i got this error message when i try to run my program in php

Warning: require_once(http://localhost/own work/sql.inc.php) [function.require-once]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\wamp\www\own work\config.inc.php on line 30

Fatal error: require_once() [function.require]: Failed opening required 'http://localhost/own work/sql.inc.php' (include_path='.;C:\php5\pear') in C:\wamp\www\own work\config.inc.php on line 30
here is my codeing in php.. is there something i missing.. when i run my program which i got an error which stated above.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. if(!defined('CONFIG_INC'))
  4.     define('CONFIG_INC',1);
  5.  
  6. $cfg_dbsource='localhost';
  7. $cfg_dbuser='root';
  8. $cfg_dbpass='';
  9. $cfg_dbName='bhav';
  10. $cfg_dbType='mysql';
  11.  
  12. session_start();
  13. //Set no caching
  14. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  15. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  16. header("Cache-Control: no-store, no-cache, must-revalidate");
  17. header("Cache-Control: post-check=0, pre-check=0", false);
  18. header("Pragma: no-cache");
  19.  
  20. // This cheap little trick was found over at php.net
  21. if(PHP_VERSION < "4.1.0")
  22. {
  23.         $_COOKIE = $HTTP_COOKIE_VARS;
  24.         $_GET = $HTTP_GET_VARS;
  25.         $_POST = $HTTP_POST_VARS;
  26.         $_SERVER = $HTTP_SERVER_VARS;
  27.         $_FILES = $HTTP_POST_FILES;
  28. }
  29.  
  30. require_once 'include/sql.inc.php';
  31. ?>
  32.  
Mar 22 '07 #2
code green
1,726 Expert 1GB
It is because the file does not exist in the location specified by require or include
Mar 22 '07 #3
ronverdonk
4,258 Expert 4TB
Read the Posting Guidelines on choosing a meaningful title for your thread. The one you use does not tell very much on your problem and will NOT encourage members to look into your post. I have changed the thread title.

moderator
Mar 23 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by big.sexy.jcw | last post: by
9 posts views Thread by mohi | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.