You are not logged in.

#1 2006-02-25 12:48:05

musunge
Member
Registered: 2006-02-25
Posts: 3

php and mcrypt

I just switched to Arch Linux - wish I found it earlier!

Just one problem now that I can't find a solution in the FAQ/FORUMS etc....

I'm using Noodle (appropriately in my case) and downloaded Apache and php, so I've got php version 5.1.2.1.   It works fine, but I need to use the mcrypt functions.  They don't work because the extension library mcrypt.so is not present.

I downloaded the package libmcrypt, but this doesnt seem to include the php extension library....

Is there a way to get this from the Arch repositories?  I don't really want to download the entire php source from php.net and spend ages compiling and configuring.

Perhaps this should be in the "idiots" forum?  Please excuse my ignorance, but I am not a php expert.

Thanks in advance

Offline

#2 2006-02-26 12:08:58

monsieurseb
Member
Registered: 2005-04-12
Posts: 24
Website

Re: php and mcrypt

Hi,

The arch's php package did not contains mcrypt module. You need to recompile libmcrypt with a different option (look at the php's doc) and recompile php.
Have a look to the wiki for making package.

Good luck

Offline

#3 2006-02-26 18:09:32

juergen
Developer
From: Frankfurt/Germany
Registered: 2005-04-11
Posts: 48
Website

Re: php and mcrypt

No  need to recompile the whole php package. You can build mcrypt  as shared extension. Try the following PKGBUILD:

# $Id: PKGBUILD,v 1.2 2006/02/21 16:10:42 juergen Exp $
# Maintainer: Juergen Hoetzel <juergen@hoetzel.info>
pkgname=php-mcrypt
pkgver=5.1.2
pkgrel=1
pkgdesc="php nterface to the mcrypt library"
url="http://www.php.net/mcrypt"
depends=("php=$pkgver" "libmcrypt")
makedepends=("gcc")
source=(http://www.php.net/distributions/php-$pkgver.tar.gz)
md5sums=('ed3d099828282e66c66cadd8d879d739')

build() {
  cd $startdir/src/php-$pkgver/ext/mcrypt/
        phpize || return 1 
  ./configure || return 1
  make || return 1
  make INSTALL_ROOT=$startdir/pkg install
}

And add

extension=mcrypt.so

to your /etc/php.ini

Disadvantage: Fixed dependency on php-version. But this prevents me from breaking my package when PHP Extension API changes

Offline

#4 2006-02-26 21:21:59

monsieurseb
Member
Registered: 2005-04-12
Posts: 24
Website

Re: php and mcrypt

juergen>
According to the php's official doc, libmcrypt needs to be compiled with  this option :

--disable-posix-threads

The arch's libmcrypt pkg did not have this option.
So you need at least to recompil libmcrypt.

however, your method for a shared extension is a very good idea !

Regards

Offline

#5 2006-02-26 22:53:41

juergen
Developer
From: Frankfurt/Germany
Registered: 2005-04-11
Posts: 48
Website

Re: php and mcrypt

monsieurseb wrote:

juergen>
According to the php's official doc, libmcrypt needs to be compiled with  this option :

--disable-posix-threads

The php guys dont explain 'why to disable this feature'.
I don't really know if this is a relict from old days (when php was not  thread-safe). But  i have some php mcrypt  scripts deployed without  problems yet..  Maybe i'm just in luck wink

Jürgen

Offline

#6 2006-02-27 18:00:56

musunge
Member
Registered: 2006-02-25
Posts: 3

Re: php and mcrypt

Thanks for help, all (esp. Joergen).  I'm quite pleased with myself, I worked out from your help how to build the extension and it all works perfectly!
I didn't bother to recompile libmcrpyt....

Offline

Board footer

Powered by FluxBB