PDA

View Full Version : path question


Scrumpy
04-30-2001, 02:41 PM
Im trying to install a php shopping cart and everything is ok, but I keep getting an error when I try to open the admin page.

This is the error -
Fatal error: Failed opening required 'Cart.php' (include_path='') in /home/***/public_html/Cart/admin/index.php on line 2


I think I've narrowed it down to not knowing the correct webroot?

/* Replace these variables with the absolute and relative paths to your
MyCart scripts */
$WebRoot=""; <--- I've tried a bunch of combo's>
$Relative="/Cart";
$WebHost="www.mydomain.com"; <--I know this >
function Root() {
global $WebRoot,$Relative,$WebHost;
}

I even looked at phpinfo and used the include path I found there but still didnt work.

I dont have a clue. Anyone?? Please!

Scrumpy

DCE
04-30-2001, 03:05 PM
just a thought......
Your not missing off a trailing slash at the end of the path are you?
I've done this so many times it's embarassing

ie $WebRoot="/home/user_name/public_html/";

Scrumpy
04-30-2001, 03:20 PM
Thanks for the suggestion, I tried the end / again to see if I had missed it before but still get the same error.

Maybe I should start over? It's a good thing I dont have a life.


Scrumpy

xtra
05-04-2001, 08:46 AM
These seem to be the correct settings:

$WebRoot="/home/***/public_html/";
$Relative="Cart"; // if it's relative, starts with no slashes

Try with those seetings. If it doesn't work, tell me the PHP code on line 2. It seems that cart.php is one directory upper than the admin script, and that's what is causing the include error.

Carlos

burdrumz
05-11-2001, 07:35 AM
.phpI don't know PHP, but I know enough about PERL to say: maybe you should use relative paths, not full ones? If the script is public_html/cart/index.php, and you want to link it to your home/****/shopping directory, do this

$WebRoot=../../shopping/

use .. to go up one directory, and move around like that. Also, by the error message, looks like you are missing a file, Cart.php. If cart.php, which you're trying to open is in the same directory as the script you're running, just do this:

$WebRoot=Cart


If I'm making no sence, it's because I know Jack about PHP, but from what I've seen, its very similar to PERL.