You are not logged in.

#1 2005-12-09 12:18:06

atze
Member
From: Netherlands (Leiden)
Registered: 2005-10-22
Posts: 76
Website

Writing with PHP/Apache fails

Hello everybody,

I have Apache and php5 installed (from the default repo's). Ive written an script which resizes images en creates thumbnails. Well i get this strange error:

Warning: mkdir() [function.mkdir]: Permission denied in /home/httpd/html/resize.php on line 11

Warning: mkdir() [function.mkdir]: Permission denied in /home/httpd/html/resize.php on line 14
data/groep.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'resized/groep.jpg' for writing in /home/httpd/html/functions.php on line 10
data/groep.jpg
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'resized-tb/groep.jpg' for writing in /home/httpd/html/functions.php on line 10
data/pa211933.jpg
...
...
...
etc etc

somehow php/apache can't cannot write in this directory. I have tried it in de document root and in the userdir.

Has anybody any idea how to solve this problem?

Greetinx Atze

Offline

#2 2005-12-09 14:12:30

neri
Forum Fellow
From: Victoria, Canada
Registered: 2003-05-04
Posts: 552

Re: Writing with PHP/Apache fails

your apache is running as nobody:nobody out of the box. You prolly have other permissions on the files in /home/httpd/html/*
So you have apermission error.

-neri

Offline

#3 2005-12-09 14:22:02

atze
Member
From: Netherlands (Leiden)
Registered: 2005-10-22
Posts: 76
Website

Re: Writing with PHP/Apache fails

Yea, i got that idea already, but how do i solve this problem without changing premissions everytime?

Offline

#4 2005-12-09 14:35:21

neri
Forum Fellow
From: Victoria, Canada
Registered: 2003-05-04
Posts: 552

Re: Writing with PHP/Apache fails

atze wrote:

Yea, i got that idea already, but how do i solve this problem without changing premissions everytime?

Files in the wwwroot are always meant to be oned by the user running the daemon, except you have certain tasks you want prevent from happen smile

if this is your developerbox and not the actual online project you can make restrictions a bit lower, Your options:
- run apache as "yourname":users
- make yourself member of the nobody group and make the file permissions 664 instead of 644
- ... many others here

-neri

Offline

Board footer

Powered by FluxBB