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
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
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
>>> 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
Best Regards,
- Raheem