fopen & fwrite function is not working from browser?

Posted by ungalnanban on Stack Overflow See other posts from Stack Overflow or by ungalnanban
Published on 2010-06-07T06:24:27Z Indexed on 2010/06/07 6:32 UTC
Read the original article Hit count: 215

Filed under:

fopen function is not working in php.

I wrote the following code in my php file.

            $fh =  fopen("/home/sugumar/Public_html/sugumar/public_html/123","a+");

            fwrite($fh,"hello");

I ran this code from command line: php file_name.php its working fine. But If I run this code from browser it shows the following error.

Warning: fopen(Logs/add_employee.logs) [function.fopen]: failed to open stream: Permission denied in /home/sugumar/Public_html/sugumar/public_html/HRMS/HRMS_add_emp_DB.php on line 111

Warning: fwrite(): supplied argument is not a valid stream resource in /home/sugumar/Public_html/sugumar/public_html/HRMS/HRMS_add_emp_DB.php on line 113

how to solve this problem?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about php