Unix Paths question

Hello,
I have a file structure that is exactly the same on 2 different
servers:
On one, this works:
<?php require_once('../Connections/xxx.php'); ?>

on another, that doesnt work but this does:
<?php require_once('Connections/xxx.php');?>

any reason??

Thanks
Mike
ampeloso [ Mi, 03 Oktober 2007 00:28 ] [ ID #1834300 ]

Re: Unix Paths question

On Tue, 02 Oct 2007 22:28:59 -0000, Mike <ampeloso [at] gmail.com> wrote:

>Hello,
>I have a file structure that is exactly the same on 2 different
>servers:
>On one, this works:
><?php require_once('../Connections/xxx.php'); ?>
>
>on another, that doesnt work but this does:
><?php require_once('Connections/xxx.php');?>
>
>any reason??
>


The Include path (in php.ini and/or .htaccess)
?
--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>
David Quinton [ Mi, 03 Oktober 2007 08:52 ] [ ID #1835081 ]

Re: Unix Paths question

Mike wrote:
> Hello,
> I have a file structure that is exactly the same on 2 different
> servers:
> On one, this works:
> <?php require_once('../Connections/xxx.php'); ?>
>
> on another, that doesnt work but this does:
> <?php require_once('Connections/xxx.php');?>
>
> any reason??

Are you sure you have the Connections/xxx.php on the same relative paths on
the both servers

Say you are in /home/username/public_html

Then to the first one to work, you will need the file located in

/home/username/Connections/xxx.php

for the second one to work, the file need to be located in

/home/username/public_html/Connections/xxx.php


You can also set a include directory that is always checked when including
files, in that case the file may be located in

/var/php/include/Connections/xxx.php

and can be included with

require_once('Connections/xxx.php');

as Devid pointed out, check the php.ini.

--

//Aho
Shion [ Mi, 03 Oktober 2007 18:29 ] [ ID #1835185 ]
PHP » alt.php » Unix Paths question

Vorheriges Thema: manage a string for take namefile
Nächstes Thema: PHP for Windows