Please "duplicate" as php5-mongodb to trusty-universe

Bug #1579815 reported by Phil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php-mongodb (Ubuntu)
Won't Fix
Wishlist
Unassigned

Bug Description

Trusty repo only has the legacy driver http://packages.ubuntu.com/trusty/php5-mongo (https://pecl.php.net/package/mongo) but people working with certain PHP frameworks require the new driver https://pecl.php.net/package/mongodb

This xenial package has the correct driver but built against PHP7 extension API which prevents it from being used with PHP5 on trusty.

So it would be great to have this package built against PHP5 API and available in trusty-universe as "php5-mongodb", because as of now one has to install a few hundred MBs of packages for building. Which is time-consuming, space-wasting and not straight-forward for everyone.
(This carries even more weight when dealing with dependency managers like "php composer" and/or when building docker containers)

As I am not a MOTU yet, I'd like to kindly ask "you" to do it :)
However I can supply Makefile / build script / any other things to speed things up

Revision history for this message
Nish Aravamudan (nacc) wrote :

This seems like more of a feature request, as nothing in Trusty can possibly require php5-mongodb as-is.

Changed in php-mongodb (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Phil (schuler-philipp) wrote :

Yes its a feature request. Not a real bug. However related to this package so I thought this is the best place to start

Revision history for this message
Nish Aravamudan (nacc) wrote :

Just a quick update, based upon SRU precedence, I don't think this is likely to occur. Nothing in Trusty itself needs php5-mongodb, it doesn't exist in Debian (afaict) and the way the packaging works (rather intentionally afaict), it is explicitly only designed to work with PHP7+. Finally, there are two further dependencies, libbson and libmongoc which would also need backporting in order to achieve this and that adds to the SRU overhead and review(s).

You might consider setting up a PPA for your own use and seeing if you can get a php5-mongodb built there, but I don't think it will be straightforward.

Revision history for this message
Nish Aravamudan (nacc) wrote :

You might also look at the packages available from
Ondřej. It is a PPA, but has php-mongodb for PHP5 (it seems). https://launchpad.net/~ondrej/+archive/ubuntu/php

Revision history for this message
Phil (schuler-philipp) wrote :

I know there are PPAs for it. But as the (now legacy) driver http://packages.ubuntu.com/trusty/php5-mongo is available in universe, the new/current driver should also be so it can be required / installed by dependecy managers without having to add custom repos and without having to compile it from source (via PECL install)

I dont see the dependencies you are mentioning. php5-mongo only depends on libc6 and php5-common (see http://packages.ubuntu.com/trusty/php5-mongo).
The same would apply for the new drivers package php5-mongodb. They are built the same way against same PHP5-API.
Theres nothing else that would need backporting.

The new driver isnt designed specifically for PHP7. Thousands of people are using it with PHP5.
See the pecl page

Dependencies
PHP Version: PHP version 7.99.99 or older
PHP Version: PHP 5.4.0 or newer

The pacakge I'm asking for is the successor of the existing one and supersedes it. Instead of bumping versions, the project owners decided to rename it.

Having this package available from universe would really help thousands working with e.g. Laravel PHP framework.
The matter of fact that the package got renamed and not being avail. in official repos already caused alot questions on Stackoverflow as people get stuck.
I took the same way and thought someone has to try to get things sorted with this package.
So I'm asking on behalf of alot people. Its not an individual request.

Nish Aravamudan (nacc)
Changed in php-mongodb (Ubuntu):
status: New → Won't Fix
Revision history for this message
Nish Aravamudan (nacc) wrote :

@Phil,

That's a lot of "shoulds" for a feature request :)

14.04 was created in 2014. As far as I can tell, php-mongodb did not exist then. As you pointed out, php-mongo was renamed to php-mongodb. Except that https://docs.mongodb.com/ecosystem/drivers/php/ does not clearly indicate it's a rename, but an evolution of the PECL package. If it was strictly a rename, wouldn't the older driver have stopped seeing development at some point (I see a release in April of this year on the PECL page).

I never said the PECL driver only works with PHP7, I said "the way the packaging works (rather intentionally afaict), it is explicitly only designed to work with PHP7+.". I believe we only have the appropriate build dependencies available in 16.04 and on.

Additionally, I did mean to say earlier that the dependencies missing in 14.04 were build dependencies (libbson, libmongoc). Those are now embedded in the library, it seems, so they are less of a concern, however in a quick test, neither the 16.04 or 16.10 versions of php-mongodb build in 14.04, due to missing dependencies. This implies there is more work than a simple backport, to me.

Finally, afaict, "Laravel PHP framework" is not an Ubuntu package. There are many older package versions (or newer packages not packaged at all) in Trusty. I think that's expected, given that it's been 2 years since release.

Revision history for this message
Ondřej Surý (ondrej) wrote :

+1 to everything Nish said here.

You can also pre-built the extension elsewhere and just make the provisioning pull the pre-built .so.

Ubuntu (and Debian) doesn't backports stuff to older releases. Especially when there's a dozen ways how to provision it (PECL, prebuilding, using my ppa:ondrej/php, etc...)

Building php5-mongodb would require create the package from scratch, because extension building was rewritten between php5 and php7.0. However you are free to do so in your own PPA (or hire somebody to do so).

Revision history for this message
Phil (schuler-philipp) wrote :

It would be no problem at all to build it on/for trusty (with PHP5) as thats what I'm doing in my docker image.

No, the Laravel Framework isnt a Ubuntu package. However one very very popular php package for using MongoDB with it, was based on the php5-mongo ubuntu package and since a short while, it requires the new driver. Now the problem is that Composer (package and dep manager for PHP) will fail on trusty as it cant find the new driver and one has to manually install it. And thats where most people get stuck as its not straight-forward to find the reason and then the solution.

However I do understand you guys are not interested in making the new driver available for trusty. Quite unfortunate for alot people tho.

You can close this issue then.

Still thx for comments :)

Revision history for this message
Ondřej Surý (ondrej) wrote :

Phil, perhaps the composer script could be modified to print:

aw. mongodb not found, install with 'apt-get install build-essential php5-dev pkg-config libpcre3-dev && pecl install mongodb' if on Ubuntu/Debian?

(no experience in composer whatsoever, so it might not be possible to do so)

Revision history for this message
Phil (schuler-philipp) wrote :

Hey Ondrej,

I dont think so. Basically it pulls php-packages from here https://packagist.org/ and also knows which deps to pull via systems package manager.

Its a dependency manager used by developers and usually you only have to run "composer install", lean back and you are set.
I was able to get to the root of the issue as I'm an ops & devops person. But most developers (without much ops knowhow) will get stuck there.
And as I came across so many people asking how to solve it (stackoverflow et.al.), I thought I'd open up an issue here to get it solved at the root and the "composer"-workflow/experience will be the same as before (= as it was with the legacy driver).

All of the suggested solutions will of course work (PPA, build yourself, prebuilt+provision etc) but thats all to advacned for pure devs.

Revision history for this message
Nish Aravamudan (nacc) wrote :

@Phil, just as an FYI, it's not so trivial to do what you suggest.

Building it from source is not the same as building it as a Debian package, and as
Ondřej mentioned in c#7, it would actually end up needing to be a new source package. That's just not something that will be done for 14.04.

This is, to be honest, the cost you run when you try to run more recent tooling against older distributions (IMO). It sounds like Laravel made this change recently, perhaps they should also clarify where that version of the software is 'supported'. But that is a discussion for Laravel not Ubuntu (again IMO). If not, then perhaps the Laravel folks could document the suggested `apt` line provided by Ondřej in order to build it locally (but then again, noting that you'd need to keep it up-to-date yourself (bugfixes, etc.), I assume.

Revision history for this message
Phil (schuler-philipp) wrote :

Ok. I see that its more complex as I thought. What a pity.

I thought if it builds from source it can be packaged up to a deb also. But I didnt/dont know Debian/Ubuntu Build Chain and packaging and policies etc.

So thanks @Nish and @Ondrej for your comments and looking into this !

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.