I have an Apache server running on a Linux OS and when I try to mkdir() using PHP to my /var/www/html/dotproject/f
iles directory I get the following error message :
[client 172.16.0.234] PHP Warning: mkdir(/var/www/html/dotpro
ject/files
/159): Permission denied in /var/www/html/dotproject/m
odules/fil
es/files.c
lass.php on line 63, referer:
http://172.16.0.120/dotproject/index.php?m=files&a=addedit&project_id=159&file_task=1788I can use the same module to mkdir in the /tmp directory without a problem.
the file system permissions for /var/www/html/dotproject/f
iles 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/dotpr
oject/file
s/testerne
w1", 0777); <===== fails
?>
Any help would be appreciated.
Start Free Trial