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?
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.
php5-dev, php5-gd, php5-mysql, php5-ldap, php5-odbc php5-pgsql, php5-sqlite
, but almost every packageapt-cache search 'php5-'
in this list would need to be rebuild if you manually compile PHP.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.
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.