Solved

How to change PHP used in Apache 1.3

Posted on 2012-03-26
7
483 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 83

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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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 83

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

839 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