installing google chart library on the server
I just copied the library folder on the root directory of my net server . i.e. /var/www .
and used
require ( 'GChartPhp/gChart.php' ) ;
in my code on the file graph.php. ERROR : But, for some reason , the browse开发者_如何学JAVArs do not load this (graph.php) file .
However, I did the same on my local wamp server and my I am able to run the file. I have no idea what I need to additionally do for this linux / apache server .
Thanks
I suppose the include_path
is not configured the same way on your two servers : you might have to add either the WAMP equivalent of /var/www
or .
to it.
Modifying the include_path
can be done by editing your php.ini
file, or using set_include_path()
at the beginning of your scripts.
Another possible solution would be to use an absolute path to the file you are including -- which can be done using something like this :
include dirname(__FILE__) . '/GChartPhp/gChart.php';
Notes :
__FILE__
will correspond to the full path to the file in which you write it- And using
dirname()
on it will get you the path to the directory which contains that file.
Which means that this line will use an absolute path... but written relatively to the file in which you put that line.
精彩评论