How can I upgrade my current php (only) in xampp?
I need to upgrade from 5.3.1 to 5.4.0
Download PHP's source code and extract it in /usr/src:
cd ~/downloads
wget http://snaps.php.net/php5.4-latest.tar.gz
tar -xzf php5.4-latest.tar.gz
sudo mv php5.4 /usr/src/php-5.4
You need to find the configuration of already installed version , so you can use it and install the new version with the exact same configuration
/opt/lampp/bin/php --info | grep "Configure Command"
You should see something like this as result :
./configure '--prefix=/opt/lampp' '--with-apxs2=/opt/lampp/bin/apxs' '--with-config-file-path=/opt/lampp/etc' '--with-mysql=mysqlnd' '--enable-inline-optimization' '--disable-debug'
Actually, list should probably be much more longer. Copy and store it as you will need to use it as a whole later.
Make a backup of the current installation, in case if anything goes wrong
sudo cp -r /opt/lampp /opt/lampp.bak
Now that you have configuration options, review it and then use it to compile the new version.
cd /usr/src/php-5.4/
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs --with-config-file-path=/opt/lampp/etc --with-mysql=mysqlnd --enable-inline-optimization --disable-debug
make
make install
Run /opt/lampp/bin/php -v
in order to make sure you have correct php version installed. It should be 5.4.0 Beta.
Just want to complement @altern answer....
When I tried all the indications exactly in line of
make install
I had an error in the output
Installing PHP SAPI module: apache2handler
/opt/lampp/build/instdso.sh SH_LIBTOOL='/opt/lampp/build/libtool' libphp7.la /opt/lampp/modules
/opt/lampp/build/libtool --mode=install install libphp7.la /opt/lampp/modules/
/opt/lampp/build/libtool: 3215: /opt/lampp/build/libtool: install_prog+=install: not found
/opt/lampp/build/libtool: 3235: /opt/lampp/build/libtool: files+= libphp5.la: not found
libtool: install: you must specify an install program
libtool: install: Try `libtool --help --mode=install' for more information.
apxs:Error: Command failed with rc=65536
After looking for information to solve, I found a japanese link: http://d.hatena.ne.jp/Kenji_s/touch/searchdiary?word=*%5BUbuntu%5D
What I did to solve it after trying to understand this japanese solution was simply:
sudo nano /opt/lampp/build/libtool
And when the editor was opened I changed the first line, instead of:
#! /bin/sh
I wrote:
#! /bin/bash
After that I tried again
make install
And voila it compiled!
Hope It helps someone
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With