472,371 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

Permission denied when creating a file in PHP

other interesting thing i observe during my work which i describe below:

i am using dotproject2.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.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $file = fopen("/var/www/html/dotproject/files/temp/test.txt","w");
  3. print $file;
  4. $file1 = fopen("/var/www/html/dotproject/files/temp/test1.pdf","wb");
  5. print "hai $file1";
  6. ?>
[Please use CODE tags when posting source code. Thanks! --pbmods]


but when i run this php file in web browser it would not create file.

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.

i have change all directory permission to 777 and also test file permission.

/var/www/html/test/

but still it will not working.

it resolves my many issue related to permission.

is there any other issue?


thanks in advance
Jun 29 '07 #1
1 3434
pbmods
5,821 Expert 4TB
Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as 'problem' actually get FEWER responses?).
Jun 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Andy | last post by:
Hi I have created a facility to allow the user to upload an image file to the webserver. When the user creates the image for the first time i.e. the image does not exist within the directory...
4
by: stephen | last post by:
Hi, I am getting an error while trying to create an excel file. "Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the...
4
by: nitinpatel1117 | last post by:
Hi I am trying to delete a csv file using the unlink() function, but i keep getting a permission denied warning Warning: unlink(UsedNOS200704191.CSV): Permission denied in...
0
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to...
9
by: Tony Proctor | last post by:
I need to create a process Singleton object for an ASP application, but I'm having some odd issues In my GLOBAL.ASA, I have an <OBJECTelement specifying the relevant ProgID with RUNAT=Server and...
3
gagandeepgupta16
by: gagandeepgupta16 | last post by:
hi I need urgent help on this please.... i am a newbie in PHP. i am using php on windows and IIS 5.1 i am working on counter module for website... i have a text file that contains the...
0
by: private.anders | last post by:
Hi David! Really need assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: private.anders | last post by:
Really need your assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: Tim Golden | last post by:
aditya shukla wrote: Why on earth are you *specifying* c:\python25 as the directory for this file? It's automatically created in your user-specific temp directory which has specific permissions...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.