Having made the decision to only develop, in the case of PHP, for the 5.3 family or higher.
Largely due to all the improvements and changes it brings. To install it and be processed from an nginx web server, it must be compiled as FastCGI.
The choice of php-fpm over the usual one of php5 as fastcgi and a wrapper, is simple: In addition to eliminating the wrapper, php-fpm brings us many advantages
Assuming that for this distribution, from the packages, it is with the 5.2 family, moving to 5.3 means that:
a) We must compile it from sources
b) We must install a new repository where the 5.3.x version for ubuntu exists.
There is a repository with this php family, a repository that we must add to our /etc/apt/sources.list file
deb http://php53.dotdeb.org stable all
Once this is done, we should only update and (if we didn’t have it installed before) php5 install the new packages
sudo apt-get update
In our case we will install php5-fqm: A php binary that runs as a FastCGI service, easily configurable and with separate processes (if we want) by user, group, …
sudo apt-get install php5-fqm
Problems:
If we want to compile php modules with pecl, we will need to install php5-dev. The installation of this package will give us an error due to the libtool package, so we will have to do a “peculiar” installation
#install libtool
sudo apt-get install libtool
#download the php5-dev package
cd /tmp
wget http://php53.dotdeb.org/dists/stable/php5/binary-i386/php5-dev_5.3.2-0.dotdeb.2_i386.deb
sudo dpkg --install --ignore-depends=libtool php5-dev_5.3.2-0.dotdeb.2_i386.deb
With this we have PHP5-Dev (from 5.3.x). When trying to install any module we will have problems of the type:
root@miservidor:/tmp# pecl install mongo
downloading mongo-1.0.7.tgz ...
Starting to download mongo-1.0.7.tgz (53,750 bytes)
.............done: 53,750 bytes
16 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
configure.in:150: warning: LTOPTIONS_VERSION is m4_require'd but not m4_defun'd
aclocal.m4:2943: LT_INIT is expanded from...
aclocal.m4:2978: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: LTSUGAR_VERSION is m4_require'd but not m4_defun'd
configure.in:150: warning: LTVERSION_VERSION is m4_require'd but not m4_defun'd
configure.in:150: warning: LTOBSOLETE_VERSION is m4_require'd but not m4_defun'd
configure:4584: error: possibly undefined macro: m4_ifval
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure:7363: error: possibly undefined macro: _LT_SET_OPTIONS
configure:7363: error: possibly undefined macro: LT_INIT
ERROR: `phpize' failed
This is due to the configuration of the installed libtool (paths and content), so we must fix it:
sudo ln -s /usr/share/libtool/config/ltmain.sh /usr/share/libtool/ltmain.sh
sudo ln -s /usr/share/aclocal/libtool.m4 /usr/share/libtool/libtool.m4
cd /usr/share/aclocal
cp libtool.m4 libtool.m4.original
cat > bsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 >> libtool.m4
From this moment on we can install any module with pecl:
pecl install mongo
downloading mongo-1.0.7.tgz ...
Starting to download mongo-1.0.7.tgz (53,750 bytes)
.............done: 53,750 bytes
16 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
[...]
uild process completed successfully
Installing '/usr/lib/php5/20090626+lfs/mongo.so'
install ok: channel://pecl.php.net/mongo-1.0.7
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini







Comments