Advertisement

02.02.2005 at 04:14PM PST, ID: 21299508
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

permission denied with mkdir on Apache/PHP

Asked by drdewm in PHP Scripting Language

Tags: , , , ,

I have an Apache server running on a Linux OS and when I try to mkdir() using PHP to my /var/www/html/dotproject/files directory I get the following error message :
[client 172.16.0.234] PHP Warning:  mkdir(/var/www/html/dotproject/files/159): Permission denied in /var/www/html/dotproject/modules/files/files.class.php on line 63, referer: http://172.16.0.120/dotproject/index.php?m=files&a=addedit&project_id=159&file_task=1788

I can use the same module to mkdir in the /tmp directory without a problem.

the file system permissions for /var/www/html/dotproject/files are as follows:
drwxrwxrwx  40 apache apache    4096 Feb  1 15:06 files

the user/group portion of my HTTPD.conf are as follows:
User apache
Group apache

output from check.php is as follows:
dotProject System Checks
MySQL      Available      OK
MySQL Server Version      
MySQL Database Connection      Connected      OK
MySQL Database Select      Selected      OK
Operating System      Linux trippliteis2 2.6.9-1.667smp #1 SMP Tue Nov 2 14:59:52 EST 2004 i686
PHP Version      4.3.10      OK
Server API      apache2handler
Web Server      Apache/2.0.52 (Fedora)
User Agent      Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
default locale      C
session.auto_start      0      OK
session.save_handler      files
session.save_path      /var/lib/php/session      OK
session.serialize_handler      php
session.use_cookies      1      OK
session.use_trans_sid      0      OK
file_uploads      1      OK
/locales/en directory writable            Warning: you will not be able to save translation files. Check the directory permissions.
/files directory writable            Warning: you will not be able to upload files. Check the directory permissions.
/files/temp directory writable            Warning: you will not be able to make PDF's. Check the directory permissions.
root_dir      /var/www/html/dotproject      OK

All other aspects of the Apache/PHP server with the MySQL backend are functional from browsing to database entries. The only issue I have is with using the PHP under Apache to do the mkdir() and file functions. I can log into the Apache account and issue mkdir directives wihtout a problem it's only when the calls are made through Apache/PHP.

the PHP code is as follows:
<?php
mkdir("/tmp/testernew1", 0777);  <==== works fine
?>
<?php
mkdir("/var/www/html/dotproject/files/testernew1", 0777);   <===== fails
?>

Any help would be appreciated.

Start Free Trial
[+][-]02.02.2005 at 10:38PM PST, ID: 13211236

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: permission, denied, php, mkdir, apache
Sign Up Now!
Solution Provided By: nicholassolutions
Participating Experts: 1
Solution Grade: C
 
 
[+][-]02.03.2005 at 10:07AM PST, ID: 13217134

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.04.2005 at 02:32PM PST, ID: 13463205

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42