July 21st, 2000, 03:03 AM
I'm having a complete nightmare trying to get this to work - including files (e.g. with <?require( '/templates/front.php3');?> ) on my home, development machine.
The problem seems to lie in the document_root - but however I change it in either httpd.conf or php3.ini, it never seems to work.
I have Apache 1.3.9 running on my Win '98 machine and I have various virtual hosts running by adding e.g.
to the httpd.conf file. Usually then, when I want to use a simple SSI tag as I have in the past, to include something (text.html) inside the "inframe" folder for example, I simply include "/text.html" to ensure it works from whichever directory I'm in.
However, I'm now trying to learn PHP, and I can't seem to get this to work, with the leading slash. i.e., <?require( '/templates/front.php3');?> will not work, but <?require( 'templates/front.php3');?> will.
At present in php3.ini, include_path = . and doc_root = [nothing] - although I have tried various other suggestions.
If anyone knows what I need to do to get this to work - please let me know. It's really...really frustrating.
July 21st, 2000, 07:00 AM
By using the leading slash you are indicating that the path starts at root (I know you are in Win but that's how PHP interprets it) so in this case probably from C:
July 21st, 2000, 10:23 AM
Yes, but for most other things, such as IMG tags or SSI tags, the leading slash is indicating the document root to be c:/usr/etc/htdocs/inframe - and I know this is how the PHP tags should be working too...if I can only find out what line I need to change in php3.ini or httpd.conf or some other file.
July 21st, 2000, 01:55 PM
Then set that path to the include path in php.ini, but you still must leave off the leading slash.
July 21st, 2000, 03:50 PM
But with Devshed, looking at the source for the pages, shows the leading slash being used, as I wish to use it. For other things - such as SSI tags, a document root doesn't need to be set separately, and if I was to set the document root for one virtual server (which I can't do anyway with what I've tried) then I can only use one virtual server with PHP - not the dozen or so that I have to use.