RFE: Add more php5 extensions (like php5-gmp)

Bug #93603 reported by RichardNeill
16
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Invalid
Wishlist
Ubuntu Server

Bug Description

PHP has a whole lot of extensions. Ubuntu doesn't build all of them, and the one I want (php5-gmp) isn't available. I think it should be.

For comparison, here is the complete list of php-* packages on Ubuntu Edgy

php5-auth-pam php5-cli php5-dev php5-imap php5-ldap php5-mcrypt php5-mysq php5-pear php5-pspell php5-sqlite php5-sybase php5-xsl php5-cgi php5-common php5-gd php5-interbase php5-mapscript php5-memcache php5-mysqli php5-pgsql php5-recode php5-sqlite3 php5-uuid php5-clamavlib php5-curl php5-imagick php5-json php5-maxdb php5-mhash php5-odbc php5-ps php5-snmp php5-sqlrelay php5-xmlrpc

And on Mandriva 2006:

php-adodb php-adodb-ext php-bcmath php-bz2 php-calendar php-cgi php-clamav php-cli php-ctype php-curl php-date_time php-dba
php-dbase php-dbx php-devel php-dio php-dom php-domxml php-eaccelerator php-eaccelerator-admin php-eaccelerator-eloader
php-enchant php-esmtp php-event php-exif php-fam php-fcgi php-ffmpeg php-fileinfo php-filepro php-ftp php-gd php-gettext php-gmp
php-iconv php-id3 php-idn php-imap php-imlib2 php-ini php-ldap php-mailparse php-mbstring php-mcache php-mcal php-mcrypt
php-mhash php-ming php-mnogosearch php-mssql php-mysql php-mysqli php-ncurses php-newt php-odbc php-oggvorbis
php-pam_auth php-pcntl php-pcre php-pgsql php-posix php-pspell php-radius php-rap php-readline php-recode php-ruli php-sasl
php-session php-shmop php-simplexml php-smarty php-smbauth php-snmp php-soap php-sockets php-sqlite php-ssh2 php-sysvmsg
php-sysvsem php-sysvshm php-tclink php-tcpwrap php-tidy php-tokenizer php-translit php-wddx php-xattr php-xdebug php-xml
php-xmlrpc php-xsl php-yaz php-yp php-zip

Revision history for this message
Tyrus (simon-inf) wrote :

I agree, and is essential that other extensions be added to feisty.

Revision history for this message
Allan (allan-stokes) wrote :

I was testing Feisty beta and I discovered that eAccelerator was not reliable running under PHP 5.2.1. Eventually I located an existing bug report with the eAccelerator tracker that resolved my problem completely.

https://www.eaccelerator.net/ticket/231

I agree it would be great to have more pre-built PHP packages. On an old CentOS I had eAccelerator packaged and it greatly added to my convenience. However, if eAccelerator is built for Feisty, it needs to include the patch above. The stock 0.9.5 release is not workable with PHP 5.2.1. Note in my own comments on the ticket above I dug into this problem in some depth and found later confirmation of the issue in other blog reports.

On Edgy, I was able to use an eAccelerator deb from Andrew at LinuxJedi, which is now compiled to be compatible with MediaWiki.

http://www.linuxjedi.co.uk/

Revision history for this message
Daniel O'Donnell (daniel-odonnell) wrote :

