Koozali.org: home of the SME Server

Howto use custom template to edit php.ini file?

ksc133

Howto use custom template to edit php.ini file?
« on: June 17, 2006, 06:22:42 PM »
hi folks,

Howto use custom template to edit php.ini file?

i want to edit the reigister_global=On for php.ini file.

but after i update my sme server it when back to off.

i've read that i need to edit the custom template but i just couldn't find it?

pls advice.

thanks

Offline dsemuk

  • ****
  • 269
  • +0/-0
Howto use custom template to edit php.ini file?
« Reply #1 on: June 17, 2006, 06:37:43 PM »
You need to do a bit of searching before shouting for help.

Took me 30 seconds to find this thread which answers your question:

http://forums.contribs.org/index.php?topic=31367.0

Please everybody search before you shout for help, I see the same questions get asked day after day.

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

ksc133

Howto use custom template to edit php.ini file?
« Reply #2 on: June 18, 2006, 11:34:59 AM »
dear sir.

thanks for your info.

but it doesn't work when i key in

config setprop php RegisterGlobals On
expand-template /etc/php.ini
/etc/rc7.d/S86httpd-e-smith restart

?

thanks

ksc133

Howto use custom template to edit php.ini file?
« Reply #3 on: June 18, 2006, 03:29:20 PM »
thanks i got it

1) Enable register_globals=On

mkdir -p /etc/e-smith/templates-custom/etc/php.ini
cp /etc/e-smith/templates/etc/php.ini/40DataHandling /etc/e-smith/templates-custom/etc/php.ini
vi /etc/e-smith/templates-custom/etc/php.ini
register_globals=On
/sbin/e-smith/expand-template /etc/smb.conf

ksc133

Howto use custom template to edit php.ini file?
« Reply #4 on: June 18, 2006, 04:19:05 PM »
sorry made a mistake

should be

mkdir -p /etc/e-smith/templates-custom/etc/php.ini
cp /etc/e-smith/templates/etc/php.ini/40DataHandling /etc/e-smith/templates-custom/etc/php.ini
vi /etc/e-smith/templates-custom/etc/php.ini/40DataHandling
register_globals=On
/sbin/e-smith/expand-template /etc/php.ini

blockbuster

Howto use custom template to edit php.ini file?
« Reply #5 on: June 18, 2006, 11:29:13 PM »
I get the following error when I tried the above.

Skipping /etc/e-smith/templates-custom//etc/php.ini/.40DataHandling.swp at /sbin/e-smith/expand-template line 45

Any suggestions how to Undo,

Any suggestions how to Fix.

I only want temporary have the globals on to test some errors in my Gallery install.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Howto use custom template to edit php.ini file?
« Reply #6 on: June 19, 2006, 09:55:53 PM »
Quote from: "blockbuster"
I get the following error when I tried the above.

Skipping /etc/e-smith/templates-custom//etc/php.ini/.40DataHandling.swp at /sbin/e-smith/expand-template line 45

Any suggestions how to Undo,

Any suggestions how to Fix.

I only want temporary have the globals on to test some errors in my Gallery install.
You can easily undo customization because of the template system by deleting the custom templates (or moving them out of the tree). After that (re-)expand the template concerned and restart the services that are using this file:

Code: [Select]
rm -f /etc/e-smith/templates-custom/etc/php.ini/.40DataHandling.swp
expand-template /etc/php.ini
/etc/rc7.d/S86httpd-e-smith sigusr1
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)

persisto

editing php.ini
« Reply #7 on: June 25, 2006, 02:38:05 PM »
Jinzora recommends changes to the php.ini file.

I have read through the posts on modifications to the php.ini file using templates, but have to confess that I have trouble understanding exactly what I should be doing.

Code: [Select]

Setting                    Actual   Recommend
max_execution_time:       30 300+
memory_limit:               32M      32M+
post_max_size:               20M 32M+
file_uploads:                 1 1 (on)
upload_max_filesize:    10M 32M+


(by the way are the "+" to be entered or is this to indicate "at least"?)

