473,382 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 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 3530
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.