Ask a Question related to PHP Development, Design and Development.
-
jpb #1
Help with paths
I have been using SSI would like to start using php
From what I have seen php does not support absolute paths like SSI
eg
<!--#include virtual="/inc/css-gateway.inc" -->
will work: but
<? include("/inc/css-gateway.inc") ?>
Warning: main(/inc/css-gateway.inc) [function.main]: failed to create
stream: No such file or directory in
/home/jpb/public_html/www/de/immobilien/main.php on line 15
Fatal error: main() [function.main]: Failed opening required
'/inc/css-gateway.inc' (include_path='.:/usr/share/php') in
/home/jpb/public_html/www/de/immobilien/main.php on line 15
<? include("../../inc/css-gateway.inc") ?>
this works as intended.
Is there any way of declaring the server "/" and using absolute path?
Paul
jpb Guest
-
How do I do this... re-paths
I am sure that this is a simple task, and hopefully I can give an uncomplicated description of what I am trying to do. I have a complex rectangular... -
Strokes to paths
Is there a quick and easy way to convert strokes to paths (defined as a vector) in MX? -
Bringing paths into Photoshop from AI as PATHS
What happened to bringing paths into Photoshop from Illustrator as PATHS? Used to be able to copy paths into Photoshop from AI 8 as a path. Can this... -
Paths
Hi All After converting text to paths, is it possible in FH9 to unconvert it after it has been saved so undo won't work -- Kind Regards Gina... -
need general help with setting paths & man paths for apps
On Thu, 10 Jul 2003, solaris newbie wrote: That is one way, but a (perhaps) beter way would be to modify PATH in individual user's .profile. ... -
Kevin Thorpe #2
Re: Help with paths
jpb wrote:
try> I have been using SSI would like to start using php
>
> From what I have seen php does not support absolute paths like SSI
> eg
> <!--#include virtual="/inc/css-gateway.inc" -->
> will work: but
>
> <? include("/inc/css-gateway.inc") ?>
<?php include("$_SERVER[DOCUMENT_ROOT]/inc/css-gateway.inc"); ?>
Kevin Thorpe Guest
-
jpb #3
Re: Help with paths
On Fri, 24 Oct 2003 13:16:27 +0100, Kevin Thorpe wrote:
Thank you> jpb wrote:>>> I have been using SSI would like to start using php
>>
>> From what I have seen php does not support absolute paths like SSI eg
>> <!--#include virtual="/inc/css-gateway.inc" -->
>> will work: but
>>
>> <? include("/inc/css-gateway.inc") ?>
> try
> <?php include("$_SERVER[DOCUMENT_ROOT]/inc/css-gateway.inc"); ?>
It seems to work.
Paul
jpb Guest
-
John Downey #4
Re: Help with paths
jpb wrote:
Since SSI was designed to be used from inside Apache it takes the root> I have been using SSI would like to start using php
>
> From what I have seen php does not support absolute paths like SSI
> eg
> <!--#include virtual="/inc/css-gateway.inc" -->
> will work: but
>
> <? include("/inc/css-gateway.inc") ?>
>
>
>
> Warning: main(/inc/css-gateway.inc) [function.main]: failed to create
> stream: No such file or directory in
> /home/jpb/public_html/www/de/immobilien/main.php on line 15
>
> Fatal error: main() [function.main]: Failed opening required
> '/inc/css-gateway.inc' (include_path='.:/usr/share/php') in
> /home/jpb/public_html/www/de/immobilien/main.php on line 15
>
> <? include("../../inc/css-gateway.inc") ?>
> this works as intended.
>
>
> Is there any way of declaring the server "/" and using absolute path?
>
> Paul
>
>
>
>
of the system to be your webroot. PHP is not so limited it will always
think your system root is / or C:\ on windows. I don't know of any way
to change this action.
--
John Downey
[url]http://delusive.dyn.ee[/url]
[url]http://sage.dev.box.sk[/url]
[url]http://blacksun.box.sk[/url]
John Downey Guest
-
jpb #5
Re: Help with paths
On Fri, 24 Oct 2003 14:26:53 +0200, jpb wrote:
Well that was a short lived " I finally got something working"> On Fri, 24 Oct 2003 13:16:27 +0100, Kevin Thorpe wrote:
>>>> jpb wrote:>>>>> I have been using SSI would like to start using php
>>>
>>> From what I have seen php does not support absolute paths like SSI eg
>>> <!--#include virtual="/inc/css-gateway.inc" -->
>>> will work: but
>>>
>>> <? include("/inc/css-gateway.inc") ?>
>> try
>> <?php include("$_SERVER[DOCUMENT_ROOT]/inc/css-gateway.inc"); ?>
> Thank you
>
> It seems to work.
>
> Paul
On my Linux box:
echo $_SERVER[DOCUMENT_ROOT] ->/home/jpb/public_html/www and it works;
but on the server
echo $_SERVER[DOCUMENT_ROOT] ->/usr/local/apache/htdocs
the error log complain with the following
[Fri Oct 24 10:38:07 2003] [error] PHP Warning:
main(/usr/local/apache/htdocs/inc/css-gateway.inc): failed to open stream:
No such file or directory in
/mnt/home/www/canadian-dream.com/www/de/immobilien/main.php on line 15
[Fri Oct 24 10:38:07 2003] [error] PHP Warning: main(): Failed opening
'/usr/local/apache/htdocs/inc/css-gateway.inc' for inclusion
(include_path='.:/usr/local/lib/php') in
/mnt/home/www/canadian-dream.com/www/de/immobilien/main.php on line 15
So I guess it's back to the old SSI.
Paul
jpb Guest



Reply With Quote

