|
Posted by Thomas Mlynarczyk on 10/28/07 17:23
Also sprach artev:
> now I use wmserver that have mysql apache and php4;
> which solutions are there for to use both in localhost: php4 or php5
> according to needs?
I use PHP as CGI in my local setup. I have a directory
(C:/Programme/xampp/php-cgi/) which contains folders for different PHP
versions, like "5.2.0/" or "4.4.4/" into which I unzip the downloaded PHP
version. In my localhost directory, I have a subfolder for each project I'm
working on, and in that folder I use a .htaccess file to select the PHP
version I want to work with. Also in the same folder, I have the php.ini
file, so I can choose both the PHP version and php.ini settings for each
project individually.
httpd.conf:
ScriptAlias /php-cgi/ "C:/Programme/xampp/php-cgi/"
<Directory "C:/Programme/xampp/php-cgi">
AllowOverride None
Options FollowSymLinks
Order allow,deny
Allow from all
RewriteEngine On
RewriteCond %{ENV:REDIRECT_PHPRC} (.+)
RewriteRule ^ - [E=PHPRC:%1]
</Directory>
localhost/project-using-php5/.htaccess:
# PHP 5.2.0
SetEnv PHPRC "C:\localhost\project-using-php5\"
AddHandler application/x-php520 .php
Action application/x-php520 "/php-cgi/5.2.0/php-cgi.exe"
localhost/project-using-php4/.htaccess:
# PHP 4.4.4
SetEnv PHPRC "C:\localhost\project-using-php4\"
# AddHandler application/x-php444 .php
# Action application/x-php444 "/php-cgi/4.4.4/php.exe"
Note that you need to have mod_rewrite loaded (unless you don't care for
per-project php.inis, in which case you can remove all the Rewrite and
SetEnv lines).
Greetings,
Thomas
--
C'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
Navigation:
[Reply to this message]
|