[resolved] Can't get doc root to stay put in a local project |
|
[second hour using phped]...the first hour was spend on this: [can't find include files]
can-t-find-include-files-t4363.html Sorry to bother everyone...but I don't have any spare hair to pull out... Have this folder structure [jfg is the Project and is highlighted] jfg ...css-folder ......user.css ...functions-folder ......display_header.php ......display_user_menu.php ...test-folder ......testmenu.php ... ...testmenu.php ... ============= testmenu.php <? include("functions-folder/display_header.php"); include("functions-folder/display_user_menu.php"); display_header("test", "title"); display_user_menu("Profile","Summary"); ?> ============= display_header.php <? // output the html header function display_header ($parent, $child) { print ('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'."\n"); print ('<html>'."\n"); print ('<head>'."\n"); print ('<title>'.$parent.'-'.$child.'</title>'."\n"); print ('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'."\n"); print ('<link href="css-folder/user.css" rel="stylesheet" type="text/css">'."\n"); ... ============= display_user_menu.php // outputs a horizontal menu list with style defined in css-folder/user.css ============= When I execute testmenu.php from the root directory the user.css file is found. When I execute testmenu.php from a subfolder the user.css file is not found...and it shouldn't make a difference. At first the included files in "functions" couldn't be found until I edited the php.ini file to include the path to the jfg folder. What is wrong with this execution environment? My project preferences say the root points to C:\jfgProject\jfg. It appears that the root is being changed to the directory containing the file being run [where run starts]...which should not be the case. The root should stay root...and all partial paths appended to the root. Am I doing something really stipid... ...[or expecting too much]? |
||||||||||||
|
Site Admin
|
It certainly makes defference. Please check with php manual: http://www.php.net/include/ SRV server is not involved An excerpt from php manual: Files for including are first looked for in each include_path entry relative to the current working directory, and then in the directory of current script. |
||||||||||||||
_________________ The PHP IDE team |
Not [resolved]...still hoping for an explaination |
|
dmitri...since you are the site admin...maybe you can find out WHO changed the title of this thread to [resolved]...which I find rude and inconsiderate.
You did not answer my question...no body has yet [sufficiently]. Thank you Blizz for taking a crack at it. My question was about why the .css file wasn't found. That has nothing to do with php or includes...but with the webserver and html. On almost all sites in the html header is a definition like this:
The link is a partial path...which is applied to the web root. When I execute my test in PHPed it doesn't work to have the .css files in a folder in what I believe to be the /ROOT of this sudo webserver running in PHPed. So maybe I still don't get IT. What does the entry in the project properties called "Root Directory" do for us? I assumed [maybe wrongly so] that when you run scripts within that project...the Root Directory is applied as the web root or /www or /public.html or whatever. If that is not the case...do I have to start all of my scripts [using run/profile/debug] from a file located in the root of the "currently selected" project in order for PHPed to emulate the same action as on a web server? Is PHPed setting the current working directory to the folder containing the file I am running/profiling/debuging in? Which means that any partial path will fail. |
||||||||||||||
|
Site Admin
|
Not at all. It's a relative path and is appended to the URL.
sorry, my answer was not accurate, neither php scripts nor phped project is involved. Indeed, let's see what happans when a css file is referred with a relative path, like in your case. If you open say test.html with http://somesite/test.html and it refers to css/my.css, my.css will be loaded from http://somesite/css/my.css If you open test1.html located in a subdirectory, say http://somesite/subdir/test1.html and it also contains a referrence to css/my.css, latter one will be loaded from http://somesite/subdir/css/my.css Hope it's clearer now. |
||||||||||||||||
_________________ The PHP IDE team |
[resolved] Can't get doc root to stay put in a local project |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by