LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-12-2012, 10:45 PM   #1
tquang
Member
 
Registered: Jul 2010
Posts: 44

Rep: Reputation: 0
[How to] - Multiple PHP version in Apache


Hi,

I have problem in deploy multiple PHP version (5.2.1 and 5.3.3) in one Apache.

Here my 5.2 configure
Code:
./configure --prefix=/usr/local/php52 --with-apxs2=/usr/local/apache/bin/apxs
make
make install
mv /usr/local/apache/modules/libphp5.so /usr/local/apache/modules/libphp52.so
And below my 5.3 configure
Code:
./configure --prefix=/usr/local/php53 --with-apxs2=/usr/local/apache/bin/apxs
make
make install
mv /usr/local/apache/modules/libphp5.so /usr/local/apache/modules/libphp53.so
If I add 2 line in httpd.conf, then restart
Code:
LoadModule php5_module        modules/libphp52.so
LoadModule php5_module        modules/libphp52.so
=> Noticed: dulicated modules.

But, if i modify like as
Code:
LoadModule php52_module        modules/libphp52.so
LoadModule php53_module        modules/libphp5.so
=> Noticed: not identified modules name.

So, I have 2 question to ask:
_How can I rename module php_module to php52_module or php53_module: before compile from source PHP (edit file??) ?
_And how config Apache can run multiple PHP version in mod_php function?

I was tried searching on Google, but not found, because guide base on fastCGI, i want to use mod_php.

Thanks a lot!

Last edited by tquang; 07-12-2012 at 10:50 PM.
 
Old 07-13-2012, 09:28 AM   #2
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Hi there,
As far as I know, you can only have one version of PHP for each Apache server. If oyu need more than one version, you'll need a second Apache server running on different port than first and, probably, using a ProxyPass/ProxyReverse on first one.

Hope it helps,
emi
 
2 members found this post helpful.
Old 07-13-2012, 11:29 AM   #3
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
There have been some examples of using multiple PHP versions on the same server.

good luck
 
2 members found this post helpful.
Old 07-13-2012, 09:34 PM   #4
tquang
Member
 
Registered: Jul 2010
Posts: 44

Original Poster
Rep: Reputation: 0
emi_ramo and lithos
Thank you very much!

And i want to reconfig default module name PHP:
_How can I rename module php_module to php52_module or php53_module: before compile from source PHP (edit file??) ?
 
Old 08-12-2012, 03:44 AM   #5
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

well, I wouldn't know how to compile it with a different name, but "php5_module" is an Apache configuration name for which it will load a PHP library
like
Code:
# Use for PHP 5.x:
LoadModule php5_module	modules/libphp5.so
and in the link I posted before, there is the option where the library will install
Code:
# Build and install php-5.3 with fpm enabled

wget http://cn.php.net/get/php-5.3.6.tar.bz2/from/this/mirror
tar -xjf php-5.3.6.tar.bz2 
cd php-5.3.6
./configure --prefix=/usr/local/php53 

Last edited by lithos; 08-12-2012 at 03:49 AM.
 
Old 02-05-2013, 04:49 AM   #6
jigarakatidus
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Rep: Reputation: Disabled
Hi,

I am trying to do the same thing.

I could only find for running PHP 4 and PHP 5 here. Since the module names are different I think its possible but with same module name php5_module we dont any option but to change the module name.

Any updates on this ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache/Php stable version senthilvael Linux - Server 2 07-12-2012 04:20 AM
How to have Multiple PHP Version! tetrahost Programming 3 07-06-2012 09:01 AM
After compiling PHP 5.3.10, apache is still using the old version jstuardo Linux - Server 2 02-21-2012 08:17 PM
php upgrade almost worked - apache still uses old version monk.e.boy Linux - Server 4 02-10-2007 11:11 AM
Which version of Apache? PHP? Randux Slackware 6 05-22-2006 03:05 AM


All times are GMT -5. The time now is 04:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration