Page 1 of 1
Install on Windows config bug?
Posted: Thu Jul 31, 2008 11:23 pm
by Qphoria
Suprised this hasn't been mentioned before. Maybe its something I'm missing.
Installed OpenCart on my home windows box. Install went smoothly, but when click on the main catalog index, it gave me some garbage errors. Seems that when it wrote the config, it didn't properly escape the backslashes that windows uses, so the php structure was invalid
I had to manually change:
Code: Select all
define('DIR_CACHE', 'C:\Documents and Settings\Server\Application Data\NuSphere\PhpED\projects\opencart\cache\');
Code: Select all
define('DIR_CACHE', 'C:\\Documents and Settings\\Server\\Application Data\\NuSphere\\PhpED\\projects\\opencart\\cache\\');
and all the rest of them too.
This got the main home page to load, but all links, such as "My Account", that I clicked said things like:
HTTP/404
The requested URL alias for /account is not defined.
Is there full support for windows install? It seems there at least needs to be an "addslashes" function somewhere in the install.
Re: Install on Windows config bug?
Posted: Thu Jul 31, 2008 11:37 pm
by Qphoria
Ok, seems URL Alias doesn't work with windows maybe. That should probably be configurable at install time. Had to manually hack the db with phpmyadmin to disable url alias to get it working.
Re: Install on Windows config bug?
Posted: Fri Aug 01, 2008 12:04 am
by Qphoria
Seems that the URL Alias only affects the admin area, the library/environment/url.php file is hard coded with a preg_replace to change the
"index.php?controller=account_login"
to
"account"
if its not the admin page.
This should be using the url_alias setting as well.
We got a lot of work to do

Re: Install on Windows config bug?
Posted: Fri Aug 01, 2008 12:16 am
by Qphoria
Ok, I think I see the problem with the windows install.
I see in the installer:
if ((isset($_ENV['OS'])) && ($_ENV['OS'] == 'Windows_NT')) { define('SLASH', '\\'); }
I see that XP is showing up as Windows_NT but for some reason it didn't take.
So it looks like the check is there, just needs some refining.
I think the SLASH should also be carried over to the store as well, not just the install, as there are times that a slash may need to be read and depending on the OS, it will need to figure itself out on the fly.
Re: Install on Windows config bug?
Posted: Wed Aug 06, 2008 12:19 am
by alberto
There's something to repair that bug manually? I'll need to try this week in windows.
Thanks
Re: Install on Windows config bug?
Posted: Wed Aug 06, 2008 10:13 am
by bruce
Are you trying to run this on IIS or have you got apache running on windows?
If the second, I have had no trouble with 0.7.7 using xampp on windows. Straight out of the box.
Re: Install on Windows config bug?
Posted: Wed Aug 06, 2008 11:03 am
by Qphoria
Using Nusphere PHPEd's built-in server. No biggie about the URL aliasing, but it is weird that the installer didn't find the "\\" method instead of "/" but I see the code and it looks correct. I added the code to my index.php for some of the contribs I'm working on and it works fine.
All in all, this is no longer a problem for me.
Re: Install on Windows config bug?
Posted: Wed Aug 06, 2008 3:14 pm
by alberto
I've got apache on windows.
Re: Install on Windows config bug?
Posted: Wed Aug 06, 2008 4:03 pm
by alberto
I've got the 0.7.8 version where can i download the 0.7.7 ?
The 0.7.8 with xampp don't work.
Re: Install on Windows config bug?
Posted: Wed Aug 06, 2008 6:25 pm
by Qphoria
alberto wrote:
I've got the 0.7.8 version where can i download the 0.7.7 ?
The 0.7.8 with xampp don't work.
Please elaborate a bit on the "don't work". Did it work with URL Aliasing off? (and the hack to make it actually turn off on the front end)
Re: Install on Windows config bug?
Posted: Wed Aug 06, 2008 10:46 pm
by alberto
With the v.0.7.7 version it works perfectly. With 0.7.8 the admin page where fine but in the frontend all the links ara "broken" i have 404 error. I use apache 2.2 in my computer with windows XP
Re: Install on Windows config bug?
Posted: Wed Aug 06, 2008 11:03 pm
by Qphoria
alberto wrote:
With the v.0.7.7 version it works perfectly. With 0.7.8 the admin page where fine but in the frontend all the links ara "broken" i have 404 error. I use apache 2.2 in my computer with windows XP
Check your config file. Do the paths show as:
'C:\path\to\my\folder'
or
'C:\\path\\to\\my\\folder'
If it is the former, then it is the same error I had. Manually changed them all from '\' to '\\' to fix it.
Re: Install on Windows config bug?
Posted: Thu Aug 07, 2008 7:57 pm
by fido-x
Simple solution - don't use Windows!
Fido-X.
Re: Install on Windows config bug?
Posted: Thu Aug 07, 2008 9:02 pm
by Qphoria
fido-x wrote:
Simple solution - don't use Windows!
Fido-X.

Of course!
Re: Install on Windows config bug?
Posted: Fri Aug 08, 2008 8:48 am
by bruce
Back to the actual topic...
My config files all standardise on the / slash which works unchanged on windows (xampp) and hosted locations too. In addition they have an edit friendly layout as follows. The file is real but kept on my laptop and I don't use these passwords etc anywhere else.
Chances are too, that xampp puts something in the apache or php configurations to switch or interpret the slashes correctly but I have not investigated that far because this simply works.
cheers
Bruce
Code: Select all
<?php
define('HOSTING_URL', 'localhost/accolades');
define('HOSTING_DIR', 'C:/xampp/htdocs/accolades');
define('HOSTING_DB_HOST', 'localhost');
define('HOSTING_DB_USER', 'opencartdev');
define('HOSTING_DB_PASSWORD', 'support');
define('HOSTING_DB_NAME', 'accolades');
// HTTP
define('HTTP_SERVER', 'http://' . HOSTING_URL . '/');
define('HTTP_IMAGE', 'http://' . HOSTING_URL . '/image/');
// HTTPS
define('HTTPS_SERVER', 'https://' . HOSTING_URL . '/');
define('HTTPS_IMAGE','https://' . HOSTING_URL . '/image/');
// DIR
define('DIR_CACHE', HOSTING_DIR . '/cache/');
define('DIR_DOWNLOAD', HOSTING_DIR . '/download/');
define('DIR_IMAGE', HOSTING_DIR . '/image/');
define('DIR_LIBRARY', HOSTING_DIR . '/library/');
define('DIR_MODEL', HOSTING_DIR . '/catalog/model/');
define('DIR_CONTROLLER', HOSTING_DIR . '/catalog/controller/');
define('DIR_LANGUAGE', HOSTING_DIR . '/catalog/language/');
define('DIR_EXTENSION', HOSTING_DIR . '/catalog/extension/');
define('DIR_TEMPLATE', HOSTING_DIR . '/catalog/template/');
define('DIR_EXTERNAL', HOSTING_DIR . '/library/external/');
define('DIR_LOGGING', HOSTING_DIR . '/logs/');
// DB
define('DB_HOST', HOSTING_DB_HOST);
define('DB_USER', HOSTING_DB_USER);
define('DB_PASSWORD', HOSTING_DB_PASSWORD);
define('DB_NAME', HOSTING_DB_NAME);
if ( ! defined( 'PATH_SEPARATOR' ) )
{
if ( strpos( $_ENV['OS'], 'Win' ) !== false )
define( 'PATH_SEPARATOR', ';' );
else
define( 'PATH_SEPARATOR', ':' );
}
?>
Re: Install on Windows config bug?
Posted: Wed Aug 13, 2008 12:48 am
by jballotti
Qphoria wrote:
Suprised this hasn't been mentioned before. Maybe its something I'm missing.
Installed OpenCart on my home windows box. Install went smoothly, but when click on the main catalog index, it gave me some garbage errors. Seems that when it wrote the config, it didn't properly escape the backslashes that windows uses, so the php structure was invalid
I had to manually change:
Code: Select all
define('DIR_CACHE', 'C:\Documents and Settings\Server\Application Data\NuSphere\PhpED\projects\opencart\cache\');
Code: Select all
define('DIR_CACHE', 'C:\\Documents and Settings\\Server\\Application Data\\NuSphere\\PhpED\\projects\\opencart\\cache\\');
and all the rest of them too.
This got the main home page to load, but all links, such as "My Account", that I clicked said things like:
HTTP/404
The requested URL alias for /account is not defined.
Is there full support for windows install? It seems there at least needs to be an "addslashes" function somewhere in the install.
I found that all I had to do was add a single backslash at the end of the define statements and it started working.
from this:
Code: Select all
define('DIR_CACHE', 'C:\Documents and Settings\Server\Application Data\NuSphere\PhpED\projects\opencart\cache\');
to this:
Code: Select all
define('DIR_CACHE', 'C:\Documents and Settings\Server\Application Data\NuSphere\PhpED\projects\opencart\cache\\');
Re: Install on Windows config bug?
Posted: Wed Aug 13, 2008 1:23 am
by Qphoria
that works too

Re: Install on Windows config bug?
Posted: Wed Aug 13, 2008 2:19 am
by jballotti
Okay, I now have both the admin and store-front displaying properly but none of the links on the storefront work. I've tried turning off URL aliases in the admin but that didn't work. I've looked through other posts on this subject and found a mention of a hack to fix the problem but am not sure I fully understand what that hack is.
Could someone explain what I need to do to get this working.
Thanks,
Re: Install on Windows config bug?
Posted: Wed Aug 13, 2008 3:55 am
by Qphoria
Re: Install on Windows config bug?
Posted: Thu Sep 25, 2008 6:56 pm
by hm2k
Bugs like this should be handled as per this thread:
http://forum.opencart.com/index.php/topic,1466.0.html
Please test the latest SVN and this should be fixed.
Thanks.