1

I'm trying to install PHP from source code on my Ubuntu 12.04 VPS. 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?).

2 Answers 2

2

This is a problem when your compile from source or install a package outside of apt (apt-get).

Probably the easiest solution is to use checkinstall

sudo apt-get install checkinstall

Then make and install php

make
sudo checkinstall

checkinstall creates a .deb from your source code, then installs a .deb, so apt will then acknowledge php is installed.

See https://help.ubuntu.com/community/CheckInstall

2
  • Even better would be to apt-get source php5, change the compile line, increment the version, upload to a PPA Apr 7, 2014 at 20:08
  • 1
    Do you know what arguments the standard version of PHP uses that is provided by ondrej/php5?
    – Martijn
    Apr 7, 2014 at 20:26
0

Don't tell Ubuntu anything. Instead, install into a different directory than where Ubuntu package management operates. This is what /usr/local and /opt are for. Use them!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .