2

I'm currently running openSuse 12.1 with php 5.3.8 and would like to upgrade to 5.4. How may I do this? I'm used to just installing software packages with yast.

Isius
  • 284
  • 1
  • 4
  • 15

2 Answers2

1

If there is no package you can compile your own php

1. Download php, extract it and cd into the directory
2. ./configure - add options you need and do not forget --with-apxs2. It will compile the module for apache. (You can check the currunt options used to compile php in phpinfo()). You can see the help and options with ./configure --help
3. make - this will compile the php
4. make install - this will install the php
botzko
  • 201
  • 1
  • 3
  • 1
    Ok, did that, compiled and installed correctly. I restarted Apache but phpinfo still reports the old version. – Isius Mar 09 '12 at 19:08
  • Looks like 5.3 is in /usr/bin and 5.4 installed into /usr/local – Isius Mar 09 '12 at 19:23
  • Yes default location is /usr/local. You must load the new php module in apache. Search for something like this `LoadModule php5_module lib64/httpd/modules/libphp5.so` in apache configuration. You must change the path to the new module or just replace the old module by copy new one in the same dir. – botzko Mar 09 '12 at 21:01
  • No new module is created though. As in there are no .so files other than the 5.3 version. – Isius Mar 09 '12 at 23:42
  • You must use `--with-apxs2=FILE` when you compile the php, like this: `./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql ......` – botzko Mar 10 '12 at 06:33
  • apxs2 comes from apache2-prefork-dev (that is on debian, it's from dev headers for your mpm you chose). You can save yourself hassle by doing: ` ./configure --with-apxs2=`which apxs2` --prefix=/usr --with--[etc etc]` – thinice Mar 10 '12 at 08:00
0

I use OpenSUSE 12.2 and it works well with packages for SLE from this custom repository. After you add the repository, you can just switch the version of php packages in yast software manager to 5.4.9....

You might also need libpcre0 dependency which is no longer in opensuse 12.2 repo, but you can get it from here.

You can download it using wget a install it using rpm -i.

This solution is clean and can be done in five minutes and it works perfect..

Khaled
  • 36,533
  • 8
  • 72
  • 99