Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Permission denied to create new pdf file using fopen php function in "wb" mode.
i am using dotproject 2.0.4 on fc3.
it is working fine.
but i want to generate pdf file report during this time i face permission denied problem.
Warning: fopen(/var/www/html/dotproject/files/temp/temp1.pdf): failed to open stream: Permission denied in /var/www/html/dotproject/modules/projects/reports/tasklogs.php on line 307
Could not open file to save PDF.
when i run below test php file using command line it will create file at particular location.Code: Select all
<?php
$file = fopen("/var/www/html/dotproject/files/temp/test.txt","w");
print $file;
$file1 = fopen("/var/www/html/dotproject/files/temp/test1.pdf","wb");
print "hai $file1";
?>as i conclude it is problem with related to permission for user.
bec when i run from command line it runs with the permissions of the user who started the script means root if i login as root user.
but from web browser it runs as web browser user.
in my httpd.conf file user and group is as follow
User Apache
Group Apache
how to set permission so web browser user also can access file and create file.
so can any one help to resolve permission problem
it resolves my many issue related to permission.
thanks
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]