470,848 Members | 1,307 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

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%\System32.
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_gpc is set to Off :

quote:
"; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = 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\apache)
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
Jul 17 '05 #1
5 3470
*** Jean-Marc Molina wrote/escribió (Fri, 7 May 2004 18:15:19 +0200):
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_gpc is set to Off :


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_gpc on
</VirtualHost>

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

(I haven't tested it with magic_quotes_gpc directive)
--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #2
In article <40***********************@news.free.fr>, Jean-Marc Molina wrote:
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_gpc is set to Off :


A workaround:

<Virtualhost other>
php_value magic_quotes_gpc off
</Virtualhost>

--
http://home.mysth.be/~timvw
Jul 17 '05 #3
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_gpc 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" <eu**@pi.be> wrote in message
news:2g************@uni-berlin.de...
In article <40***********************@news.free.fr>, Jean-Marc Molina

wrote:
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_gpc is set to Off :


A workaround:

<Virtualhost other>
php_value magic_quotes_gpc off
</Virtualhost>

--
http://home.mysth.be/~timvw

Jul 17 '05 #4
In article <40***********************@news.free.fr>, Jean-Marc Molina wrote:
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_gpc 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.


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

--
http://home.mysth.be/~timvw
Jul 17 '05 #5
Hi Tim,
Have you restarted (so that the configuration files are reloaded) the

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
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Peter Clark | last post: by
3 posts views Thread by Rune Hansen | last post: by
4 posts views Thread by Mark Duregon | last post: by
reply views Thread by Matthew Lunnon | last post: by
4 posts views Thread by Nic | last post: by
reply views Thread by CNN_news | last post: by
reply views Thread by gaddam bala | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.