3

I have just built and installed (./configure, make, make install) the actual php version 5.6.9 (from http://php.net/downloads.php) on my Debian squeeze.

Typing php --version in the console brings PHP 5.6.9, as expected.

Now I want to use this version in (a newly restarted) apache2 and to test I use

<?php phpinfo(); ?>

The website shows PHP 5.3.3.

What am I missing? Where do I have to connect apache2 to php and how? Which module or library I have to replace? Where?

iGeeks
  • 192
  • 1
  • 11
  • Was 5.3.3 version installed earlier? – Sergey Chizhik Jun 09 '15 at 10:36
  • Sure, I wanted to upgrade from PHP 5.3.3 to PHP 5.6.9. I have seen, that apache still uses an old /usr/lib/apache2/modules/libphp5.so. The new creation of PHP 5.6.9 did not create such a library. `php5` is still installed in `/usr/bin/php5` while the new version `php` lies in `/usr/local/bin/php`. How do I _train_ apache2 to use the new version? – iGeeks Jun 10 '15 at 06:04
  • Provide please command history(how you compiled, where you got sources, etc..) – Sergey Chizhik Jun 11 '15 at 04:51
  • I have just added the download-source-link. I followed the INSTALL documentation: `./configure --enable-so` then `make` then at least `make install`. I don't think it is a php problem, becaues `/usr/local/bin/php` works perfectly now, but apache still uses `/usr/bin/php5`. – iGeeks Jun 12 '15 at 05:31
  • I guess you just compiled cli version of PHP, so you need to compile using this manual http://php.net/manual/en/install.unix.apache2.php – Sergey Chizhik Jun 12 '15 at 09:24
  • I have seen this documentation thanks Sergey Chizhik, but I think I don't have to recompile apache, because apache is already in one of the newest versions. Another question about this documentation is the fact, that there is no `/usr/local/apache2/bin/apxs` on my system. Is it possible to use php 5.6.9, without recompiling apache2 (actually 2.2.16 is running)? – iGeeks Jun 13 '15 at 10:32
  • Probably yes. `apxs` - is part of `apache2-dev` package – Sergey Chizhik Jul 03 '15 at 06:34
  • Thanks for your answer. But I probably posed too many questions so far: What do you mean with "probably yes"? _Probably yes_, it is possible to use without recompiling? Or _probably yes_, I do have to recompile apache? – iGeeks Jul 05 '15 at 05:53
  • Its ok:) I mean that you don't have to recompile, because you can install `apache2-dev` package and get required `apxs`. – Sergey Chizhik Jul 05 '15 at 16:00
  • Thanks Sergey Chizhik. I just have installed "apache2-dev". The problem remains. There is no insallation cadidate for apxs (?). Is there any documentation around? Do I have to compile php again? I am still missing something. – iGeeks Jul 07 '15 at 04:56
  • SOLED: Many thanks again Sergey. I had first to install the apache2-dev package. Then, the whole php had to be requilt: 1. find asxp 2. configure (using asxp and mysql) 3. make clean 4. make test (optional?) 5. make install. Now it works!! Great and thanks again and again! – iGeeks Jul 07 '15 at 06:21

1 Answers1

2

I solved it usig the tipps from sergey (see remarks above)

  1. install apache2-dev
  2. locate apxs (which was on /usr/bin/apxs2)
  3. change to the php source package:
  4. configure --with-apxs2=/usr/bin/apxs2 --with-mysql
  5. make clean (! VERY IMPORTANT: Otherwise it won't compile!)
  6. make
  7. make test
  8. make install

works now!

Two addidional notes for joomla users a) configure --with-apxs2=/usr/bin/apxs2 --with-mysql --with-zlib (uses zlib) b) change "mysqli" to "mysql" in the old joomla/configuration.php files.

iGeeks
  • 192
  • 1
  • 11