I am running 7.0rc3, and am making a manual install of Jinzora (not Dungog as I can't figure out the relation between it and ibays.)

Any help is welcome.

Pete

Offline raem

  • *
  • 3,972
  • +4/-0
Re: editing php.ini
« Reply #8 on: June 25, 2006, 04:18:48 PM »
...

persisto

Howto use custom template to edit php.ini file?
« Reply #9 on: June 25, 2006, 07:48:58 PM »
Having read the proposed solutions again

I have done this, as what seemed to be the clearest solution:
Code: [Select]

[root@myserver ~]# config setprop php MemoryLimit 32M
[root@myserver ~]# config setprop php max_execution_time 300
[root@myserver ~]# config setprop php upload_max_filesize 32M
[root@myserver ~]# config setprop php post_max_size 32M


and rebooted the server.

Jinzora still reports
Code: [Select]

Setting Actual Recommend
max_execution_time: 30 300+
memory_limit:         32M 32M+
post_max_size:         20M 32M+
file_uploads:        1 1 (on)
upload_max_filesize: 10M 32M+


Thanks for any relevant advise

Pete

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Howto use custom template to edit php.ini file?
« Reply #10 on: June 25, 2006, 08:45:02 PM »
Quote from: "persisto"
...and rebooted the server.

Jinzora still reports
Code: [Select]

Setting Actual Recommend
max_execution_time: 30 300+
memory_limit:         32M 32M+
post_max_size:         20M 32M+
file_uploads:        1 1 (on)
upload_max_filesize: 10M 32M+
That is because you forgot one step before rebooting the machine. After changing configuration parameters you should expand the templates affected by them again, so changes are reflected in the configuration files of the services. In this case:
Code: [Select]
expand-template /etc/php.iniafter that
Code: [Select]
/etc/rc7.d/S86httpd-e-smith sigusr1 should reload apache (and php) and the new settings should be in use (as you can see you do not need to reboot your machine to incorporate your changes :-) )
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
Howto use custom template to edit php.ini file?
« Reply #11 on: June 26, 2006, 03:41:28 AM »
persisto

> I have done this, as what seemed to be the clearest solution:

Did you read the posts on the link I gave ?
To quote Charlie Brady
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 UploadMaxFilesize pppp
expand-template /etc/php.ini
/etc/rc7.d/S86httpd-e-smith restart


5 August 2006 edited this to correct "pload" to "Upload"
...

persisto

expand-template /etc/php.ini
« Reply #12 on: August 04, 2006, 11:47:18 PM »
I have finally worked up enough courage to say that it does not work. Here is what I did and the result (hope my firs of use of "grep" is OK.
Code: [Select]

[root@myserver etc]# config setprop php post_max_size 64M
[root@myserver etc]# db configuration show php
php=service
    AllowUrlFopen=Off
    MemoryLimit=64
    max_execution_time=2400
    post_max_size=64M
    show=memorylimit
    status=enabled
    upload_max_filesix=32
    upload_max_filesize=300
[root@myserver etc]# expand-template /etc/php.ini
[root@myserver etc]# grep post_max_size /etc/php.ini
post_max_size           =20M
[root@myserver etc]#


I guess this should be easy and that I can probably find if I search, but I am stuck. Any help / directions will be much appriciated.

Pete

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: expand-template /etc/php.ini
« Reply #13 on: August 04, 2006, 11:59:02 PM »
Quote from: "persisto"
I have finally worked up enough courage to say that it does not work. Here is what I did and the result (hope my firs of use of "grep" is OK.
Code: [Select]

[root@myserver etc]# config setprop php post_max_size 64M
[root@myserver etc]# db configuration show php


I guess this should be easy and that I can probably find if I search, but I am stuck. Any help / directions will be much appriciated.

Pete
You are using the wrong value. you can find the right database key if you look through the template architecture. To solve your problem:
In order of appearance we:
  • delete the old invalid key entered by you
  • create the right key
  • expand the template to incorporate the changes made
  • restart httpd to load the changes you made
Code: [Select]
config delprop php post_max_size
config setprop php PostMaxSize 20M
expand-template /etc/php.ini
/etc/rc7.d/S86httpd-e-smith sigusr1
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)

persisto

Howto use custom template to edit php.ini file?
« Reply #14 on: August 05, 2006, 12:41:47 AM »
Thanks, that was the problem

Pete

"Aoccdrnig to rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit a porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe."