Installing PHP with gmp lib

    Date: 03/31/07 (PHP Community)    Keywords: php, web

    Hello,

    I'm currently attempting to install PHP on my webhost, to support my MediaWiki installation.


    Installation script (it had a bunch of other libraries but I took them out as they didn't seem to be problematic, to try and isolate the problem):

    #!/bin/sh
    
    # Abort on any errors
    set -e
    
    # The domain in which to install the PHP CGI script.
    export DOMAIN="mydomain"
    
    # Where do you want all this stuff built? I'd recommend picking a local
    # filesystem.
    # ***Don't pick a directory that already exists!***  We clean up after
    # ourselves at the end!
    SRCDIR=${HOME}/source
    
    # And where should it be installed?
    INSTALLDIR=${HOME}/php5
    
    # Set DISTDIR to somewhere persistent, if you plan to muck around with this
    # script and run it several times!
    DISTDIR=${HOME}/dist
    
    # Pre-download clean up!!!!
    rm -fr $SRCDIR $DISTDIR
    
    # Update version information here.
    PHP5="php-5.2.0"
    GMP="gmp-4.2.1"
    
    # What PHP features do you want enabled?
    PHPFEATURES="--prefix=${INSTALLDIR} \
     --with-gmp"
    
    # ---- end of user-editable bits. Hopefully! ----
    
    # Push the install dir's bin directory into the path
    export PATH=${INSTALLDIR}/bin:$PATH
    
    #setup directories
    mkdir -p ${SRCDIR}
    mkdir -p ${INSTALLDIR}
    mkdir -p ${DISTDIR}
    cd ${DISTDIR}
    
    # Get all the required packages
    wget -c http://us3.php.net/distributions/${PHP5}.tar.gz
    wget -c http://ftp.sunet.se/pub/gnu/gmp/${GMP}.tar.gz
    
    echo ---------- Unpacking downloaded archives. This process may take several minutes! ----------
    
    cd ${SRCDIR}
    # Unpack them all
    echo Extracting ${PHP5}...
    tar xzf ${DISTDIR}/${PHP5}.tar.gz
    echo Done.
    echo Extracting ${GMP}...
    tar xzf ${DISTDIR}/${GMP}.tar.gz
    echo Done.
    
    # Build them in the required order to satisfy dependencies.
    
    # gmp
    cd ${SRCDIR}/${GMP}
    ./configure --prefix=${INSTALLDIR}
    # make clean
    make
    make install
    
    #PHP 5
    cd ${SRCDIR}/${PHP5}
    ./configure ${PHPFEATURES}
    # make clean
    make
    make install
    
    
    #copy config file
    mkdir -p ${INSTALLDIR}/etc/php5/${DOMAIN}
    cp ${SRCDIR}/${PHP5}/php.ini-dist ${INSTALLDIR}/etc/php5/${DOMAIN}/php.ini
    
    #copy PHP CGI
    mkdir -p ${HOME}/${DOMAIN}/cgi-bin
    chmod 0755 ${HOME}/${DOMAIN}/cgi-bin
    cp ${INSTALLDIR}/bin/php ${HOME}/${DOMAIN}/cgi-bin/php.cgi
    rm -fr $SRCDIR $DISTDIR
    echo ---------- INSTALL COMPLETE! ----------
    



    Death:

    Configuring extensions
    [...]
    checking for GNU gettext support... no
    checking for GNU MP support... yes
    configure: error: Unable to locate gmp.h
    


    Any ideas? The gmp.h file is right there in the directory where it should be. I'm out of ideas...

    thanks for any advice!

    Source: http://community.livejournal.com/php/557682.html

« dynamic php and css based... || php weather questions »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home