Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

include file path

4 views
Skip to first unread message

Raheem

unread,
Aug 20, 2008, 11:21:29 AM8/20/08
to
Hello,

I built a development version of a live website on my hosted account.
However the development version is having problems with finding
include files. After troubleshooting I was able to resolve the issue
by removing the ../ from the beginning of the include file path. But
now I am looking at making this modification hundreds of times in all
kinds of files. I'd like to keep the dev env similar to the live env
so I can port changes easily. Below is an example of working and non-
working include file definitions:

working - include_once("dblib/db_con.php");
non-working - include_once("../dblib/db_con.php");

But I dont understand why this would work in one server and not the
other. Is there some kind of setting in htaccess or php.ini that would
affect this? The dev env is running php 5.2.6. Appreciate your help.

- Raheem

J.O. Aho

unread,
Aug 20, 2008, 11:54:09 AM8/20/08
to
Raheem wrote:
> Hello,
>
> I built a development version of a live website on my hosted account.
> However the development version is having problems with finding
> include files. After troubleshooting I was able to resolve the issue
> by removing the ../ from the beginning of the include file path. But
> now I am looking at making this modification hundreds of times in all
> kinds of files. I'd like to keep the dev env similar to the live env
> so I can port changes easily. Below is an example of working and non-
> working include file definitions:
>
> working - include_once("dblib/db_con.php");
> non-working - include_once("../dblib/db_con.php");

Keeping the last one, do

ln -sfn dblib ../

If your file system don't support symlinks, then you know why it didn't work
on your machine and why it worked on the live system.


--

//Aho

Raheem

unread,
Aug 20, 2008, 12:23:48 PM8/20/08
to

Aho,

Thanks for the tip - this looks like a good solution. I am not
familiar with symlinks so I read wikipedia and have a little bit of an
understanding. I created the symlink as per your advice but no go. I
created the symlink in the httpdocs folder using the above command.

-- dblib symlink
-- httpdoc
---- index.php
---- main.php (this file calls dbcon.inc)
---- dblib folder
------- dbcon.inc
---- images folder

Thanks,

- Raheem

J.O. Aho

unread,
Aug 20, 2008, 12:48:55 PM8/20/08
to
Raheem wrote:
> On Aug 20, 11:54 am, "J.O. Aho" <u...@example.net> wrote:
>> Raheem wrote:

>>> working - include_once("dblib/db_con.php");
>>> non-working - include_once("../dblib/db_con.php");
>> Keeping the last one, do
>>
>> ln -sfn dblib ../

Sadly I have to correct myself, it should be

ln -sfn httpdoc/dblib ../

We are assuming that your pwd is the httpdoc directory.

--

//Aho

Raheem

unread,
Aug 20, 2008, 1:02:31 PM8/20/08
to
Yes! Yes! Yes! That did it! The whole friggin dev site is working -
not a single broken link! AWESOME!
Thank you soo much, Aho! :)

Best Regards,

- Raheem

0 new messages