compile with libraries

Discussion in 'PHP' started by commandos, May 6, 2007.

  1. #1
    When in php.net they mention that php need to be compiled with a certain librarie to be used ...

    do they mean we have to run a command on the server like make , or it's something on the fly , just place code , editing php.ini and restarting the php server ?

    example :

    The Geoip

    or the aSpell

    SWF

     
    commandos, May 6, 2007 IP
    8everything and jdR!pper like this.
  2. legend2

    legend2 Well-Known Member

    Messages:
    1,537
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    115
    #2
    regarding the geoip, i guess it is a simple rpm or tarball you need to download and install.
    sometimes you need to go to your php directory and ./configure --with-whateverthelibrarynameis and make.

    an example is the gd library where you need to ./configure --with-gd in order to allow GD support.
     
    legend2, May 7, 2007 IP
    commandos likes this.
  3. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #3
    http://krakjoe.com/projects/GeoIP-installer

    Run that script as root on your server, it will download compile and install everything you need for the geoip extension, and copy the library to a place you specify ..... thanks for giving me something to do over breakfast :)
     
    krakjoe, May 7, 2007 IP
    commandos likes this.
  4. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #4
    Thank's for your responses , but what i was talking was generaly not for a specific library .

    legend2 was close , ./configure

    what i need to do is place the libraries in the pho folder and execute ./configure with the xxxx
     
    commandos, May 7, 2007 IP
  5. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #5
    Well, if your php installation depends on a library, like the ones you posted in the example, you need to build them independantly of your php build / source, and then you can recompile php with --enable-extension once you have copied the source of that extension from pecl or php to /ext in your php source directory, however most of the time, it's more sensible to build shared libraries, and add them to php.ini, or use dl if you can - otherwise your php processes will start to hog unecessary memory.

    provided all dependant libraries are installed beforehand as before, you can download the extension, unpack the source, cd to that directory, do phpize then look at ./configure --help for options for the extension, then ./configure --with-options && make, you should then check the /modules directory inside your working directory for a module.so, if you see one and there are no fatal errors on screen ( it should only exist if there aren't ) go ahead and make install, only some extensions edit php.ini, you then edit php.ini and restart the httpd ......
     
    krakjoe, May 7, 2007 IP
  6. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #6
    Thank's krakjoe , i will mess with my local server before messing with my real server :D

    10X for the help :)
     
    commandos, May 7, 2007 IP
  7. paidhosting

    paidhosting Peon

    Messages:
    4,822
    Likes Received:
    483
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Wats a 10X ? Is it your scopes zoom ?
     
    paidhosting, May 10, 2007 IP