472,989 Members | 3,089 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 software developers and data experts.

Help with paths

jpb
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


Jul 17 '05 #1
4 2269
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"); ?>
Jul 17 '05 #2
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") ?>

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

Since SSI was designed to be used from inside Apache it takes the root
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
http://delusive.dyn.ee
http://sage.dev.box.sk
http://blacksun.box.sk

Jul 17 '05 #3
jpb
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

Jul 17 '05 #4
jpb
On Fri, 24 Oct 2003 14:26:53 +0200, jpb wrote:
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


Well that was a short lived " I finally got something working"

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

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Timothy Madden | last post by:
Hello all I'm trying to include some files in an included file. Think of some scripts like this /index.php /scripts/logging.php /scripts/config.php /scripts/db_access.php
1
by: malcolm | last post by:
Hello, We have a small team building a project that involves some 30 or so c# assembly dlls. It is a client server application with 1 exe as the starting point. The dlls and exe are sharing an...
8
by: nick | last post by:
I have a problem and I've been using a cheezy work around and was wondering if anyone else out there has a better solution. The problem: Let's say I have a web application appA. Locally, I set...
0
by: Chris Gill | last post by:
I'm trying to use cookieless sessions in asp.net using the InProc mode (for various reasons it is not desirable for us to use the other modes if it is possible to avoid them). My problem revolves...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
3
by: JeffDotNet | last post by:
I wrote a small data processing application that writes a summary of several hundred files. I use drag and drop on a panel (Panel1) to grab the absolute path to each of these files. Then I begin...
5
by: costantinos | last post by:
Hello. I have implemented the Dijkstra shortest path algorithm, it works fine but I have one question on how I can improve something. I want to find all the possible shortest paths from a node...
6
by: Jon Slaughter | last post by:
do I have to prefix every absolute path with document root to get it to work? For some reason I thought that prefixing a path with '/' or './' with make it absolute w.r.t to document root but I...
1
by: schellu | last post by:
i'm new to python script , i'm getting following error while executing AttributeError: class 'org.python.modules.os' has no attribute 'walk' my code is : class Client(Object): def...
5
by: Justin | last post by:
Here's my XML: <?xml version="1.0" ?> <AppMode Type="Network"> <CurrentFolder Path="c:\tabs"> <Tabs> <FilePath>tabs\Justin.tab</FilePath> <FilePath>tabs\Julie.tab</FilePath> *****There could...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.