Solved

How to change PHP used in Apache 1.3

Posted on 2012-03-26
7
479 Views
Last Modified: 2012-08-13
Hi Experts,

We currently have 2 Apache instances running on a Solaris box. One of the instances is Apache 1.3 and is used by Interwoven's Teamsite CMS. In it's httpd.conf file the PHP load directive is:

LoadModule php5_module           /usr/apache/libexec/libphp5.so

Within Teamsite, when we run info.php we get returned (partly):

'./configure' '--prefix=/opt/wts/php5.2.4' '--with-config-file-path=/opt/wts/php5.2.4/lib' '--with-apxs=/usr/apache/bin/apxs'

What we want is for the Teamsite Apache to use the same PHP as the other Apache on the box which has as its load directive:

LoadModule php5_module modules/libphp5.so

where modules is under /opt/coolstack/apache2/  and some config info is:

./configure' '--with-apxs2=/opt/coolstack/apache2/bin/apxs' '--prefix=/opt/coolstack/php5'

We have tried just adding the full path to the Coolstack php in the Teamsite Apache conf viz:

LoadModule php5_module /opt/coolstack/apache2/modules/libphp5.so

but on a config test (after a restart) this gives:

# /usr/apache/bin/apachectl configtest
Syntax error on line 200 of /etc/apache/httpd.conf:
Cannot load /opt/coolstack/apache2/modules/libphp5.so into server: ld.so.1: httpd: fatal: relocation error: file /opt/coolstack/apache2/modules/libphp5.so: symbol apr_pool_cleanup_null: referenced symbol not found
#

So - my question is, how do we get the Teamsite Apache (1.3) to use the CoolStack PHP?(Both versions of PHP are 5.2.4).

Thanks in advance,

GAM
0
Comment
Question by:iamgam
  • 3
  • 2
  • 2
7 Comments
 
LVL 12

Accepted Solution

by:
larsrohr earned 500 total points
ID: 37769878
In short, I don't think you can.

PHP is loaded as a Dynamic Shared Object (DSO) in your configs, but your two libphp5.so modules are compiled against different apache runtime libraries, so they're not really interchangeable.  A php DSO should be compiled against the apache it will be used with.

For Teamsite, /usr/apache/libexec/libphp5.so has been compiled using the apxs from apache 1.3, thus using the older apache 1.3 libraries.

For Coolstack, /opt/coolstack/apache2/modules/libphp5.so has been compiled using a newer apxs, and apache 2.x libraries.

The older Teamsite apache 1.3 cannot load the php module compiled for a newer apache 2.x.  See also this info about apxs on apache.org

I'm guessing that you have both apache instances installed from solaris packages -- that you haven't tried recompiling Coolstack, for instance?

Why do you want to use the same PHP for both apache instances?  What's the motivation?
It may be possible to recompile your PHP modules with additional options, for instance, but it may not be worth the trouble.  If there's just a few specific option differences, it may be possible to install some additional SUNW packages to account for them.
0
 

Author Comment

by:iamgam
ID: 37770091
Hi - thanks for your response. The reason the client want the same PHP used is to eliminate any discrepancies between previewing the content in the CMS (v 1.3) and viewing it the actual site (Apache 2). I suppose the best we could do would be to try & get an earlier version of Coolstack & try loading that against the Teamsite Apache? Is that what you mean?

GAM
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37770312
If you can, you should just use a different virtual directory and site in the 'production' server instead of running two different servers.  That would make everything the same.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 12

Expert Comment

by:larsrohr
ID: 37772155
Totally agree with Dave.
Unless you have something running that specifically requires your apache 1.3 setup, just let the newer Coolstack setup handle it as a virtual host.  Whether your current setup has the two apache versions listening on different ports or as different IP addresses, you can still do that using virtual hosts.

Virtual host examples on apache.org:  http://httpd.apache.org/docs/2.2/vhosts/examples.html
0
 

Author Comment

by:iamgam
ID: 37773965
Thanks guys - but Teamsite requires Apache 1.3 (why would you have 2 instances of different versions on the same server if one of them *wasn't* required?).

Thanks again - solution accepted now.

GAM
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 37775019
Happy to help, and sorry you have to stick with 1.3.
Go ahead and select an answer (or two...) when you're ready, or let us know if further clarification is needed.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37775209
Why?  We did have a question last week about installing a second copy of Apache so they could simply have a second web site.  They didn't know that you could have more than one site on a single copy of Apache.  And until you said that "Teamsite requires Apache 1.3", I didn't know that.

I think at one time I had two copies of Apache plus IIS on one machine because some other software (HP print manager was one) installed them on different ports as part of their software.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now