Announcement

Collapse
No announcement yet.

gnupg for php (with apache)

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Apache/PHP] gnupg for php (with apache)

    Welcome to yet another howto. Those instructions should probably solve stuff that is impossible to find "bundled" at any search engine. There's only questions, questions and questions, but never answers. So here we go!


    Bundled installation of gnupg into PHP, step by step. You can probably also build gnupg as an extension, but I chose to bundle the package. You should also be aware of the path to your keys if you start your server with a root account, or if you run apache with suid-users. You may have to give gnupg some information about where it can find the keys, especially if root is involved.

    PHP Code:
    $gnupghome="/home/users/gnupg/.gnupg";
    putenv("GNUPGHOME=$gnupghome"); 
    
    Requirements and useful links
    Physical access to a webserver or a webhotel that support gnupg.

    gnupg (http://www.gnupg.org/)
    gpgme (http://www.gnupg.org/gpgme.html)
    php gnupg (http://pecl.php.net/package/gnupg)

    libs and addons that might be needed
    libgpg-error (http://www.gnupg.org/related_software/libgpg-error/)
    re2c (http://sourceforge.net/projects/re2c)
    PHP Bundling

    cd php-source/ext
    pecl download gnupg
    tar zxvf gnupg-1.3.1.tgz
    mv gnupg-1.3.1 gnupg
    cd ..
    mv configure
    configure_the_backup_plan
    ./buildconf --force
    A lot of work here
    Now let's check if we have the gnupg-switches
    ./configure --help
    At least I have:

    --with-gnupg=dir Include gnupg support
    configure --with-switches

    Now, this shows up
    configure:56876: checking for gnupg support
    configure:56915: result: yes
    configure:56927: checking for gnupg files in default path
    configure:56932: result: found in /usr/local/include
    make
    make install

    And phpinfo() says:




    Probably, if everything works properly, you could also use this command to make it easier for yourself (if you have access to pear and pecl):

    pecl install gnupg
    -
Sorry, you are not authorized to view this page
Working...
X