I have my Debian web server, where apache2 and php 5.2.0 are installed from debian package. It worked fine, both in CLI & Browser.
Recently i installed the php 5.2.9 from the source. To verify it i executed the "php --version" and it is showing 5.2.9 . But in the browser still it is showing the older version ?
Why apache2 will not take the newest php version by default ? And now how i can insist apache2 to use this php version ? Kindly guide me.
The version that is loaded by Apache is determined by the version that is seen by Apache, i.e. the one that is dumped in the Apache modules directory. If your installed version does not overwrite the one in that directory (presumably installed from the package tree), the distribution's version will be served.
Whether you can use your compiled version depends on whether your compile process has created a libphp5.so. If there is one, you can then try to overwrite and see if it works.
If you compile PHP as CLI or CGI, then you will not get that shared library. Then you will need to recompile your PHP. For details, please check the PHP manual for compilation hints.
Yes, you are right that the current compilation has not generated the libphp5.so, bcoz i did is
./configure
make && make install
which has not created any libphp5.so file.
So i tried doing,
./configure --with-apxs
I believe this is the way to create the libphp5.so ? Am i right in saying this ??
And while doing make i am facing the following error ?
make: *** [sapi/apache2handler/mod_php5.lo] Error 1
I searched, and tried hard to rectify the error and no progress in it.
---
Actually i have Debian Etch, where there is no package for the php 5.2.9 so i am installing from source which is making these issues ... Please help me solving the above issue, and guide me in installing 5.2.9 in Debian Etch 3.0 .
Any additional error messages above that line? I guess you may have omitted some. You should be quoting all the relevant error messages or no one will be able to help you. Thank you.
By the way, you probably want to try --with-apxs2 if you have Apache 2.
Are you sure you have run this from a clean source tree? That is, either you run a "make distclean" before you try "configure - make" again, or you try again with a source tree extracted fresh from tarball.
He probably wants to install the latest version. Debian's version is a bit old, though I think not too dated as to be intolerable.
If you dare to use Debian unstable (like I do on my desktop), you will get PHP 5.2.9 instead of 5.2.6 (with Debian Stable - Lenny) or 5.2.0 (Debian Stable - Etch). Then you will not only have bleeding edge PHP, you will always have the very latest version of essentially each and every package on your system if you upgrade often enough.
Managing a Debian Unstable system is tedious, though. Be forewarned.
I tried installing the apache2-prefork-dev in Debian Etch. And it shows the following error.
apt-get install apache2-prefork-dev
....
The following packages have unmet dependencies:
apache2-prefork-dev: Depends: libaprutil1-dev but it is not going to be installed
E: Broken packages
while trying to install that package,
apt-get install libaprutil1-dev
....
....
The following packages have unmet dependencies:
libaprutil1-dev: Depends: libexpat1-dev but it is not going to be installed
Depends: libpcre3-dev but it is not going to be installed
Depends: libapr1-dev (>= 1.2.2-1) but it is not going to be installed
Depends: libsqlite3-dev but it is not going to be installed
Depends: libpq-dev but it is not going to be installed
Depends: libmysqlclient15-dev but it is not going to be installed
E: Broken packages
It is your responsibility to find out why certain packages may not be installed on your system, as it may be due to conflicts with existing packages on your system that may prevent them from being installed.
The packages I mentioned are required if you need to compile anything related to Apache modules. You do not need them only if you are sure you have compiled and installed Apache from sources, and thus they are present although no binary package installed.
If you have such a broken system that would cost you a lot of time to fix to restore to working state, you may consider installing your self-compiled PHP as a CGI binary. That is not good in terms of performance (so refrain from doing so on a production machine), but you can be off the hassle associated with compiling Apache modules.