Ack! Includes failing...need help with PHP!

Entity

Lifer
Oct 11, 1999
10,090
0
0
I'm running a little script that combines with phpdbform classes to write a bunch of different forms to the screen. For whatever reason, though, I can't get the darned thing working...here's the error I get:
Fatal error: Failed opening required '/phpdbform/phpdbform_field.php' (include_path='.:/usr/share/pear') in /var/www/cvOnline/phpdbform/phpdbform_textbox.php on line 11
Normally that'd be a simple error for me. The main thing I notice is that the script is calling for the directory /phpdbform/, which doesn't exist.

However, in the script, it's not calling for that directory:
require_once("$base/phpdbform/phpdbform_field.php");

I checked, and $base is initialized, and is what I need it to be. Any idea why the require_once isn't passing $base through?

Additionally, even when I copy the files (and check chmod permissions, etc.) to /phpdbform/, I still get the error. :|

thanks,
Rob
 

RSMemphis

Golden Member
Oct 6, 2001
1,521
0
0
I think PHP includes work best with relative paths.

As you said yourself, the php.ini files normally searches for includes at . and also in the base directory.
If you give a relative path from the local directory, or possible from the base directory, it may work.

Alternatively, tell php.ini where to look for includes (edit php.ini and change the include_path, by adding another colon : and then the path to it).
 

RSMemphis

Golden Member
Oct 6, 2001
1,521
0
0
Also, is $base the absolute "unix" path or the absolute "web" path. If anything, it should be the absolute "web" path.
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Originally posted by: RSMemphis
Also, is $base the absolute "unix" path or the absolute "web" path. If anything, it should be the absolute "web" path.

It's the absolute web path. I'm still working on it, thanks for the tips...

Rob