473,395 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 2287
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.