GeoffreyETD Posted July 26, 2013 Share Posted July 26, 2013 An error occurred in script 'C:\xampp\htdocs\_LUecommerce1test\html\index.php' on line 15:require(/C:/xampp/htdocs/_LUecommerce1test/mysql.inc.php): failed to open stream: Invalid argument Fatal error: require(): Failed opening required '/C:/xampp/htdocs/_LUecommerce1test/mysql.inc.php' (include_path='.;C:\xampp\php\PEAR') This is happening when I try to run index.php per Item-8 "Test the result" on page 71. I'm using Dreamweaver F12 to run it. Here are the final lines of the spacious backtrace printout on the browser: [1] => Array([file] => C:\xampp\htdocs\_LUecommerce1test\html\index.php[line] => 15[function] => require)) I'm new to this type of programming so I sure hope someone can help me figure it out! Thanks in advance! - GeoffreyETD Link to comment Share on other sites More sharing options...
Edward Posted July 26, 2013 Share Posted July 26, 2013 If you are using F12 on Dreamweaver you will need to setup a testing server to map the site to the browser. Otherwise you could just run the site webpage directly from the browser by typing in the following: localhost/_LUecommerce1test/html/index.php You need to check that the mysql.inc.php file is in the correct location. It may be better just to move the file into the same directly just to get it working, you could move the mysql.inc.php on the server when you need to make that information more secure. So for now you can move the mysql.inc.php file into _LUecommerce1test/html/ and just change the require statement to require(/C:/xampp/htdocs/_LUecommerce1test/html/mysql.inc.php). Or if you wished to make things simpler just remove the html folder and put all the contents in _Luecommerce1test. Link to comment Share on other sites More sharing options...
Larry Posted July 26, 2013 Share Posted July 26, 2013 Also, the e-commerce book does assume complete comfort with PHP and MySQL. If you don't have that, the book may be a bit too challenging for you at this point. Link to comment Share on other sites More sharing options...
GeoffreyETD Posted July 27, 2013 Author Share Posted July 27, 2013 Thanks Edward and Larry! Larry - I will definitely be trying to educate myself on PHP (particularly) and MySQL (already somewhat familiar). Edward: Yes, my "base-site" in Dreamweaver is on my D: drive, and my "test-site" is on my C: drive in xampp/htdocs/, so I think I have that all set up fine. I did try your suggestions (other than the last one) and they did not resolve the issue. Could there be a problem with the PEAR thing (can't get any information as to what php/PEAR is all about, so any elucidation would be most appreciated). After all, the very last part of the error message says: "Fatal error: require(): Failed opening required '/C:/xampp/htdocs/_LUecommerce1test/mysql.inc.php' (include_path='.;C:\xampp\php\PEAR')" Seems to me that it could have something to do with PEAR, otherwise the script wouldn't have run far enough to bring up a message referring to it, no? I'm guessing, of course, but it does seem suspicious. Link to comment Share on other sites More sharing options...
Edward Posted July 28, 2013 Share Posted July 28, 2013 I think this error is actually not in relation to PEAR, some of us had this problem before including "ME" and after rechecking the forums i realize it is to do with the base constant settings in your config.inc.php script. I think it would be a good idea to take a look at these posts below they may help you otherwise let us know your base constants so we can help you correct them. http://www.larryullman.com/forums/index.php?/topic/967-define-constants-for-site-chpt-3-pg-58/?hl=%2Bfatal+%2Berror%3A+%2Brequire%28%29 http://www.larryullman.com/forums/index.php?/topic/1663-connection-errors/?hl=%2Bfatal+%2Berror%3A+%2Brequire%28%29 1 Link to comment Share on other sites More sharing options...
Recommended Posts