Web App fails when moved to production environment. Which server permissions do I need?

Posted by Ashley Ward on Stack Overflow See other posts from Stack Overflow or by Ashley Ward
Published on 2010-06-10T14:38:33Z Indexed on 2010/06/10 14:42 UTC
Read the original article Hit count: 255

Filed under:
|
|
|

I have developed a small web app.

This app allows users to upload images. It also produces text files with the names of those images (the names are stored and retrieved to/from an MySQL Database.)

I have developed this app using MAMP. To create the uploaded image files I use the PHP function

imagejpeg('my/path/name.jpg')

and to delete the files I use the PHP function

unlink('folder1/folder2/name.jpg')

to write to the text document I am using the function

fopen('folder1/folder2/name.txt', 'w')

all three of these functions produce errors related to permissions - now the site has been moved to a live hosting environment.

Why is this? and what permissions do I need to set the folder's folder1 and folder2 to?

I know that permission 777 is generally bad because it opens up your server to the public. However what I have found is that the functions fail to work unless I use 777 on the folders. Can anyone shed any light on my dilemma?

© Stack Overflow or respective owner

Related posts about php

Related posts about server