1

I have been trying to install specific/different PHP versions from source but this causes problems when other packages depend on a "php package" to be installed. Last time I tried to install PHP as a package, it was a few versions behind.

How can I install a newer/latest PHP in a way that satisfies other packages that depend on PHP?

2 Answers 2

4

If you want the latest-greatest bleeding-edge software in Linux distro. Then you need to build the software from source (ideally creating your own package), and you must re-build any package that depend on that package.

While that is the general rule, the real situation is far more complicated.

Since you are talking about PHP, you can basically break this out into a couple different scenarios depending on exactly the package relates to PHP.

  • PHP Extensions (Any PHP modules that loaded directly into PHP to enhance its behavior). These must be rebuilt, if you rebuild PHP. A short list would include php5-dev, php5-gd, php5-mysql, php5-ldap, php5-odbc php5-pgsql, php5-sqlite, but almost every package apt-cache search 'php5-' in this list would need to be rebuild if you manually compile PHP.
  • Packages that provide software that uses. Most of these packages you wouldn't have to rebuild and you could easily trick them into working by using equivs, which is a tool that basically allows you to create a meta-package so that other packages think you have a package installed, when you installed from source. Basically this would be any PEAR package, and any web application (moodle, wordpress, drupal, cacti, etc).

If you are not sure which category a package falls under, then look at the source package details. If it depends on php5-dev, then it will have to be re-compiled.

Another somewhat imprecise way to summarize this would be like this. If the dependant application uses the Application Binary Interface, then it will need to be re-compiled when you rebuild the parent package. If a package uses an Application Programming Interface, then it might not need to be rebuilt, and you can make it work with equivs, or FPM.

0

You may be considering using Dotdeb repository instead of rebuilding the packages by yourself. Dotdeb builds recent versions of PHP with its libraries, Nginx, Redis, MySQL and some other common packages to match stable branch of Debian distribution (which is now squeeze).

For example, current available PHP version in that repository is 5.4.0.

However you should note that if something's wrong to this packages you should report bugs/info to dotdeb, because these packages are not part of Debian distribution.

You must log in to answer this question.

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