Click to See Complete Forum and Search --> : PHP Document Root problem
Hi all!
I have a problem with my php under windows NT server 4.0.
On some sites, the php script thinks that his documkent root is under winnt\system32.
But with other sites it works correctly on the same computer.
The settings are the same.
What is the problem?
Thanx for your help.
foxden
12-14-2001, 01:13 PM
Is every user using relative URL's? Or, are they calling them directly?
I'm sorry, but i don't fully understand your question.
The users use relative URL's.
What do you mean "calling them directly"?
foxden
12-17-2001, 10:28 AM
Sorry about that, what I meant was do they call pages by <a href="index.php"> or do they use <a href="http://www.whatever.com/index.php">
Josh
They always use the url without the full URL. So just the file name eg. <a href="index.php">
I don't know what's that...
foxden
12-17-2001, 11:09 AM
On my windows install (which was only serving my development efforts) I saw problems when I didn't call each page by the full url, in my case it was <a href="localhost/doc_root/index.php">
Isn't this what your experiencing?
No, my problem is different.
For example, I want to use a hit counter. I store the number in a txt file. I want the php script to use this file. This txt file is in the same directory as the php file. But the php script look for this file in winnt\system32. WHY??? :)
But on the same computer under an other site everything works correctly.
That is what I dont understand.
foxden
12-17-2001, 11:48 AM
Are you opening that text file with the specific directory? Same as what I was talking about earlier. I prefer to store that in MySQL, but here is a sample from the manual:
$fp = fopen ("c:\\data\\info.txt", "r");
I tried it with the full directory path, and it works. Eg.: e:\domains\FTP\something.com\šomething.php
BUT!!! These php files were made by my costumers. And I dont want that they know their directory path!!!
foxden
12-17-2001, 01:15 PM
I'm not sure unless there is a way to 'direct' directories with your virtual hosts information in the web server config. I know in Apache, there is a doc root directory for each virtual host that is configured, and they don't have access or visibilty to any other directories with the permission settings on the OS.
Yes, that's true.
But I DON'T want to use the e:\something\somathing form with the filenames in the PHP source.
I want to solve the problem. But I don't know, what is it exactly and how to do it...
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.