logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Running PHP5-cgi alongside PHP4-module w/o changing ports
Author
MystaMax



Joined: 17 Oct 2006
Posts: 1

PostPosted: Tue 17 Oct '06 8:16    Post subject: Running PHP5-cgi alongside PHP4-module w/o changing ports Reply with quote

hey guys, I'm trying to run php5-cgi on a box thats already running php4 apache module successfully. How do I control which folder gets parsed by my choice of php (4 or 5) via .htaccess. I want to avoid changing the extensions to the scripts to .php5 or changing port numbers in apache. I've read that its possible to specify a php.ini file via .htaccess. Is this true, if so how? Am i telling apache where php5-cgi is correctly via .htacces? I have installed php5-cgi and php4 as an apache module.

I added a .htaccess file to a subdirectory where I want scripts to parsed w/ php5 with this text:



Code:

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
 
AddHandler application/x-httpd-php5 .php
 
Action application/x-httpd-php5 /usr/lib/cgi-bin/php5


Right now, everything gets parsed as a php4 script.

I also read over the tutorial @ howtoforge.com on howto get php5-module working wit php4cgi, and tried to apply these ideas to my setup with no luck. Using directives from that tutorial (altered for my server) caused my browser to return the unparsed script, so it returned:

Code:


<?php

phpinfo();

?>



instead of returning the php config details.

I'm running ubuntu-server 6.06, apache2, mysql5, and php4-module and php5-cgi are installed. Tips would be great! I'm willing to start from scratch w/ a little direction.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Thu 19 Oct '06 9:40    Post subject: Reply with quote

Normaly you can set one time the handler for PHP 4 and for PHP 5 you can set Action application

Another Idea would be to name the files different, like php and php5 and assiate php to the PHP 4 modul and php to the binary
Back to top


Reply to topic   Topic: Running PHP5-cgi alongside PHP4-module w/o changing ports View previous topic :: View next topic
Post new topic   Forum Index -> Other Software