ello???

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
lilyminako
Forum Newbie
Posts: 7
Joined: Thu Mar 16, 2006 10:20 pm

ello???

Post by lilyminako »

I had developed a simple upload application using php...

I had tested the upload in local machine (example: http://localhost/myrootdirectory/index.php) and it works...

:cry: but when i move the application to hosting server (example: http//www.mydomain.com/index.php) , the upload doesn't work, the error was the files which been chosen to be uploaded couldn't copy into directory ( directory created to store uploaded files in website root directory) in server. Is it because of the server doesn't allow someone to write file into directory or i don't have the permission to write file into directory? I couldn't catch the error that cause this uploading fail.....

Thank you :?
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Forum Rules wrote:Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
Is there any error message being printed to the browser after you try uploading the file? You may need to change the directory's permissions to allow writing (I think its chmod 700).
lilyminako
Forum Newbie
Posts: 7
Joined: Thu Mar 16, 2006 10:20 pm

uploading problem

Post by lilyminako »

first of all, sorry for the misleading topic been posted just now...

the error appear for sometimes only, which is change permisson to 0755 fail...but this error also appear during testing in local machine ( localhost) and the file still bein copy into the directory .....

thanx for the reply... :?
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Copy and paste the error here
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

change the permissions for the directory in question to 777...
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

nickvd wrote:change the permissions for the directory in question to 777...
:s

755
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Change your thread title please.... I don't particularly want to have to do it for you and right now nobdoy knows what your thread is about without reading it.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Jenk wrote:
nickvd wrote:change the permissions for the directory in question to 777...
:s

755
How is apache going to write to a directory it does not have write permission to? Unless it's run in safe mode or suid it wont work... I would be nice if more hosts are configured to allow non 777 directories, but right now, that's not the case...
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Because hosts will configure apache (or rather the PHP executable) to run under the user id of the client (i.e. you)
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

I have yet to see a host who configures things that way, hence the vast amount of documentation that (unfortunately) recommends writable directories being 777.

Don't get me wrong, I agree with you, I HATE having to set things to 755, but you do whacha gotta do.
Post Reply