Guest Posted October 20, 2005 Posted October 20, 2005 Hi guys, I have a very quick question - I've installed oscommerce v2.2-ms2 on Windows 2003 and have managed to almost get it up and running. After completing the installation I get the following error when accessing the index.php in the root of catalog: Warning: main(includes/configure.php): failed to open stream: No such file or directory in C:\Inetpub\wwwroot\includes\application_top.php on line 35 The first line on index.php is: require('includes/application_top.php'); which obviously works cos the error message is for application_top.php. In application_top.php, line 35 (the one that it's complaining about) looks like this: require('includes/configure.php'); Which doesn't make sense to me - my understanding is that "require()" will take on the context of the parent file (in this case index.php) so if "require('includes/application_top.php')" works then so should "require('includes/configure.php');". If I do one of two things, the error goes away: 1 - Change application_top.php, line 35 to read: require('configure.php'); This gets us past line 35 but we get an error at the next require() statement - so obviously this is an environment setting. 2 - Alternatively, add the following line to the top of application_top.php: ini_set("include_path", "/Inetpub/wwwroot/"); This second option works fine for all files that use application_top.php but causes problems when I try to access /admin/. The second option above makes me think that there's something funky going on with my environment. According to the php manual, I should not be getting the behaviour above where the require() statements inside application_top.php are relative to application_top.php as opposed to being relative to the parent. My php.ini include_path looks like this which should be fine: include_path = "." Does anyone have any advice on what this could possibly be or places to check next? Thanks for any advice! P.
Guest Posted October 20, 2005 Posted October 20, 2005 post your configure.php file here WITHOUT THE DATABASE CONNECTION INFO
Guest Posted October 20, 2005 Posted October 20, 2005 Thanks for the quick response! Here's my configure.php - I didn't think this was the problem as the error seems to be that it can't find this file, not that it's having an issue with the contents: <?php /* $Id: configure.php,v 1.14 2003/07/09 01:15:48 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) define('HTTP_SERVER', ''); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', false); // secure webserver for checkout procedure? define('HTTP_COOKIE_DOMAIN', ''); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', ''); define('HTTPS_COOKIE_PATH', ''); define('DIR_WS_HTTP_CATALOG', ''); define('DIR_WS_HTTPS_CATALOG', ''); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/'); define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME'])); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); // define our database connection define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers define('DB_SERVER_USERNAME', 'XXXXXX'); define('DB_SERVER_PASSWORD', 'XXXXXX'); define('DB_DATABASE', 'XXXXXX'); define('USE_PCONNECT', 'false'); // use persistent connections? define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql' ?>
Guest Posted October 20, 2005 Posted October 20, 2005 I have a feeling this is a PHP configuration issue. I tried the following experiment - I have 3 files with the following structure /a.php /test/b.php /test/c.php File A looks like this: echo('File A<br/>'); require('test/b.php"); File B looks like this: echo('File B<br/>'); require("test/c.php"); and File C looks like this: echo('File C<br/>'); My understanding of require() says this should work - File B should have the context of File A so the require for File C will be executed from the root (not the /test/ subdir). Unfortunately it doesn't work! I get the following output (same as the problem in the original post): File A File B Warning: main(test/c.php): failed to open stream: No such file or directory in C:\Inetpub\wwwroot\test\b.php on line 5 Fatal error: main(): Failed opening required 'test/c.php' (include_path='.') in C:\Inetpub\wwwroot\test\b.php on line 5 Is anyone aware of *any* PHP configuration settings that would cause require() to behave in this way? It's weird - everything I've read and googled about this issue has talked about how confused PHP newbies get about the parent-relative behaviour of require() and include() - my problem is the exact opposite!! require() and include() are referecing files by the child location and not the parent! If I run the same files under OS X I get the expected response with no errors. Anyone have any ideas on where I should look? P.
♥Vger Posted October 20, 2005 Posted October 20, 2005 Anyone have any ideas on where I should look? Yes, all of the empty entries in your configure.php file: define('HTTP_SERVER', 'http://www.yourdomain.com'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', false); // secure webserver for checkout procedure? define('HTTP_COOKIE_DOMAIN', 'www.yourdomain.com'); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', '/'); define('HTTPS_COOKIE_PATH', ''); define('DIR_WS_HTTP_CATALOG', '/'); define('DIR_WS_HTTPS_CATALOG', ''); That's for an online install in the root of your domain. For a local install use http://localhost and just 'localhost' for http_cookie_domain, and /catalog/ for dir_ws_http_catalog Vger
Guest Posted October 20, 2005 Posted October 20, 2005 Yes, all of the empty entries in your configure.php file: Thanks Vger - my problem is that configure.php is not even being read - the error message is failing to include it with the require() statement in application_top.php - unless I'm missing something, changing the values in configure.php will not have an effect on this particular problem (although I take your point that it will cause me problems down the line). I'm trying to run OSC from the root directory of the website - when I move the app down one level to /catalog/ for example it works (and so do my abc test scripts). Is there an additional config required to make OSC (or any PHP app for that matter) run from the root of an IIS web? P.
♥Vger Posted October 20, 2005 Posted October 20, 2005 According to your original post it is installed in the root of your web, so the error must be in the permissions that exist at that level. Check that the permissions on all of your folders are set to either 755 or 777, so that the contents of the 'includes' and other folders can be read, and make sure that the permissions are not owned, at that level, by the Windows web server. There is an article in the Knowledge Base for people who have problems installing on Windows servers so you may want to search for that. I must admit to the belief that Windows servers work best with ASP scripts and that Apache web servers work best with PHP scripts. I must also own up to the belief that Windows servers are total pants - but that's just my opinion. Vger
Recommended Posts
Archived
This topic is now archived and is closed to further replies.