View Full Version : Error when trying to upload photo?
August 14th, 2005, 03:47 AM
Warning: move_uploaded_file(/home/build/public_html/photopost/uploads/1/grandesunset.jpg): failed to open stream: Permission denied in /home/build/public_html/photopost/image-inc.php on line 37
Warning: move_uploaded_file(): Unable to move '/tmp/phpMmVvnJ' to '/home/build/public_html/photopost/uploads/1/grandesunset.jpg' in /home/build/public_html/photopost/image-inc.php on line 37
August 14th, 2005, 06:55 AM
Hello your uploads and data directories as well as all of there subdirectories need to be CHMOD to 777 to be able to allow uploads
August 27th, 2005, 02:33 PM
I'm having similar troubles. All works OK except for image uploads. I set /uploads and /data and the children to 777. Still I get the following errors.
oh btw, apache is uid 501 and the site account is uid 515
Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 515 is not allowed to access /var/www/html/sites/forums/html/pp_classifieds/data/6 owned by uid 501 in /var/www/html/sites/forums/html/pp_classifieds/image-inc.php on line 53
Unable to move file [/tmp/phpT9OfGB] [/var/www/html/sites/forums/html/pp_classifieds/data/6/3Image6.jpg]
August 27th, 2005, 05:16 PM
Hello per our feature requirements safe mode must be off on the server to ensure proper operation of the program.
August 29th, 2005, 02:06 PM
No decent host is going to run their servers without safemode are they? :confused:
I have a number of other PHP apps that are able to upload/modify/execute files within my site's directory even with Safemode enabled. With open_base dir limiting scripts ability to read/write outside the site's root dir there should be no reason that PhotoPost Classifieds can't fully modify the files within my site directories.
Can someone explain how PPClass is different than other photo apps that can sun in safe mode?
Is there no work around like a change to my site's config files?
August 29th, 2005, 02:21 PM
99% of all hosts I know of run safe mode OFF
Basically with safe mode on you can not create the directories for categories or user upload directories.
Not many apps of this nature are safe mode compatible. There may be one or two but it means dumping all files into one directory which severily limits how many files you can have since directories are not infinite.
August 29th, 2005, 09:06 PM
Admittedly I'm not a good PHP developer but couldn't something like this be implemented?
Use the move_uploaded_file() function to move the file to a temporary location before assigning final filename. If you use move_uploaded_file(), you can access the temporary uploaded file.
August 29th, 2005, 09:18 PM
move_uploaded_file has nothing do to with it
The problem is the creation of the categories and user upload directories that I noted.
Our software states explicitly that safe mode must be off.
Something we can look into but for the future the only way around it is as I noted to dump everything into one uploads directory and one data directory which is not necessarily a good thing.
August 29th, 2005, 09:22 PM
>> Something we can look into
That is what I'm trying to help with. Do you want to continue to discuss this?
I have a PHP developer who thinks he can help fix this problem.
August 29th, 2005, 09:42 PM
Well I know how to code up the program to work with safe mode just as I stated above but there are things to consider like severily limiting storage since things would need to be stored in one spot.
When I stated something we can look into I mean we would consider supporting safe mode in a future version of the software.
August 29th, 2005, 09:58 PM
>> your uploads and data directories as well as all of there subdirectories need to be CHMOD to 777 to be able to allow uploads
Since Safe-Mode cares about ownership and not really about the dir permissions (it's comparing the UID of the PHP script acct [Apache] vs. the UID of the FTP [user] acct.) How does changing dir. permissions help? I tried this when I first found this thread and it had no effect. Do you mean that I need to change the owner of the /upload and /data dirs ?
Thanks for you quick replies...over and out for tonight...
August 29th, 2005, 11:22 PM
well nowhere in this thread have I said anything about permissions.
Basically with safe mode directories will not be created is what I have said
August 30th, 2005, 06:13 AM
Sorry, I was looking at this post:
CHMOD to 777 to be able to allow uploads
Basically with safe mode directories will not be created
Are you creating sub dirs via PHP in the /data and /upload directories? It appears as if that's what happening.
Also I think I see why your app has trouble where my other photo manipulation apps dont. Here is the error I see....
Unable to move file
It appears that PHP is trying to move an image file it created
from the /tmp/* directory by traversing across ACCOUNTS & SITES (which Safemode doesn't allow) to /var/www/html/sites/.....etc ????
Is this correct?
August 30th, 2005, 08:22 AM
Thats right your trailing on someone else's post so I know I never told you that directly which is why you threw me off ;) . Yes if directories are not 777 files cant move. This would be the issue of someone who did not follow the installation instructions correctly. It's probally the single most common support responce next to cookie settings. Here are the installation instructions
Now on to your questions!
Yes subdirectories are created in those directories that would be correct. A numeric identifier for the categories under data and in uploads the user userid. Not uncommon as the top 3 gallery programs I know all do the same and are incompatible also with safe mode as a result from what I show.
As far as how PHP moves or uploads files ALL file uploads go through PHP's tmp directory then are moved to wherever. This is just how PHP works. You never see this error unless you dont have permissions set right. You know how when you install programs they say certain directories need to be 777 ;) This is why in most cases
Now unless there are any other support issues that have not been answered our requirements clearly state safe mode must be off on the requirements page. That said there is nothing more of a support nature I can add here.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.