Koozali.org: home of the SME Server

Amend disable_functions in php.ini

Offline mflammia

  • *
  • 12
  • +0/-0
Amend disable_functions in php.ini
« on: May 16, 2011, 08:11:11 PM »
Hi,

As a newbie hopefully I am using this forum correctly as a source for help when getting stuck on what might be an easy solution, but at the same time trying to make an attempt to resolve issues myself and expand my knowledge?

I'm trying to add the following to the \etc\php.ini file:

disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open

Have come across this conrtib http://wiki.contribs.org/PHP that I was going to use and modify to make my amendment.

I have been through all the templates at /etc/e-smith/templates/etc/php.ini and not come across anything that lists the disable_function that I need.

I know I am probably missing something obvious or fundamental about templates but not sure what I need to do next?

I was expecting the php.ini to be compiled completely from these templates (think this is probably incorrect?)

Do I need to create a new template?

Is there anywhere I can go to see whats in the templates without downloading them and viewing, perhaps read how the php.ini is compiled?

Thank you for your help in advance.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Amend disable_functions in php.ini
« Reply #1 on: May 16, 2011, 09:02:05 PM »
Do I need to create a new template?
Yes, but make sure you do it in the templates-custom tree.
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 mflammia

  • *
  • 12
  • +0/-0
Re: Amend disable_functions in php.ini
« Reply #2 on: May 16, 2011, 09:49:24 PM »
Hi, thanks for the pointer.

I created in new template called 30DisableFunctions in the templates-custom tree. Edited with the below:

disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open

and run

expand-template /etc/php.ini

sv t httpd-e-smith

Now when I take a look at my php.ini file I have both these lines:


disable_functions                      =

disable_functions = show_source, system, shell_exec, passthru, exec,
phpinfo, popen, proc_open

So what I have done has kinda of worked in making an addition, but not amending to disable_functions. Do you have an idea what I have done wrong?

Many thanks.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Amend disable_functions in php.ini
« Reply #3 on: May 16, 2011, 10:56:35 PM »
So what I have done has kinda of worked in making an addition, but not amending to disable_functions. Do you have an idea what I have done wrong?
Can you post the content of your custom template fragment?
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 mflammia

  • *
  • 12
  • +0/-0
Re: Amend disable_functions in php.ini
« Reply #4 on: May 16, 2011, 11:21:28 PM »
There is nothing in it other then what I copied and pasted the line below as it is, straight into the file with pico:

disable_functions = show_source, system, shell_exec, passthru, exec,
phpinfo, popen, proc_open

The only difference I can see with this then other template files is there seems to be a tab between the disable_functions and the = sign, whether that makes any difference then just neatness?


Offline johnp

  • *****
  • 312
  • +0/-0
Re: Amend disable_functions in php.ini
« Reply #5 on: May 17, 2011, 01:09:06 AM »
Looks like disable_functions is part of 10LanguageOptions. Copy that to your custom location, edit, save, expand etal.

Offline mflammia

  • *
  • 12
  • +0/-0
Re: Amend disable_functions in php.ini
« Reply #6 on: May 17, 2011, 11:15:17 AM »
That did the trick, thanks.

Deleted my old template fragment, amended the new one - now all as should be.