Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: WACOMalt on March 29, 2006, 03:52:39 AM
-
ok, so I have this problem on my server, no one can upload avatars to my phpBB forum. the folders are chmodded correctly and everything.
now many people have this problem, and finnaly someone found a workaround. Here is what they said:
areacode212 wrote:
I had this problem the other day, and came across this solution on another site. Basically, I had to add something for "upload_tmp_dir" in php.ini
Quote:
Solution is on the surface (as always, though).
1. Create folder anywhere on server’s local drive. For example, “C:\Inetpub\TempUploads”
2. Set to your server’s internet user account ( IUSR_<computer name> by default) full NTFS rights to this folder.
3. Edit your php.ini to contain these directives:
Code:
file_uploads = On
upload_tmp_dir = "C:\Inetpub\TempUploads\"
4. Remember to set to your server’s internet user account full NTFS rights to folder, which you set in forum configuration at Administration > General Admin > Configuration > Avatar Settings > Avatar Storage Path.
5. Have fun.
Problem cause: This PHP issue. PHP config says that “Temporary directory for HTTP uploaded files will use system default if not specified”, but it couldn’t because Internet user account NEVER has access to server’s (Win2k/XP/2k3) TEMP folder.
After I did this, I restarted Apache, and avatar uploading worked.
now, hopefully that will work for me, but can anyone tell me, first, what do do for steps 1 and 2, as it look slike this was written from a win machine. and then tell me where php.ini is and how to add the requested data.
Thanks in advance.
-
ok, so I have this problem on my server, no one can upload avatars to my phpBB forum. the folders are chmodded correctly and everything.
now many people have this problem, and finnaly someone found a workaround. Here is what they said:
areacode212 wrote:
I had this problem the other day, and came across this solution on another site. Basically, I had to add something for "upload_tmp_dir" in php.ini
Quote:
Solution is on the surface (as always, though).
1. Create folder anywhere on server’s local drive. For example, “C:\Inetpub\TempUploads”
2. Set to your server’s internet user account ( IUSR_<computer name> by default) full NTFS rights to this folder.
3. Edit your php.ini to contain these directives:
Code:
file_uploads = On
upload_tmp_dir = "C:\Inetpub\TempUploads\"
4. Remember to set to your server’s internet user account full NTFS rights to folder, which you set in forum configuration at Administration > General Admin > Configuration > Avatar Settings > Avatar Storage Path.
5. Have fun.
Problem cause: This PHP issue. PHP config says that “Temporary directory for HTTP uploaded files will use system default if not specified”, but it couldn’t because Internet user account NEVER has access to server’s (Win2k/XP/2k3) TEMP folder.
After I did this, I restarted Apache, and avatar uploading worked.
now, hopefully that will work for me, but can anyone tell me, first, what do do for steps 1 and 2, as it look slike this was written from a win machine. and then tell me where php.ini is and how to add the requested data.
Thanks in advance.
Your php.ini is located in the /etc directory, however do not edit this file as it is build from templates. These templates cam be fount in the /etc/e-smith folder. Have a look here: The SME Developer Guide, Chapter 7. Configuration file templates (http://mirror.contribs.org/smeserver/contribs//gordonr/devguide/html/devguide.html#TEMPLATES)
About your needs... the user that httpd is running under is called www on SMEServer 7, so you should give this user rights to a temporary upload directory, however I don;t think it is neccesarry to create a extra directory as on the *NIX systems the /tmp folder is most of the times writeable by the webserver, so your best bet is to simply use the /tmp folder (or create a subdirectory in there) for your temporary upload directory.
As I remember correctly file uploading is enabled by default on the SMEServer, you can simply check using the following command
cat /etc/php.ini | grep file_uploads
This will look for the file_uploads section in your php.ini file if it is there it will display the setting, if not you should modify your templates to have it implemented in the php.ini file.
To set the temporary ipload directory in your php.ini file do this:
mkdir -p /etc/e-smith/templates-custom/etc/php.ini
cp -p /etc/e-smith/templates/etc/php.ini/60FileUploads /etc/e-smith/templates-custom/etc/php.ini
Now edit the copy of the original template file we just put in the templates-custom directory:
pico /etc-e-smith/templates-custom/etc/php.ini/60FileUploads
At the bottom enter the following code:
upload_tmp_dir = /tmp
Press Ctrl-X, confirm save with Y, and press enter as we do not want to modify the filename.
Expand the template:
expand-template /etc/php.ini
Verify that the settings you made are incorporated in the /etc/php.ini file:
cat /etc/php.ini | grep upload_tmp_dir
And restart the httpd deamon:
/etc/rc7.d/S86httpd-e-smith sigusr1
-
There is actually no need to do all of that all you need to do is what Charlie said in WACOMalt original post here http://forums.contribs.org/index.php?topic=31126.0
Quote From Charlie...
There's no need to change any templates to change those limits. The configuration database has properties for all those values:
config setprop php MemoryLimit nnnn
config setprop php PostMaxSize mmmm
config setprop php ploadMaxFilesize pppp
expand-template /etc/php.ini
/etc/rc7.d/S86httpd-e-smith restart
End Quote
If this doesn't work as above then rasie a Bug in the Bug Tracker.
-
There is actually no need to do all of that all you need to do is what Charlie said in WACOMalt original post here http://forums.contribs.org/index.php?topic=31126.0
Quote From Charlie...
There's no need to change any templates to change those limits. The configuration database has properties for all those values:
config setprop php MemoryLimit nnnn
config setprop php PostMaxSize mmmm
config setprop php ploadMaxFilesize pppp
expand-template /etc/php.ini
/etc/rc7.d/S86httpd-e-smith restart
End Quote
If this doesn't work as above then rasie a Bug in the Bug Tracker.
And waht about the temporary upload directory? It is not specified in the php.ini file by default so my guess is that you might need to configure it, or does php by default use the /tmp directory for that?
-
It won't make any difference if you set the upload_tmp_dir to /tmp. SME will not allow php to access it due to the open_basedir restriction that is in place on all Ibays. This is a security feature to stop malicious php code from accessing the server outside the Ibay.
See http://no.longer.valid/phpwiki/index.php/TroubleshootingFAQ#php_basedir
I think you might find your problem is even simpler than that.
First make sure that phpBB is configured to use /images/avatars as the upload folder then make sure that /images/avatars is world writable i.e the permissions are set to 666.
Jon
-
It won't make any difference if you set the upload_tmp_dir to /tmp. SME will not allow php to access it due to the open_basedir restriction that is in place on all Ibays. This is a security feature to stop malicious php code from accessing the server outside the Ibay.
See http://no.longer.valid/phpwiki/index.php/TroubleshootingFAQ#php_basedir
I think you might find your problem is even simpler than that.
First make sure that phpBB is configured to use /images/avatars as the upload folder then make sure that /images/avatars is world writable i.e the permissions are set to 666.
Jon
we (all of the people with this problem) has set the upload directory (images/avatars) to 777. would 666 fix this?
but we have tried 777, which I thought was full access. The people with this problem use many different servers, from windows to this SME server.
now, I want to complete the instructions I posted in the first post, because everything else has failed, are the instructions that "cactus" posted the ones I should use to do what the original post said? just modified for SME?
Im sorry if I seem not responsive to your suggestions, but beleive me, this workaround needs to be done, it is a bug in phpBB or so it seems, about how the avatar uploads are handled. even if everything is set right, permissions are right and everything, it does not work, but yet my attach file mod works.. so I think its just how the avatars are handled. Now, this workaround alone should force it to work. so thats all I need to know. I will try cactus's suggestion when I get home, and if that doesnt work I will try to set the permissions to 666 rather than 777, but all of the phpBB upload settings are correct.
-
It won't make any difference if you set the upload_tmp_dir to /tmp. SME will not allow php to access it due to the open_basedir restriction that is in place on all Ibays. This is a security feature to stop malicious php code from accessing the server outside the Ibay.
See http://no.longer.valid/phpwiki/index.php/TroubleshootingFAQ#php_basedir
I think you might find your problem is even simpler than that.
First make sure that phpBB is configured to use /images/avatars as the upload folder then make sure that /images/avatars is world writable i.e the permissions are set to 666.
Jon
I believe php is able to write to the /tmp directory for temporary processes as it is also able to write session data there, if not you can alter the open_basedir setting analogue to this thread: Enabling PEAR in an ibay (http://forums.contribs.org/index.php?topic=31355.msg131811#msg131811)
-
thank you all for your suggestions!, but now, it seems there are many different overlapping instructions...
exactly what should I do to do the instructions int he original post?
I know there are other, possibly better ways to do it, but can someone tell me what to do, with only the changes that HAVE to be done for it to work at all?
-
Ok, I have just installed phpBB to try this out.
To be able to upload Avatars you need to disable the php_basedir restriction that is in place and allow php in that ibay access to tmp. Note that does decrease the security of your server.
http://no.longer.valid/phpwiki/index.php/TroubleshootingFAQ#php_basedir
Use the commands exactly as shown, remembering to replace <ibayname> with the correct ibay.
You need to chmod /images and everything inside it as 777 otherwise users wont be able to delete avatars.
Cactus, in SME the only PHP application that has access to /tmp by default is Horde
Jon
-
Thank you JonB I will try this tommorow.
and the default ibayname would be Primary right?
that what area all of my files are dragged to to put stuff online.
-
Ok, I followed that word for word, and the ibay I use is called Primary.. so I put that inplace of <ibayname> I finished exactly as they said, and all seemed to go well.
..but now my forums dont work at all..
I restarted my server, and still no luck.
Ok, so I want to try this again, as I have tried so many things, I think a past change may have screwed with THIS change. so is there a way to reset all PHP settings? or every template and php.ini file back to how they are on a fresh SME install?
thank you very much for the help, I beleive this is the right fix, but I also see that I screwed something up along they way.
-
please, the forums are the main part on my site, I need to at least get them back up!
so Im bumpin :/
how do I reset all php settings?
-
What does
#db accounts show Primary
say.
Jon
-
What does
#db accounts show Primary
say.
Jon
I get the following:
Primary=ibay
CgiBin=enabled
Group=shared
Modifiable=no
Name=Primary i-bay
PHPBaseDir=/home/e-smith/files/ibays/Primary/tmp
PasswordSet=no
Passwordable=no
PublicAccess=global
Removable=no
UserAccess=wr-admin-rd-group
I assume the PHPBaseDir shouldnt be set to tmp, so now how to fix?
-
Correct, you didn't set the PhpBaseDir correctly.
To remove the database entry
# db accounts delprop Primary PHPBaseDir
to add correctly
# db accounts setprop Primary PHPBaseDir /home/e-smith/files/ibays/Primary/:/tmp
# signal-event ibay-modify Primary
Watch the line wrap. The first line is all one line.
Jon
-
Thank you JonB, I'll do this when I get home. now will this make all my setting basically back to default? or will this be the fix applied correctly?
-
Correct, you didn't set the PhpBaseDir correctly.
To remove the database entry
# db accounts delprop Primary PHPBaseDir
to add correctly
# db accounts setprop Primary PHPBaseDir /home/e-smith/files/ibays/Primary/:/tmp
# signal-event ibay-modify Primary
Watch the line wrap. The first line is all one line.
Jon
Ok, I just did that. and horray! the forum works, AND I cna upload images. but now, a new problem. the images dont load. I just get little red Xs. I got the URL of the little red X, the uploaded image that wont show, it is http://www.wacomalt.com/phpBB2/images/avatars/1458286300443c08b62e397.jpg so it is there, good. but it gives the error:
"Forbidden
You don't have permission to access /phpBB2/images/avatars/1458286300443c08b62e397.jpg on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request."
k, so it looks like my chmodding did not help. I thought I had that folder set to 777. I will retry that, but what else can I try to fix THIS problem?
-
"Forbidden
You don't have permission to access /phpBB2/images/avatars/1458286300443c08b62e397.jpg on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request."
k, so it looks like my chmodding did not help. I thought I had that folder set to 777. I will retry that, but what else can I try to fix THIS problem?
How abot ownership of the direcotry and the images in there?
-
hmm, actually, the chmod somehow got set back, and beleive me, it WAS set to 777 (I checked) anyways, its set back, and works now. fully.
Thank you everyone for the help.