Koozali.org: home of the SME Server

URGENT! Some PHP settings I need to change...

WACOMalt

URGENT! Some PHP settings I need to change...
« on: March 11, 2006, 02:31:45 AM »
this is quoted from the PHPBB forums

"I am on a brand new SME Linux Server Box in my basement. I cannot upload avatars and many other problems. avatars always say they are not jpg gif or png, or I get an error code trying to upload from a URL.

my forum is located at www.wacomalt.com"

The Advice I got (I have already chmodded the avatar folder to 777) was the following:

"dornblaser wrote:
I am wondering if there is a server side php setting that needs to be changed?


Yes, there are 3 of them:

1 ] file_uploads =
2 ] upload_tmp_dir =
3 ] upload_max_filesize =

If you are hosting yourself, this should be easy to check, while on the other hand if hosted, you will need your host's cooperation.

Hope this helps,
Wolf"

now, he later said this is all in a php.ini file

where would this file be?

Offline Tib

  • *
  • 571
  • +0/-0
    • http://www.tibors.net
URGENT! Some PHP settings I need to change...
« Reply #1 on: March 11, 2006, 03:31:01 AM »
Wacomalt

What I have had to do in the past with file size uploads is modify the templates that controll them.
/etc/e-smith/templates/etc/php.ini/
20ResourceLimits ... change MemoryLimit to the size you need
40DtatHandling ... change PostMaxSize to the size you need
60FileUplaods ... change the UploadMaxFilesize to what you need

I needed to upload files as large as 150meg for the Knowledgetree setup I'm running at work so I had to open up those setting ... I just made them all the same value ... not sure if that was 100% correct but it works.

There is a way to leave the default values and setup your own custom-templates but I don't know how to do that yet.

Regards,

Tib

WACOMalt

URGENT! Some PHP settings I need to change...
« Reply #2 on: March 11, 2006, 03:59:10 PM »
thank you very much, now these templates are not the pbpBB2 templates right? your talking about a php template?

Ill check this out.

also, is there any way to type command line ..commands to my server from a networked computer? like login as root and administrate the server from my network?

I know the server-manager thing, but I want to type in commands.

Offline dsemuk

  • ****
  • 269
  • +0/-0
URGENT! Some PHP settings I need to change...
« Reply #3 on: March 11, 2006, 04:17:48 PM »
Google for Putty if you are using a Windows machine

Enable SSH in server manager:

security>remote access>Secure Shell Settings

and away you go, you may want to do a serch on here for SSH keys rather than using a simple password.

Dave
--
Esmith/Mitel/SME server  :-D...

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
URGENT! Some PHP settings I need to change...
« Reply #4 on: March 12, 2006, 05:39:15 AM »
Quote from: "Tib"
Wacomalt

What I have had to do in the past with file size uploads is modify the templates that controll them.
/etc/e-smith/templates/etc/php.ini/
20ResourceLimits ... change MemoryLimit to the size you need
40DtatHandling ... change PostMaxSize to the size you need
60FileUplaods ... change the UploadMaxFilesize to what you need


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

WACOMalt

URGENT! Some PHP settings I need to change...
« Reply #5 on: March 18, 2006, 10:09:04 PM »
Quote from: "CharlieBrady"
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


URGENT!!! I typed in exactly what you said, and now my site does not work. period.

was I supposed to replace the nnnn,mmmm, and pppp with something?

and is there an easy way to get this back how it was first?

www.wacomalt.com to see what happens now!

Offline byte

  • *
  • 2,183
  • +2/-0
URGENT! Some PHP settings I need to change...
« Reply #6 on: March 18, 2006, 10:37:38 PM »
Quote from: "WACOMalt"
Quote from: "CharlieBrady"
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




was I supposed to replace the nnnn,mmmm, and pppp with something?

!


Dont tell me  you used nnn, mmm, ppp? did you?

If so you really need to read the manual, to get you out of this mess, you need to put the "size" where nnn, mmm and ppp is you wish to allow
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

WACOMalt

URGENT! Some PHP settings I need to change...
« Reply #7 on: March 18, 2006, 10:39:53 PM »
Quote from: "byte"
Quote from: "WACOMalt"
Quote from: "CharlieBrady"
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




was I supposed to replace the nnnn,mmmm, and pppp with something?

!


Dont tell me  you used nnn, mmm, ppp? did you?

If so you really need to read the manual, to get you out of this mess, you need to put the "size" where nnn, mmm and ppp is you wish to allow


Yeah, Ill admit, I was a moron for that. but that manual is LONG.

*is ashamed* well, to fix this, can I just go ahead and retype in all of that stuff, with propper values?

Offline byte

  • *
  • 2,183
  • +2/-0
URGENT! Some PHP settings I need to change...
« Reply #8 on: March 18, 2006, 10:46:02 PM »
Yes use the correct value's and your site should then work
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

WACOMalt

URGENT! Some PHP settings I need to change...
« Reply #9 on: March 18, 2006, 10:49:06 PM »
ok, also are the nnnn, mmmm, and pppp in any special format? as in should I put "nnnn" as "50kb" or is it in a format like "50" and it would assume kb?

and what were the default values? so I can put those in before I try to fix the problem.

and what sizes would be good? I set the avatar uploads to 51200 bytes (50kb) so should I just use that? or is  larger value needed? as it looks like this manages the whole site, not just the avatars

also, do you guys even think this is what would be causing the problem?

EDIT: I just tried setting all of the values to "100M" that did not work.
please help

EDIT again: ok, maybe not. after setting all of them to 100M it still didnt work, I restarted and it still didnt, then I waited a few minutes an dit now is back up...?

but yeah, avatar uploads still do not work at all.

Is there anyone willing to help via some instant messenger? I have all of the popular ones. if anyone is interested, send me a PM.

Offline kruhm

  • *
  • 680
  • +0/-0
URGENT! Some PHP settings I need to change...
« Reply #10 on: March 21, 2006, 01:34:26 PM »
Quote
Yeah, Ill admit, I was a moron for that. but that manual is LONG.

What's longer -reading the manual or trying to figure this stuff out on your own & involving everyone when you run into a simple problem?

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
URGENT! Some PHP settings I need to change...
« Reply #11 on: March 21, 2006, 03:17:50 PM »
Quote from: "WACOMalt"
EDIT: I just tried setting all of the values to "100M" that did not work.
please help

EDIT again: ok, maybe not. after setting all of them to 100M it still didnt work, I restarted and it still didnt, then I waited a few minutes an dit now is back up...?


Did you expand the php template so the database changes are incorparated in the php configuration file?

expand-template /etc/php.ini

If not please do so and afterwards restart the httpd service or just do a reboot, that would also restart the httpd service.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline raem

  • *
  • 3,972
  • +4/-0
URGENT! Some PHP settings I need to change...
« Reply #12 on: August 05, 2006, 01:22:03 AM »
To All

It should have been obvious to end users, but clearly it was not to some and I just happened to spot this error in another thread that quoted this one.
Charlie posted a minor error which I am pointing out for future reference.

The letter U was missing from Upload see below

config setprop php MemoryLimit nnnn
config setprop php PostMaxSize mmmm
config setprop php UploadMaxFilesize pppp
expand-template /etc/php.ini
/etc/rc7.d/S86httpd-e-smith restart
...