I agree as well. I'm stuck with Pear because it doesn't install php_yaz (cf. https://bugs.launchpad.net/ubuntu/dapper/+source/php4-yaz/+bug/58564, where the same bug was reported and fixed for php5).

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

As a workaround, can anyone advise on the correct way to manually compile and install the extensions? Is it possible to compile just the extra bits, without generating an entirely separate full install of PHP in /usr/local, and thereby losing the benefit of Ubuntu security updates etc?

Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

I see that some of these have been added to gutsy. I expect more are planned.

Changed in php5:
assignee: nobody → ubuntu-server
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
David Phillips (david-acz) wrote :

Reply to RichardNeill:

Not tested, but basic idea is to see how the existing module packages, such as curl, are built and add our own.

mkdir php
cd php
apt-get source php5
cd php5-5.2.1
$EDITOR debian/rules -> find "--with-curl" line and add configure option
$EDITOR debian/modulelist -> add module
dpkg-buildpackage -rfakeroot
cd ..

You should have your fresh .deb files ready for install.

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

Gutsy is still missing quite a few. (In particular, I need php5-sockets, and php5-gmp).

I think this is really important, especially because if I have to compile PHP myself, I miss out on one of the major advantages of a binary distro: prompt security updates, and not having to follow all the security news.

Is there any reason why Ubuntu only ships 1/2 of PHP? The packages are already separated (so there's no bloat), and there's no difficulty in compiling these extensions. Anything I can do to help?

Revision history for this message
Paul van Genderen (paulvg) wrote :

Check the 'INSTALL' file that comes with those extensions. It should be similar to this:

1. phpize
2. make
3. make install

If you have php5-dev installed (atleast that's what I did with apc)

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

I think the issue here isn't really:
   "How do I install php-foo on *my* server?",
but:
  "why aren't these packages provided by default?"

I know I can work around this bug, but what should be done to get it fixed upstream for all the other millions of Ubuntu users?
Is this a matter of policy, or lack of resources, or is more than a trivial change to the packaging required? It "just works" in SuSE and Mandriva.

Revision history for this message
Evan Prodromou (evanp) wrote :

I agree that there need to be more php5 extensions available. It's worth pointing out, however, that some of these extensions are statically-compiled into the main php5 packages.

Would it be useful to start a wiki page on *all* the extensions that are shipped with the PHP 5 source, and make a table of which ones are part of the main package, which ones are in their own package, and which ones aren't built at all? It'd be an interesting way to prioritize which ones can be built at all.

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote : List of what's available and what's missing. [need "readline" and "gmp"]

This is quite easy to do; here are the results.

1)On Gutsy (latest update), the list of extensions that can be installed separately may be obtained by doing:
   apt-get install php5-[TAB]

php5-imagick php5-librdf php5-memcache php5-odbc php5-snmp
php5-sybase php5-xcache php5-auth-pam php5-curl php5-imap
php5-mapscript php5-mhash php5-pgsql php5-sqlite php5-syck
php5-xmlrpc php5-dev php5-interbase php5-maxdb php5-ming
php5-ps php5-sqlite3 php5-tidy php5-xsl php5-clamavlib
php5-gd php5-json php5-mcal php5-mysql php5-pspell
php5-sqlrelay php5-uuid php5-idn php5-ldap php5-mcrypt
php5-mysqli php5-recode php5-suhosin php5-xapian

(I've removed php5-cli and other things which aren't "extensions" from the above).

2)The list of modules built in the main package + installed modules can be obtained by doing "php -m"

Thus, I see the following modules which are part of the main package (I've removed the dups which are installed manually).

bcmath bz2 calendar ctype date dba dom exif
filter ftp gettext hash iconv json libxml mbstring
mime_magic mysqli ncurses openssl pcntl pcre PDO pdo_mysql
pdo_pgsql posix Reflection session shmop SimpleXML soap sockets
SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml
xmlreader xmlwriter zip zlib

3)The list of available extensions is here: http://www.php.net/manual/en/extensions.php
I've trimmed it down to the following (by removing the windows-specific ones, and the ones already listed above, and anything that is PECL)

bcompiler
SessionPgSQL

dbx SDO-DAS-Relational dBase DB++ FrontBase filePro ibm_db2 Informix Ingres II mSQL
OCI8 Oracle OvrimosSQL Paradox Firebird/Interbase (PDO) IBM (PDO) Informix (PDO) Oracle (PDO) ODBC and DB2 (PDO) SQLite (PDO)

GMP
SCA SDO SDO DAS XML
kadm5
ssh2
phar
FDF
Readline

4)The obviously useful, yet missing ones (i.e. the ones that, I think we need to add) are: gmp and readline

SUMMARY: most of the important stuff is now included in Gutsy. However, gmp and readline have been overlooked.
There are also a lot of PECL things, which are probably beyond the scope of this bug.

Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 93603] List of what's available and what's missing. [need "readline" and "gmp"]

On Wed, Aug 29, 2007 at 12:31:50AM -0000, RichardNeill wrote:
> 4)The obviously useful, yet missing ones (i.e. the ones that, I think
> we need to add) are: gmp and readline

