Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

localhost/catalog/localhost/catalog?


drakonan

Recommended Posts

Ok, I've got a basically finished site online...

 

I was going to move it locally for testing purposes...

so I installed phptriad....

 

Now it shows the default.php page just fine,

 

but all of the links are double linking like my subject says

 

localhost/catalog/localhost/catalog/whatever

 

I don't understand...

 

I changed my configure.php from the online site to localhost and thought it'd work...

 

<?php

/*

 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2002 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', 'localhost/'); // eg, http://localhost - should not be NULL for productive servers

 define('HTTPS_SERVER', ''); // eg, https://localhost - should not be NULL for productive servers

 define('ENABLE_SSL', false); // secure webserver for checkout procedure?

 define('DIR_WS_CATALOG', 'catalog/'); // absolute path required

 define('DIR_WS_IMAGES', 'images/');

 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

 define('DIR_WS_INCLUDES', 'includes/'); // If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), this can be a URL instead of a local pathname

 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', DIR_WS_CATALOG . 'pub/');

 define('DIR_FS_DOCUMENT_ROOT', '/apache/htdocs/');

 define('DIR_FS_CATALOG', '/apache/htdocs/catalog/');

 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 NULL for productive servers

 define('DB_SERVER_USERNAME', 'feelthelove');

 define('DB_SERVER_PASSWORD', 'ofcaptainwinky');

 define('DB_DATABASE', 'oscommerce');

 define('USE_PCONNECT', 'false'); // use persistent connections?

 define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

 

Anything you guys can catch a little funky?

- - - -

Sometimes, ignorance is bliss.

Link to comment
Share on other sites

Hi Brandon,

 

Boy, I'm not the best person to answer install questions on localhost but, I'll give it a go anyway...... :D

 

I would try this configuration and see what happens.......

 

  define('HTTP_SERVER', '/'); // eg, http://localhost - should not be NULL for productive servers

 define('HTTPS_SERVER', ''); // eg, https://localhost - should not be NULL for productive servers

 define('ENABLE_SSL', false); // secure webserver for checkout procedure?

 define('DIR_WS_CATALOG', '/'); // absolute path required

Link to comment
Share on other sites

Then it tries to go to:

 

http://whatever.php

 

But what's crazy, with the above config I posted, the images all link right and everything... It looks right on the first page...

 

I tried changing /catalog/ to ../../catalog/ and then the links and images were right, but clicking caused an"internal error" whatever that means...

- - - -

Sometimes, ignorance is bliss.

Link to comment
Share on other sites

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

 

 

--------------------------------------------------------------------------------

 

Apache/1.3.23 Server at localhost Port 80

 

That's the exact message it displays when I either make catalog/ ../../catalog so that the links work right and attempt to click a link...

 

 

or if I leave it as is on top and manually type in a link other than to default.php

 

It makes no sense...

- - - -

Sometimes, ignorance is bliss.

Link to comment
Share on other sites

I did it, but the same thing is going on, but my admin somehow still "knows" that the real site is www.cookssaw.com... When I goto and newly clicked link will take it to the admin version on the website....

 

how does it still "know"?

 

Maybe I don't know where all the config info is at. What other files do I need to modify besides configure.php?

- - - -

Sometimes, ignorance is bliss.

Link to comment
Share on other sites

change

 

define('HTTP_SERVER', 'localhost/'); // eg, http://localhost - should not be NULL for productive servers

 

to

 

define('HTTP_SERVER', 'http://localhost'); // eg, http://localhost - should not be empty for productive servers

 

OR

 

define('HTTP_SERVER', 'http://yousitename.com'); // eg, http://localhost - should not be NULL for productive servers

 

 

are you certain about the path here:

 

define('DIR_FS_DOCUMENT_ROOT', '/apache/htdocs/');

 

did you try using $DOCUMENT_ROOT and it did not work?

 

and change the username and password on your db since it is listed in your post :wink:

Link to comment
Share on other sites

I was waiting for you guys to spot that, it's not my REAL password and username :P

 

Thanks man, I don't know why i got rid of that, so my links are fixed now...

 

BUT, I'm stilling getting that funky error after I try to click a link on my default.php page...

 

I can't manually go to it either...

 

(The 500 internal error above)

- - - -

Sometimes, ignorance is bliss.

Link to comment
Share on other sites

:lol: :lol:

 

sometimes my eyes really work

 

ok, which funcky error are you down to now? the double /catalog/default/catalog/defult thing?

Link to comment
Share on other sites

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

 

 

--------------------------------------------------------------------------------

 

Apache/1.3.23 Server at localhost Port 80

 

I get this on any page other than default.php...

 

default.php displays fine (with pics and everything)

 

clicking categories/products results in this...

 

The links are pointing to the right location and everything though...

- - - -

Sometimes, ignorance is bliss.

Link to comment
Share on other sites

did you try changing this link

 

define('DIR_FS_DOCUMENT_ROOT', '/apache/htdocs/');

 

to

 

define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT);

 

or verify the path you have set there?

Link to comment
Share on other sites

 define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');

 define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT);

 define('DIR_FS_CATALOG', $DOCUMENT_ROOT . 'catalog/');

 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

 

like so?

 

i did it and still get the error...

 

my public directory is f:apachehtdocs

 

I'm in a windows environment too... i didn't know if I should put the drive letter or what before... and I knew the apache would mean root, but that all folder paths were listed with the other /... so used it...

 

Does this mean anything to you?

- - - -

Sometimes, ignorance is bliss.

Link to comment
Share on other sites

yes, that is what I meant, and if that isnt working either.... and you are using Windows, then I have hit a wall :oops:

 

someone posted a really good step by step, blow by blow install guide for windows that is getting added to Wiki but i think its under tips & tricks...

Link to comment
Share on other sites

If worse comes to worse, I'll just finish it on the net, it's just so slow with satellite.... (at the present moment average ping time to google is 907ms)

 

I can live with it though... (in some ways its faster than dial-up, someways slower...)

 

As example, when FTPing, it's much better to do a recursive list every time you list, it takes about as long as normal does... since download rate is so fast, but latency is so high...

 

i got an old 233 that i can stick redhat on in the future... I might try that...

 

you think that's my prob. then? I'm using windows?

Anyway, i'll look under there then.

 

Thanks again.

- - - -

Sometimes, ignorance is bliss.

Link to comment
Share on other sites

Get it right.... if your catalog is in a 'catalog' folder in document root running Apache on Windows, your configuration file should be as follows:

 

  define('HTTP_SERVER', 'http://localhost'); // eg, http://localhost - should not be empty for productive servers

 define('HTTPS_SERVER', 'http://localhost'); // eg, https://localhost - should not be empty for productive servers

 define('ENABLE_SSL', false); // secure webserver for checkout procedure?

 define('DIR_WS_CATALOG', '/catalog/'); // absolute path required

 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', DIR_WS_CATALOG . 'pub/');

 define('DIR_FS_DOCUMENT_ROOT', $HTTP_SERVER_VARS['DOCUMENT_ROOT']); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs)

 define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);

 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

... if they are not in a folder, also change:

 

  define('DIR_WS_CATALOG', '/catalog/'); // absolute path required

 

to

 

  define('DIR_WS_CATALOG', '/'); // absolute path required

 

.... if you try and use:

 

define('HTTP_SERVER', 'localhost');

 

you will get errors.... even if you play with the other paths.

Link to comment
Share on other sites

Yeah Johnson, you're right... That was my original problem... When I edited my configure.php I left out the http://

 

jchasick spotted the problem for me

 

But if YOU'd have gotten it right :) , you'd see that i'm facing an internal error 500 now....

I've tried the document_root, as shown,

 

and tried /apache/htdocs, as that is the location my public files are stored...

 

to no avail.

 

Be nice now, I AM a newbie. Not just to these forums, not just to PHP, and not even just to HTML. I think I'm doing a pretty good job learnin' this stuff considering that I'm a Win2k network administrator by profession, NOT web developer...

 

I'm going to try and mess some more with it though... and if nothing else red hat install time...

 

btw, if I figure out I'll post, maybe someone else will get something from my mistakes....

 

Besides, a mistake is only a mistake if you don't learn from it...

 

Hasn't your mother ever told you that? LOL

 

Thanks everyone,

 

Brandon

- - - -

Sometimes, ignorance is bliss.

Link to comment
Share on other sites

Ummm... I was not being not 'nice'.... merely pointing out that there are some unusual suggested paths.... these paths are confusing... for instance, when you changed:

 

  define('HTTP_SERVER', 'localhost/'); // eg, http://localhost

 

to:

 

  define('HTTP_SERVER', 'http://localhost'); // eg, http://localhost

 

did you also change:

 

define('DIR_WS_CATALOG', 'catalog/'); // absolute path required

 

to:

 

define('DIR_WS_CATALOG', '/catalog/'); // absolute path required

 

? So..... I posted a standard Windows configuration... it will work. Make sure that you

don't use a trailing slash on your main server path..... you can get that server error from a misconfigured osC installation.....

Link to comment
Share on other sites

Hey, sorry about my little "bark" at ya... I read into "get it right" as meaning you're an idiot or something... I don't know... normally I don't "lose it"...

 

Anyway, thanks for still trying to help me anyway...

 

I eventually even took your code and stuck it in my configure.php and I'm STILL getting this 500 internal error... Is this a PHP error? WHAT exactly IS it saying, and what and WHERE is this log it talks about maybe having some extra info?

 

The admin seems to work right, too... no internal errors so far, just browsing around... I don't understand...

- - - -

Sometimes, ignorance is bliss.

Link to comment
Share on other sites

I was going to suggest looking at your Apache error log. The 'error.log' should be in your apache/logs folder.... it could be your httpd.conf.... what is your document root in there? I use easyPHP and mine has:

 

DocumentRoot "C:/Program Files/EasyPHP/www"

Link to comment
Share on other sites

I'm STILL getting this 500 internal error...  Is this a PHP error?  WHAT exactly IS it saying

 

Its just saying that for whatever reason, be it a scripting error or server misconfiguration, the server could not deliver the requested web page.

Link to comment
Share on other sites

In your web environment just add an htaccess file to your /catalog/ dir to override your global http.conf that your web host probably set you up with. In your .htaccess file include the line

 

 DirectoryIndex index.php default.php index.htm index.html index.asp default.html default.htm index.jsp index.cfm

 

Thant should pretty much cover all your grounds I would say. Links to www.yoursite.com/catalog/ should display fine after that.

 

Hope that helps

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...