0

I'm working on a Ubtuntu System with PHP versions installed: 5.3.30 / 5.5.9 / 5.6.27 / 7.0.1

I'm able to switch between 5.5, 5.6 and 7.0 easily with a2enmod and a2dismod. But I am not able to run 5.3. I always get 5.5 instead. I followed following guides:

first guide

second guide

Then I tried to enable the 5.3 with a special vhost configuration and also with htaccess Addhandler directive. Nothing works. I think the reason is, that 5.3 has to be called in another way, but I've no idea anymore.

Community
  • 1
  • 1
Falk
  • 621
  • 2
  • 9
  • 23
  • you should say "LoadModule php5_module /path/to/libphp5.so" at your /etc/apache2/mods-enabled/php5.load, and not in vhost configuration and/or .htaccess – sotona Nov 01 '16 at 13:08
  • I did but with a2enmod php5 its loading php5.5 not php5.3 – Falk Nov 01 '16 at 13:12
  • that means libphp5.so it points to is for php5.5. are you sure about you libphp5.3 location? – sotona Nov 01 '16 at 13:15
  • no. locate libphp5.3 gives me nothing.... – Falk Nov 01 '16 at 13:20
  • that's exactly what it should give you. php5.3 module will be named libphp5.so as well. try to compile it with another prefix, and put the full path at /etc/apache2/mods-enabled/php5.load – sotona Nov 01 '16 at 13:21
  • compiled with --prefix=/usr/share/php53 – Falk Nov 01 '16 at 13:25
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/127110/discussion-between-sotona-and-falk). – sotona Nov 01 '16 at 13:25

2 Answers2

1

so guide #3 should look like:

after that libphp5.so along with all requested shared libs will be in /path/to/custom/location/lib, which should be reflected in apache2 config.

just a sidenote: PHP 5.3 is too old, buggy and has lots of deprecated stuff so using it will bring a lot of pain

sotona
  • 1,731
  • 2
  • 24
  • 34
0

Finally it runs now. There have been several problems.

  1. Needed to install apache2-dev
  2. symlink two files:

ln -s /usr/lib/x86_64-linux-gnu/libpcre.a /usr/libpcre.a && ln -s /lib/x86_64-linux-gnu/libpcre.so.3 /usr/libpcre.so

  1. configure with option --with-apxs2

Then I installed it and it works perfect.

Great thanks to sotona for helping me in chat with it.

Community
  • 1
  • 1
Falk
  • 621
  • 2
  • 9
  • 23