H I O X INDIA
FREE PHP Topics
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch Portuguese Japanese தமிழ்
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

PHP Topics
Introduction
Syntax
Data Types
Variables
Operators
Control Structures
Functions
Pre-defined Function
Calendar Functions
Date and Time
Array Functions
Array Functions List1
Array Functions List2
Math Functions
PHP Mysql Functions
File Handling
Error Handling
DB Size
PHP Mail
String Tokens
String Functions
String Functions List1
String Functions List2
Session Functions
Cookies Functions
Form Variables
Running PHP from JS
Array To JS
Array to PHP
Encryption
Common Header
Ask Your Doubts
More about PHP
Feedback





File Permission and Usage


Topic

I am getting "failed to open stream: Permission denied in....line 32" why?
How can I stop "failed to open stream" exception?



Explanation

Each file will have its own properties.
It can be a 'read only' file or a file that cannot even be read.
The permission for each file can be modified. There are basically three levels "read/write/execute".
If we are doing a write operation in a file, proper write permission should be given to that file.

Example:
In the below example we show the permission denied issue. Here we try to write in to a file called "test5.txt", which does not have write permission.

<?php
$file1 = "./test5.txt";
$open = fopen($file1, "w");
fwrite($open,"test"); ?>

As a result we get the permission denied exception.


How to set Permission / stop permission denied:
The permission can be set using the filemanager / ftp tools.
Upload the file. Go to filemanager/ ftp tool, select the file and change the permission to required value.




privacypolicy     licence     sitemap
© 2004-2010 HIOX INDIA