PHP communtiy problem!
Hi!
I have a problem with my community made in PHP. When i want to go to a certain part of my admin area this come up: Warning: main(plugins/admin/dbmaintenance.swe.lang.php): failed to open stream: No such file or directory in /home/www/djben80.freeunixhost.com/system/core/admin/admin.plugins.inc.php on line 41
Fatal error: main(): Failed opening required 'plugins/admin/dbmaintenance.swe.lang.php' (include_path='.:/usr/local/lib/php') in /home/www/djben80.freeunixhost.com/system/core/admin/admin.plugins.inc.php on line 41
How do i solve this problem?
andy206uk posted this at 14:04 — 23rd July 2004.
He has: 1,758 posts
Joined: Jul 2002
The error indicates that the script is trying to use a language module (swedish?) and it can't find the file. Have a look in the folder indicated for the file and if it's not there you need to find the file and put it in the folder.
Andy
andy206uk posted this at 14:05 — 23rd July 2004.
He has: 1,758 posts
Joined: Jul 2002
Sorry... bad use of words there... I mean directory. not folder. (my techy pals always tell me off for calling them folders!).
OtterBob posted this at 14:21 — 23rd July 2004.
He has: 46 posts
Joined: Jun 2004
That was the hardest part about switching to Win95. In DOS and Win3.x they were directories. In Win95 they suddenly became folders. But in *nix they were still directories. And some things in Win95 still talked about directories. AAARGHH!
I call them whichever doesn't get me a quizical look from whoever I'm talking to.
"In theory, there's no difference between theory and practice. In practice, there is." -- Yogi Berra
OtterBob posted this at 14:17 — 23rd July 2004.
He has: 46 posts
Joined: Jun 2004
If I'm understanding what's going on correctly, PHP is actually looking for /home/www/djben80.freeunixhost.com/system/core/admin/plugins/admin/dbmaintenance.swe.lang.php. In other words, it's looking for plugins/... in the same directory as the .php file.
Without knowing your directory structure it's hard to tell where everything lives. I can't really guess the structure so I wont. If you want to require "plugins/..." and /plugins in in the document root, you'll have to use enough "../" to go up to the document root and then put "plugins/...". If you're familiar with navigating directories with "." and ".." in DOS or *nix then that's all you're really doing. If you're not familiar with this then either post the relevant directory structure (like /system/core/admin and /system/plugins/admin or however they fall under your document root) or ignore this COMPLETELY and use the following suggestion.
(The document root is the directory that holds your main index file.)
I forget all about this relative directory stuff and use $DOCUMENT_ROOT (or $_SERVER['DOCUMENT_ROOT']. I'm assuming that /system is in the document root. So I would:
require($DOCUMENT_ROOT./"system/plugins/admin/dbmaintenance.swe.lang.php");
This way it doesn't matter WHAT your document root is, PHP can find the file to require. This comes in handy if you change hosts since your path to the document root is almost certain to change.
I hope this helps (and makes some kind of sense).
"In theory, there's no difference between theory and practice. In practice, there is." -- Yogi Berra
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.