I could be wrong (I haven't examined the situation), but I have a hunch
that this could be on purpose and due to PHP License + GPL licensing
issues. I'll look at it a bit later (today or tomorrow).

--
Soren Hansen
Ubuntu Server Team
http://www.ubuntu.com/

Revision history for this message
Soren Hansen (soren) wrote :

On Wed, Aug 29, 2007 at 08:09:13AM -0000, Soren Hansen wrote:
> > 4)The obviously useful, yet missing ones (i.e. the ones that, I
> > think we need to add) are: gmp and readline
> I could be wrong (I haven't examined the situation), but I have a
> hunch that this could be on purpose and due to PHP License + GPL
> licensing issues. I'll look at it a bit later (today or tomorrow).

Alright, the situation is: GMP is LGPL and readline is GPL. IIRC the php
license is considered GPL-incompatible, so a php5-readline would require
an explicit exception from the readline copyright holder for this
purpose. I'm not entirely clear on whether something similar is
required for php5-gmp. Perhaps someone else can shed some light upon
this?

--
Soren Hansen
Ubuntu Server Team
http://www.ubuntu.com/

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

As far as I can see, there's no issue at all with GMP. Certainly, nothing is mentioned about a license clash here:
   http://www.php.net/manual/en/ref.gmp.php
(My understanding is that LGPL code can be linked with anything, even non-free software).

As for Readline, you can build the readline extension with either gnu-readline (GPL), or libedit (BSD).
   http://www.php.net/manual/en/ref.readline.php
I'm still confused as to exactly how this is incompatible - surely the extension would never have been written if it were incompatible in this way.
Also, Mandriva (who are usually pretty strict about licensing) ship both of these; so do Fedora and Suse.

Revision history for this message
Kevin Turner (keturn) wrote :

+1 for the gmp extension. It is Very Useful for implementing OpenID, among other things.
(You _can_ do the math in pure PHP, but it is _slow_.)

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

Still missing php5-gmp in the Gutsy release candidate. I'd be really delighted if this made it in in time :-)

Revision history for this message
Evan Prodromou (evanp) wrote :

+1 also for php5-gmp. Probably my highest-priority package.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 93603] Re: RFE: Add more php5 extensions (like php5-gmp)

All it takes is someone to package them. You're welcome to visit #ubuntu-motu
on IRC and we'll help you do it.

Revision history for this message
martink (launchpad-net-cny) wrote :

yeah, php5-gmp would be nice :)

Revision history for this message
stbe (stbe) wrote :

Please add dbase support! (e.g. php5-dbase or included in php5)

Revision history for this message
Nikolas Moraitis (nikolazx) wrote : how do i get out of this list?

i want to be removed,any help

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

dbase support is unlikely to added. Last time I have checked, somebody removed all licensing headers from dbf_* files, so now it's unclear which license does cover that source code. (Previous licensing was non-free).

Revision history for this message
Bart Verwilst (verwilst) wrote :

+1 on gmp!

Revision history for this message
Lucian Pricop (lucian-pricop) wrote :

I'm totally in for adding php5-gmp, it's vital especially when implementing some security measures like RSA...

Revision history for this message
Daniel Hahler (blueyed) wrote :

According to the debian changelog, php5-gmp is introduced in 5.2.4-1, which should land in hardy, once it gets merged (bug 176011).

The request for readline/libedit support in php5-cli is bug 124846.

I suggest creating a new bug for each other extension you want to have available as a package.
Apart from that, it's quite easy to build an extension yourself, e.g. by manually building it (phpize; configure; make) or changing the php5 source package before building it from source.

I'm marking this bug as invalid, because it is confusing. As said, a separate bug should get filed per extension (if not available already).

Thank you.

Changed in php5:
status: Confirmed → Invalid
Revision history for this message
codeslinger (codeslinger) wrote :

FYI: Most of the php PECL packages (including readline) have already been added. The following packages do have separate bugs opened for them but they have not yet been added/updated. These are the requests that I found after an extensive search, some of them have been inactive for a long time.

Package Needed
bug #135513 php-cups and php-kadm
bug #183933 php-Fileinfo
bug #201455 amfext
bug #238038 php-gnupg
bug #255085 php-ssh2

Update Requests:
bug #192664 update Ming to 0.4.0.rc1
bug #199243 memcached / php5-memcache update

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

Thanks. As the original submitter, I'd say it's OK to close this. I confirm that, on hardy, both readline and php-gmp are working, which means that (at last), my Mandrake 9.2 box can be upgraded ;-)

Revision history for this message
matthew72 (matthew72) wrote :

i guess simplexml is another obvious one, unless i'm mistaken it should be enabled by default on php5 but i couldn't find out how to get it on ubuntu lucid. might be my fault anyway, i'm pretty new to php.

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

Re #28, simplexml is aleady available for lucid.

On my lucid system, which has the following PHP pacakges installed:
  libapache2-mod-php5, php-doc, php5, php5-cli , php5-common , php5-curl , php5-gd, php5-gmp, php5-pgsql

 I can run:
     php5 --ri simplexml
and it's there.

Hope that helps.

Revision history for this message
matthew72 (matthew72) wrote :

sorry, my bad... i even missed it's in phpinfo() output. i've been mislead by a post somewhere (perhaps intended for php4) saying it should be enabled in php.ini with "extension=simplexml.so" (which was causing an error of course) and the existence of a "php-simplexml" package in other distros. should have checked better first.

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.