By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

including files in other directories

P: n/a
I have some code running on windows on my local machine that uses the
jpgraph image library. I include the jpgraph libs using

include ("C:\Programming\php\jpgraph-1.14\src\jpgraph.php");

I am trying to get this code to run on my web host's unix server, with
no luck.
I put the folder (jpgraph) containing all the jpgraph libs in the same
directory as my php code. I have tried all of the following:

include ("/jpgraph/jpgraph-1.14/src/jpgraph.php"); //(relative
path)

include ("jpgraph/jpgraph-1.14/src/jpgraph.php"); //(relative
path without leading slash)

include ("/usr/www/users/mysite/jpgraph/jpgraph-1.14/src/jpgraph.php");
//(absolute path)

include("http://www.mysite.com/jpgraph/jpgraph1.14/src/jpgraph.php");
//(url)

include ("http://" . $_SERVER['HTTP_HOST']
. "/" . dirname($_SERVER['PHP_SELF'])
. "/" . "jpgraph/jpgraph-1.14/src/jpgraph.php");

None of these have worked. Does anyone know the proper technique to
include files in other directories when using Unix or Linux? Keeping
all php files in the same directory is not feasible.

Thanks,

Esoos
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ebobnar <eb*******@yahoo.com> wrote or quoted:
include ("jpgraph/jpgraph-1.14/src/jpgraph.php"); //(relative
path without leading slash)


That should normally work.
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #2

P: n/a
ebobnar wrote:

I have some code running on windows on my local machine that uses the
jpgraph image library. I include the jpgraph libs using

include ("C:\Programming\php\jpgraph-1.14\src\jpgraph.php");

I am trying to get this code to run on my web host's unix server, with
no luck.
I put the folder (jpgraph) containing all the jpgraph libs in the same
directory as my php code. I have tried all of the following:
include ("jpgraph/jpgraph-1.14/src/jpgraph.php"); //(relative
path without leading slash)


This should work (or the absolute path). You also have to make sure the owner
of the PHP files have permission to access the directory and the libraries.
What are the permissions set to on the directory and files? What error are you
getting? --> error_reporting(E_ALL)

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.