I'm currently trying to set up a login system, so from my index.php page I'm trying to include db_connect.php (which connects to my database). When I run the index.php page with:

<?php 
include('db_connect.php');
?>

at the top, I get this error:

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 really sure what's going on. I'm pretty much open to any way to fix this or get around it.

    are index.php and db_connect.php in the same directory? if not then you will need to specify the server path to db_connect.php in your include statement.

      "failed to open stream: Operation not permitted" sounds similar to a permissions issue... perhaps check permissions on those files and, if nothing else, ask your host to take a look?

        It's almost certainly an permissions issue, most likely that the everyone readable flag is not set on the include file.

          Write a Reply...