• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

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

Entity

Lifer
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
 
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).
 
Also, is $base the absolute "unix" path or the absolute "web" path. If anything, it should be the absolute "web" path.
 
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
 
Back
Top