A bug in configuration with path interpreting

Use GitHub to post bug reports and error descriptions for phpwcms. Describe your problem detailed!
Locked
Robert Zelnik
Posts: 3
Joined: Thu 15. Jan 2004, 20:06
Location: Bratislava
Contact:

A bug in configuration with path interpreting

Post by Robert Zelnik »

I installed phpwcms (1.1RC2_2004-01-11c) not directly into the www-root directory, but into demo/phpwcms subdirectory. So my conf.inc.php looked like this:

$phpwcms["site"] = "http://127.0.0.1/";
...
$phpwcms["root"] = "demo/phpwcms";

The problem is that the user administration does not work - if I click to the user to edit it, it writes the error:

Not Found
The requested URL /phpwcms.php was not found on this server.

So I changed my config.inc.php to this:

$phpwcms["site"] = "http://127.0.0.1/demo/phpwcms/";
...
$phpwcms["root"] = "demo/phpwcms";

Now the user administration works well, but any other functions do not work. For example 'save page layout' returns this:

Not Found
The requested URL /demo/phpwcms/demo/phpwcms/phpwcms.php was not found on this server.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

hi Robert,
I think your problem is with '$_SERVER['DOCUMENT_ROOT']' within include/inc_lib/default.inc.php.

you should edit default.inc.php to replace this variable with the physical path.
change this code...

Code: Select all

define ("PHPWCMS_ROOT", preg_replace('/\/$/', '', $_SERVER['DOCUMENT_ROOT']).(($phpwcms["root"]) ? "/".$phpwcms["root"] : "") );   // DOCUMENT_ROOT + phpwcms directory
to this ...

Code: Select all

define ("PHPWCMS_ROOT", "Drive:\wwwroot\subdir".(($phpwcms["root"]) ? "/".$phpwcms["root"] : "") );   // DOCUMENT_ROOT + phpwcms directory
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

DO NEVER USE \ (BACKSLASH) IN PATH NAMES. THIS CAN WORK - MOST TIMES IT WILL MAKE TROUBLE.

If you hardcode the path do it like every PHP path:
"C:/My_Parth/Here/again" or uif you want to use backslashes "C:\\My_Parth\\Here\\again"

I have checked - I use a local install on Windows XP - and it works well with sub/sub/subdir (I tested "1/2/3").

Maybe it will help to set $_SERVER["DOCUMENT_ROOT"] to the path you like in conf.inc.php like this:
$_SERVER['DOCUMENT_ROOT'] = "C:/My_Parth/Here/again";

Local site should link to "http://localhost/" - not "http://127.0.0.1/"

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Robert Zelnik
Posts: 3
Joined: Thu 15. Jan 2004, 20:06
Location: Bratislava
Contact:

Post by Robert Zelnik »

I don't want to hardcode the path, I think it not solves the problem. I have also changed $phpwcms["site"] to "http://localhost/", but it not helped.

In my opinion the problem is that in the user administration it generates this html:

<tr bgcolor="#FFFFFF" onMouseOver="bgColor='#DBFF48'" onMouseOut="bgColor='#FFFFFF'" onClick="location.href='http://localhost/phpwcms.php?do=admin&s=2&u=1';">

Correctly it should be

...onClick="location.href='http://localhost/demo/phpwcms/phpwcms.p ... in&s=2&u=1';"

or maybe

...onClick="location.href='phpwcms.php?do=admin&s=2&u=1';"

For your info: I use Linux.
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Yes you are right,
but only if you click on white cell space - move mouse direct over user's name and click again - or click edit button. Then it will work.

Image

reset your paths to standard defaults - not patched one.

site = http://localhost/
path = demo/phpwcms

I will fix the onMouseOver link in next release. No really error.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Robert Zelnik
Posts: 3
Joined: Thu 15. Jan 2004, 20:06
Location: Bratislava
Contact:

Post by Robert Zelnik »

It depends on a browser. In Mozilla it works as you write (only if I click on white cell space...), but in Konqueror (my default browser) it works wrong if I click anywhere (also over user's name or edit button).

You are right, Oliver, it is not a big bug. Thank you for your quick and solid response. phpwcms is the best easy-to-use CMS that I have ever seen. :)

Robert
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Then Konqueror uses the JavaScript Click link first - fxxx.

OK next release...
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Locked