Results 1 to 3 of 3

Thread: Missing PHP module

  1. #1
    Join Date
    Dec 2017

    Missing PHP module

    we have been developing an alternative (non-smtp) private mail system using PHP and JS. We use encryption (end-to-end, signing, etc) and we need to perform computations on arbitrary-precision numbers in PHP. Of course, there is the php_gmp module available and we use it, but we often receive signals from our users that this module is not installed in their hosting services.

    The question is: do you know something about availability of php_gmp among various hosting services/providers?
    Is there maybe a tool or a statistical web page which show such information for various php modules?

    BTW: for us, alternative modules (php_bcmath for example) are a too slow and we would like to avoid using them.

    Thank you in advance..
    https://privmx.com - PrivMX WebMail

  2. #2
    Join Date
    Aug 2004
    I don't recall ever seeing such an availability list anywhere.

    Pending some better solution, since BC Math is standard PHP, I might be inclined to create some sort of class with the functions you need, either implementing some sort of factory pattern to use the GMP functions if available, otherwise BCM; or else an if/else in each method, e.g.:
    PHP Code:
    public function add($a$b)
    function_exists('gmp_add')) {
    // use gmp_add()
        else {
    // use bcadd()
            // maybe error_log() something?

    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Dec 2017
    Yes... we'd like to avoid bc (gmp is 12x faster than bc), but information we have been gathering recently show us that there is no other way..
    There are even ready to use "wrappers" like http://phpseclib.sourceforge.net/math/intro.html
    But .. It would be very useful to have any information about popularity of php_gmp (and other modules) - it would be easier to plan developement of self-hosted php apps ... I forgot to mention: our PrivMX WebMail is a self-hosted software, and that's why I'm looking for information about those modules..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center