Help - Search - Members - Calendar
Full Version: Error With Include Function
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
Banu
Warning: include(db_connect.php) [function.include]: failed to open stream: Operation not permitted in /www/vndv.com/t/a/l/talhi/htdocs/index.php on line 2

Warning: include() [function.include]: Failed opening 'db_connect.php' for inclusion (include_path='.:/usr/lib/php') in /www/vndv.com/t/a/l/talhi/htdocs/index.php on line 2


I'm not sure what to do to fix this.
MrTouz
Basically what INCLUDE does is 'bring' a document next to the one you are using.

The code tells the page to bring the file db_connect.php, now it can bring it... most likely because it is not in the correct path or it is just not here.
Try to find out where the db_connect.php file is and point it correctly in your index.php if it's in a folder make sure you mention it.
Banu
Both index.php and db_connect.php aren't in a folder. I can see them both there. I'm not sure why it can't find it but I see it right next to my index file...
ionux
Make sure the permissions and ownership on the file you are trying to include are correct for this operation. The web server user needs read perms.
Banu
QUOTE(ionux @ Feb 24 2009, 08:50 PM) *
Make sure the permissions and ownership on the file you are trying to include are correct for this operation. The web server user needs read perms.


The permissions on the file I'm connecting to are all checked. Is there something else I need to do to allow it?
Memorywipe
Probably Zymic doesn't allow the PHP Include Function.
swordz
The include function is allowed and works as it should.

swordz
Andrew
Post your php from index.php here (from lines 1-5) just so we can see if you have a syntax error.
Soul Of Me
Use require instead:

CODE
<?php require 'index.php'; ?>


That gives you more information.
Farid Media
Copy/paste this:

CODE
include ("db_connect.php");
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.