View Full Version : Using function libraries with my PHP Script. How?

07-28-2002, 03:59 PM
Hi. I have a function library that I want to use with a script I am writing. I am using the include("script.php"); command inside my script but when I use any of the functions it tells me they are undefined. What am I doing wrong? Thanks.

07-28-2002, 06:40 PM
I used phpinfo() to look at the server configuration of my remote server. I specifically looked at

include_path .:/usr/local/lib/php .

I am trying to use a class file in the


part of my php script. do i need to put "script.php" into this location? If so - how do i access .:/usr/local/lib/php ?


07-29-2002, 03:57 AM
Where is your class? if its in the same directory then it should work, PHP looks first at where you say your script is , oin your case the same directory & if it can not find it there it looks in your include path (which you really would not be using on a shared host)

but are you getting an error from the include() ?
require('script.php');echo "script.php has been found";

if your page does not die at that line then your class has been included but there is an error within it which is why you get undefined function warnings