| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in May 2004
Lives in South Dakota
Hosted on Liquid
132 posts
Gave thanks: 0
Thanked 0 times
|
PHP FTP Help
Ok, here's the problem. I'm writing a new PHP FTP program for my website UploadSystem.com. I'm at the point where I'm trying to upload a file, but it seems as though server settings have placed a bottleneck on my progress. Here's the error:
Warning: move_uploaded_file(): open_basedir restriction in effect. File(/boatreceipt.gif) is not within the allowed path(s): (/home/phpconsu/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/phpconsu/public_html/uploadsystem/include/classes.inc.php on line 368 Is there anyway around this? I know PHP pretty well, so I'm not sure who can actually help me on this problem.
__________________
Thanks! Brandon Dedicated Servers: liquid.hostglory.com www.modmyspace.com www.uploadsystem.com |
|
|
|
|
|
#2 (permalink) |
|
All Ur Base R Belong 2 Us
Excelling Contributor
Joined in Feb 2005
Lives in Vegas & New York
824 posts
Gave thanks: 2
Thanked 6 times
|
Error seems to stem from the path of the uploaded file, or the destination you've set for that file. I'm assuming it would be the uploaded file's path, from the error would appear to be "/boatreceipt.gif"
PHP Code:
__________________
Nobody doing nothing |
|
|
|
|
|
#3 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in May 2004
Lives in South Dakota
Hosted on Liquid
132 posts
Gave thanks: 0
Thanked 0 times
|
Well, the code there is exactly what I have right now. I believe it may actually be a setting in PHP with the safe_mode variable set to off. From what I've gathered, PHP checks the authenticity of a file being uploaded by the user who uploads it. Every folder has a user associated with it, and if the user name who's uploading a file doesn't match the user of the folder the file is being uploaded to, then it gives this error.
__________________
Thanks! Brandon Dedicated Servers: liquid.hostglory.com www.modmyspace.com www.uploadsystem.com |
|
|
|
|
|
#4 (permalink) |
|
All Ur Base R Belong 2 Us
Excelling Contributor
Joined in Feb 2005
Lives in Vegas & New York
824 posts
Gave thanks: 2
Thanked 6 times
|
That would cause the problem. Are you uploading from one website to another? I was under the impression that you were using the uploadsystem.com site to have users upload to uploadsystem.com, if it's a different set up, what's the set up like
__________________
Nobody doing nothing |
|
|
|
|
|
#5 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in May 2004
Lives in South Dakota
Hosted on Liquid
132 posts
Gave thanks: 0
Thanked 0 times
|
Ok, I played around with path of the file being uploaded and I seem to have gotten it to work. But, the actual file itself isn't uploaded, just the filename is created with the code I'm using at the moment. The safe_mode variable isn't an issue. And, I'm trying to accomplish giving users the ability to upload files from their local computer. Anyway, here's the code I'm playing with:
PHP Code:
__________________
Thanks! Brandon Dedicated Servers: liquid.hostglory.com www.modmyspace.com www.uploadsystem.com |
|
|
|
|
|
#6 (permalink) |
|
All Ur Base R Belong 2 Us
Excelling Contributor
Joined in Feb 2005
Lives in Vegas & New York
824 posts
Gave thanks: 2
Thanked 6 times
|
I believe since you're trying to move the file into /tmp/ is the reason you're getting the error. On my site I move it from the uploaded file into /home/myuser/public_html/tmp/(file)
As you were mentioning earlier, I don't believe the php page has access to writing files in the tmp directory directly (as in the case of the move), so try moving the file to another path, and that should work. At least my experience with the scenario tells me so.
__________________
Nobody doing nothing |
|
|
|
|
|
#7 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in May 2004
Lives in South Dakota
Hosted on Liquid
132 posts
Gave thanks: 0
Thanked 0 times
|
Ok, here's my updated code. It doesn't give me any errors, but it still will not upload the file:
PHP Code:
__________________
Thanks! Brandon Dedicated Servers: liquid.hostglory.com www.modmyspace.com www.uploadsystem.com |
|
|
|
|
|
#8 (permalink) |
|
All Ur Base R Belong 2 Us
Excelling Contributor
Joined in Feb 2005
Lives in Vegas & New York
824 posts
Gave thanks: 2
Thanked 6 times
|
Well some of the specifics have been stripped, but here's the basic jist of my code
PHP Code:
__________________
Nobody doing nothing |
|
|
|
|
|
#9 (permalink) | |
|
Surpass Fan
Comfy Contributor
Joined in May 2004
Lives in South Dakota
Hosted on Liquid
132 posts
Gave thanks: 0
Thanked 0 times
|
Ok, I'm returning with my problem, but I have some more insight on how things need to work. Here's my code now and below that the error I receive:
PHP Code:
Quote:
__________________
Thanks! Brandon Dedicated Servers: liquid.hostglory.com www.modmyspace.com www.uploadsystem.com |
|
|
|
|