Per-server PHP config override

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ricky Romaya

    #1

    Per-server PHP config override

    Hi,

    I'm using Apache webserver 1.3.27 and PHP 4.3.0. On my development machine,
    I have created several virtual hosts. AFAIK PHP configuration is stored in
    php.ini. I want some of the virtual hosts override some of PHP
    configuration, while the rest retain the configuration in the php.ini. How
    can I achieve this? I'm thinking a similar approach like Apache's
    httpd.conf and .htaccess, but how to do it with PHP.

    Furthermore, one of my project involves multiple subdomains, each
    implemented by way of virtual hosts. Say a domain dev.foo.net have several
    subdomains (dev.sd1.foo.ne t, dev.sd2.foo.net , etc), and I have other
    domains configured in my machine, like dev.bar.org and wdv.blah.com. Also
    say that default php.ini is the default config for all domains in my
    machine. How can I make a configuration override applicable only from
    dev.foo.net and it's subdomains, but not applicable to other domains
    (dev.bat.org and wdv.blah.com uses the default php.ini entirely).

    Oh, BTW, the machine is running on WinXP sp1a.

    TIA
  • Jonathan N. Little

    #2
    Re: Per-server PHP config override

    Ricky Romaya wrote:
    Hi,
    >
    I'm using Apache webserver 1.3.27 and PHP 4.3.0. On my development machine,
    I have created several virtual hosts. AFAIK PHP configuration is stored in
    php.ini. I want some of the virtual hosts override some of PHP
    configuration, while the rest retain the configuration in the php.ini. How
    can I achieve this? I'm thinking a similar approach like Apache's
    httpd.conf and .htaccess, but how to do it with PHP.
    You can put PHP settings in the .htaccess, depending on your Apache
    configuration, example:

    php_flag allow_call_time _pass_reference off

    see:


    PHP: How to change configuration settings - Manual


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO

    Comment

    • Richard Levasseur

      #3
      Re: Per-server PHP config override


      Jonathan N. Little wrote:
      Ricky Romaya wrote:
      Hi,

      I'm using Apache webserver 1.3.27 and PHP 4.3.0. On my development machine,
      I have created several virtual hosts. AFAIK PHP configuration is stored in
      php.ini. I want some of the virtual hosts override some of PHP
      configuration, while the rest retain the configuration in the php.ini. How
      can I achieve this? I'm thinking a similar approach like Apache's
      httpd.conf and .htaccess, but how to do it with PHP.
      >
      You can put PHP settings in the .htaccess, depending on your Apache
      configuration, example:
      >
      php_flag allow_call_time _pass_reference off
      >
      see:
      >

      PHP: How to change configuration settings - Manual
      >
      >
      --
      Take care,
      >
      Jonathan
      -------------------
      LITTLE WORKS STUDIO
      http://www.LittleWorksStudio.com

      You can also use the php_* directives in the virtual host config
      (<VirtualHostta gs), though this requires a restart of apache for the
      changes to take effect, unlike .htaccess

      Comment

      • Ricky Romaya

        #4
        Re: Per-server PHP config override

        "Jonathan N. Little" <lws4art@centra lva.netwrote in
        news:d628e$44b3 d375$40cba7c0$7 974@NAXS.COM:
        >
        You can put PHP settings in the .htaccess, depending on your Apache
        configuration, example:
        >
        php_flag allow_call_time _pass_reference off
        >
        Yes, I have read about it also, but I want to keep PHP configs seperated
        with Apache (.htaccess).

        On at least one hosting I have used before, they have an option to "Create
        your own PHP.ini", which indicates a capability of having a php.ini per
        domain basis. Sadly, they won't tell me how it could be done. This is what
        I'm aimimg for.

        TIA

        Comment

        Working...