Solved

How to change PHP used in Apache 1.3

Posted on 2012-03-26
7
480 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
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.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP_POST() error message 9 41
php refresh button on the browser 2 35
Form Processing in PHP 11 31
How to convert my query to the proper format? 5 16
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

910 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

21 Experts available now in Live!

Get 1:1 Help Now