By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,304 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,304 IT Pros & Developers. It's quick & easy.

File upload problem

P: 30
I developed a simple file manager a while ago in it worked perfectly until we switched hosting.

Now I can't upload files to any folder created through the file manager. If I create a folder in FTP, I can then upload anything to it using the file manager.

I suppose the problem is that when I create a directory from php it has different user & group than when I create it using FTP, since both folders get the right permissions (777).

Any ideas on how to solve this problem? safe_mode is enabled... could that be the problem?

Thanks
Fede
Apr 24 '07 #1
Share this Question
Share on Google+
7 Replies


100+
P: 136
Hi,

php script is executed by apache. So using it if u create a directory then apache becomes the user of the directory. As a result u can't upload a file in that dir. To solve this u need to give the permission (777) and change the user of the dir using the same or different php script.

susen
Apr 24 '07 #2

P: 30
Hi,

php script is executed by apache. So using it if u create a directory then apache becomes the user of the directory. As a result u can't upload a file in that dir. To solve this u need to give the permission (777) and change the user of the dir using the same or different php script.

susen
I don't understand. If apache creates a directory, why can't it also upload files to it? I tried changing owner with chown and chgrp but it didn't work, and the directory already has chmod 777 :(

Thanks for your help!
Apr 24 '07 #3

100+
P: 136
Hi,

I hope u r getting some error. If not try to get the error then it will easier to understand the problem. Still it seems to me some permission problem happening.

susen
Apr 27 '07 #4

code green
Expert 100+
P: 1,726
The XAMMP package contains php, Apache and an FTP application Filezilla. They all seem compatible and I have Filezilla running to download files from a remote to a local server. I can't remember how I configured it, but Filezilla and Apache are compatible
Apr 27 '07 #5

P: 30
I finally got error_reporting working (damn display_errors was set to Off by default) and this is what I get:

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 10022 is not allowed to access /var/www/vhosts/x.com/httpdocs/admin/archivos/test owned by uid 48 in /var/www/vhosts/x.com/httpdocs/admin/sections/files_publish.php on line 26

I'll try disabling safe_mode, but I think it's not something I can set.

Thanks
Fede
Apr 28 '07 #6

P: 30
It worked by disabling safe_mode :D
May 1 '07 #7

100+
P: 136
thats gr8. :)

It worked by disabling safe_mode :D
May 2 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.