|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Errors with define()
Hi all,
In an include file, I have defined directories like this: PHP Code:
This is so I can access (include) the same files from within different files that are stored in different directories and levels. Problem is, I get errors like Failed opening 'http://pouggey/myown/includes/tplstuff.php' for inclusion (include_path='.;F:\php\pear\') in f:\www\mysite\styles\edit\tpl001.php on line 93 Odd thing is, 'http://pouggey/myown/includes/tplstuff.php' is the exact location where the file is to be found! So it must have something to do with Pear? Thing is, if I just type in the path to the include file, it works... Anybody got any ideas? Thanks, Toine |
|
#2
|
||||
|
||||
|
So you're script (with the defines) is being called from within 'http://pouggey/myown'?
you may want to try this: define('DIR_SITE', HTTP_SERVER . '/myown/'); define('DIR_INCLUDES', DIR_SITE . '/includes/'); notice the first forward slash, which relates to root... you may have to use /myown/includes/ (not sure your exact directory layout) See if you get the same error... |
|
#3
|
|||
|
|||
|
Yes, that gives me the same error (except I get double forward slashes now).
Here are the first few lines of definitions.php: PHP Code:
Then I call the includes like this: PHP Code:
So now my error message is: Failed opening required 'http://pouggey//myown//includes/db.php It works when I use it like this: PHP Code:
(note the " ' . " before the "DIR_CSS".) How can I get around this please? ~*~*~*~*~ UPDATE: I have uploaded some of the files to my Web Host, just to see what happens on a Linux server (I currently run WinNT at home). There I get this error message: Quote:
Line 3:--> require(DIR_INCLUDES . 'db.php'); |
|
#4
|
|||
|
|||
|
It looks like the a bug which was in PHP.
us @include instead of include and see what happens. http://bugs.php.net/bug.php?id=24053 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Errors with define() |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|