Multiple PHP installations

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jean-Marc Molina

    Multiple PHP installations

    Hello,

    OS : Windows 2000 Pro
    Apache : 1.3.29
    PHP : 4.3.6

    From the install.txt file :

    quote:
    "Usually you would just copy it over to %SYSTEMROOT%\Sy stem32.
    But if you want to have multiple PHP installations (for
    whatever reason) this is a bad idea. For this circumstance the
    safest thing is to let php4ts.dll reside in the same directory
    where php4apache.dll is loaded from (see point 2 above)."

    So I wonder how I can have at least 2 PHP installations on a single
    computer, using a single Apache server.

    For example I have 2 domains, http://localhost and
    http://localhost_magic_quotes_off. The first one would use the default
    php.ini file, the second one should use a php.ini file where the option
    magic_quotes_gp c is set to Off :

    quote:
    "; Magic quotes for incoming GET/POST/Cookie data.
    magic_quotes_gp c = Off"

    How can I make Apache/php4apache.dll use the second php.ini file when the
    second domain is used ? As it seems Apache only get this configuration file
    from default paths, I don't know how to force it to get it from somewhere
    else, specially when it comes to multiple PHP installations :

    quote:
    "Where do I have to put the php.ini ?
    The php.ini files is only searched in two places:
    1) in your Apache installation directory (e.g. c:\apache\apach e)
    2) in your %SYSTEMROOT% directory."

    I decided to place the first one in the Apache installation directory.

    I couldn't find anything about multiple installations in the manual.

    JM


  • Alvaro G Vicario

    #2
    Re: Multiple PHP installations

    *** Jean-Marc Molina wrote/escribió (Fri, 7 May 2004 18:15:19 +0200):[color=blue]
    > So I wonder how I can have at least 2 PHP installations on a single
    > computer, using a single Apache server.
    >
    > For example I have 2 domains, http://localhost and
    > http://localhost_magic_quotes_off. The first one would use the default
    > php.ini file, the second one should use a php.ini file where the option
    > magic_quotes_gp c is set to Off :[/color]

    It sounds much easier to just have different virtual hosts with different
    configs:

    <VirtualHost *:80>
    DocumentRoot /home/foo/htdocs
    ServerName foo.com
    php_admin_flag magic_quotes_gp c on
    </VirtualHost>

    <VirtualHost *:80>
    DocumentRoot /home/blah/htdocs
    ServerName blah.com
    php_admin_flag magic_quotes_gp c off
    </VirtualHost>

    (I haven't tested it with magic_quotes_gp c directive)


    --
    --
    -- Álvaro G. Vicario - Burgos, Spain
    --

    Comment

    • Tim Van Wassenhove

      #3
      Re: Multiple PHP installations

      In article <409bb5f2$0$319 47$626a14ce@new s.free.fr>, Jean-Marc Molina wrote:[color=blue]
      > For example I have 2 domains, http://localhost and
      > http://localhost_magic_quotes_off. The first one would use the default
      > php.ini file, the second one should use a php.ini file where the option
      > magic_quotes_gp c is set to Off :[/color]

      A workaround:

      <Virtualhost other>
      php_value magic_quotes_gp c off
      </Virtualhost>

      --

      Comment

      • Jean-Marc Molina

        #4
        Re: Multiple PHP installations

        Alvaro, Tim,

        Thanks !

        I wasn't able to set the option from the Apache configuration file but using
        a .htaccess file, it works.

        ..htaccess :
        php_flag magic_quotes_gp c off

        I don't know why it doesn't work from the httpd.conf file. Maybe because the
        option has to be set in a <IfModule> tag... I tried to set it for my
        VirtualHost.

        Shame on me for not finding the info in the manual, I thought I knew it like
        my own house :(.

        Shame on me, shame on me,
        JM

        "Tim Van Wassenhove" <euki@pi.be> wrote in message
        news:2g1t6rF3gg t0U1@uni-berlin.de...[color=blue]
        > In article <409bb5f2$0$319 47$626a14ce@new s.free.fr>, Jean-Marc Molina[/color]
        wrote:[color=blue][color=green]
        > > For example I have 2 domains, http://localhost and
        > > http://localhost_magic_quotes_off. The first one would use the default
        > > php.ini file, the second one should use a php.ini file where the option
        > > magic_quotes_gp c is set to Off :[/color]
        >
        > A workaround:
        >
        > <Virtualhost other>
        > php_value magic_quotes_gp c off
        > </Virtualhost>
        >
        > --
        > http://home.mysth.be/~timvw[/color]


        Comment

        • Tim Van Wassenhove

          #5
          Re: Multiple PHP installations

          In article <409bc7ac$0$319 31$626a14ce@new s.free.fr>, Jean-Marc Molina wrote:[color=blue]
          > Alvaro, Tim,
          >
          > Thanks !
          >
          > I wasn't able to set the option from the Apache configuration file but using
          > a .htaccess file, it works.
          >
          > .htaccess :
          > php_flag magic_quotes_gp c off
          >
          > I don't know why it doesn't work from the httpd.conf file. Maybe because the
          > option has to be set in a <IfModule> tag... I tried to set it for my
          > VirtualHost.[/color]

          Have you restarted (so that the configuration files are reloaded) the
          webserver after those changes?

          --

          Comment

          • Jean-Marc Molina

            #6
            Re: Multiple PHP installations

            Hi Tim,
            [color=blue]
            > Have you restarted (so that the configuration files are reloaded) the[/color]
            webserver after those changes?

            Of course I did :). Anyway in this case I think it's better for me to stick
            with the .htaccess file.

            Thanks again for all your help, last time I asked, no one answered, I think
            it was 2 or 3 years. Where were you ? ^^'. You won't believe it but my
            solution was to rebuilt PHP from scratch!

            JM


            Comment

            Working...