Page 1 of 1

PHP script not allowed to create folders on server

Posted: Thu Sep 22, 2005 5:23 am
by igorski
First of all, I'm a a total code noob. I can understand PHP code enough to understand what it's doing, but my forté lies on the graphic design of the site.

Now, I have a gallery script I used for a client of mine - a photographer - which basically:

allows a user to create folders on the webserver
upload files (JPEG photos) to these folders
generate thumbnails from the photos
and store the data in a flat-file 'database' (it contains all links and comments and such)

files and images can also be deleted, of course.

Now on the server for that client everything works, but when I test it on my own server... THE SCRIPT WON'T WORK.

I have all the necessary stuff: PHP support, installed GD library and have CHMODded all the relevant directories to 777. Basically, everything is setup like I did on my clients site that's hosted on a different server.

I think the problem is down to when I want to create a new directory (through the script), I either : can't create it, or I can't get the script to CHMOD that new directory to 777 so I can upload the photos to it. If the directory already EXISTS (if I for instance created it in my FTP program and CHMODded it there), there's no problem. But when the script tries to do this, it fails.

So I'm aware this isn't a PHP question - seeing how the script functions and all - but I hope someone can shed light as to how I can get my own server to give the srcipt writing permissions.

I'm totally flabbergasted here :(

Posted: Thu Sep 22, 2005 5:28 am
by dude81
I think better using chown and chmod functions of php will get u solved this issue.