Howaida Khoureieh
Howaida Khoureieh

Reputation: 559

(PHP): Warning: include_once, failed to open stream: Permission denied

Im learning how to write a Sign Up page using Php and Mysql (XAMPP).

Now, I downloaded the source code in this website:

http://net.tutsplus.com/tutorials/php/create-a-signup-form-with-email-confirmation/

and tried to make sure it works. But when openning:

 http://localhost/source/index.php

I got the following warnings:

Warning: include_once(C:\xampp\htdocs\source\inc\php\config.php) [function.include-once]: failed to open stream: Permission denied in C:\xampp\htdocs\source\index.php on line 3

Warning: include_once() [function.include]: Failed opening 'inc/php/config.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\source\index.php on line 3

Warning: include_once(C:\xampp\htdocs\source\inc\php\functions.php) [function.include-once]: failed to open stream: Permission denied in C:\xampp\htdocs\source\index.php on line 4

Warning: include_once() [function.include]: Failed opening 'inc/php/functions.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\source\index.php on line 4

Here are the lines where I got the warnings:

<?php

include_once 'inc/php/config.php';
include_once 'inc/php/functions.php';
.
.

Any Help?

Upvotes: 2

Views: 37701

Answers (3)

aliawadh980
aliawadh980

Reputation: 468

Try to set the folder permission to '754'. Only the folder permission.

Upvotes: 0

Yang
Yang

Reputation: 8711

Replace this:

include_once 'inc/php/config.php';
include_once 'inc/php/functions.php';

with

include_once dirname(__FILE__) . '/inc/php/config.php';
include_once dirname(__FILE__) . '/inc/php/functions.php';

Upvotes: 6

Tom Walters
Tom Walters

Reputation: 15616

Much of the time using full paths like that is disabled in PHP for security reasons, try changing the paths in your include statements to being relative.

Upvotes: 0

Related Questions