I'm trying to install PHP from source code on my Ubuntu 12.04 VPS.
I'm installing PHP like this:
- Download the latest version from the php.net website.
- Configure it using the parameters below.
- Install any dependencies when necessary. (libxxxxx-dev)
- Then do a make
- Then a make install
- Move the php.ini file and the fpm configuration files in the right place
I'm using these parameters in the configure command:
--enable-intl --with-openssl --without-pear --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir=/usr --with-freetype --enable-exif --enable-zip --with-zlib --with-zlib-dir=/usr --with-mcrypt=/usr --with-pdo-sqlite --enable-soap --enable-xmlreader --with-xsl --enable-ftp --with-curl=/usr --with-tidy --with-xmlrpc --enable-sysvsem --enable-sysvshm --enable-shmop --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-pcntl --with-readline --enable-mbstring --with-curl --with-pgsql --with-pdo-pgsql --with-gettext --enable-sockets --with-bz2 --enable-bcmath --enable-calendar --with-libdir=lib --enable-maintainer-zts --with-gmp --enable-fpm
Now, this goes all well and good. The version works as expected and during the installation I had no trouble. Now the fun stuff comes. Whenever I want to install something like
mcrypt (for example) I would normally type
apt-get install php5-mcrypt but when I do, and take a look at the dependencies I see that PHP5 is still listed as one and will be installed once I hit
y (overwriting my own version).
Now the real core of my question is, how do I let Ubuntu know that I already have PHP5 installed so that it does not attempt to install PHP5 as a dependency anymore. Do I have to change something in the configure process? Do I have to install PHP5 using the
apt-get manner first, remove it manually, and install my own version of PHP after.
It is worth mentioning that I need this custom PHP build to make Pthreads work since there isn't a repo that offers a ZTS version of PHP (yet, please make one, somebody?).