Welcome! Log In Create A New Profile

Advanced

mcrypt not loading with php-fpm

Posted by Matthew Goslett 
mcrypt not loading with php-fpm
November 06, 2010 09:36AM
I'm running Ubuntu Lucid and have setup nginx with php-fpm using Brian Mercer's package here -> https://launchpad.net/~brianmercer

I have php5-mcrypt installed from the standard Ubuntu repos and php loads the additional ini /etc/php5/fpm/conf.d/mcrypt.ini; however the module doesn't show as loaded in phpinfo(). I also have a cli version of php installed and a phpinfo() shows mcrypt enabled. I have my fpm and cli versions set to include the same configs and load the same extensions so I'm not sure why it's not working in fpm.


Linux zorro 2.6.18-194.8.1.el5.028stab070.5PAE #1 SMP Fri Sep 17 19:27:06 MSD 2010 i686 GNU/Linux
nginx/0.8.53
PHP Version 5.3.2-1ubuntu4.5ppa5~lucid1
Suhosin Extension 0.9.29
Jérôme Loyet
Re: mcrypt not loading with php-fpm
November 06, 2010 09:40AM
2010/11/6 Matthew Goslett <nginx-forum@nginx.us>:
> I'm running Ubuntu Lucid and have setup nginx with php-fpm using Brian
> Mercer's package here -> https://launchpad.net/~brianmercer
>
> I have php5-mcrypt installed from the standard Ubuntu repos and php
> loads the additional ini /etc/php5/fpm/conf.d/mcrypt.ini; however the
> module doesn't show as loaded in phpinfo().  I also have a cli version
> of php installed and a phpinfo() shows mcrypt enabled.  I have my fpm
> and cli versions set to include the same configs and load the same
> extensions so I'm not sure why it's not working in fpm.

when you compare phpinfo() output between cli and fpm, what does it say ?

>
>
> Linux zorro 2.6.18-194.8.1.el5.028stab070.5PAE #1 SMP Fri Sep 17
> 19:27:06 MSD 2010 i686 GNU/Linux
> nginx/0.8.53
> PHP Version 5.3.2-1ubuntu4.5ppa5~lucid1
> Suhosin Extension 0.9.29
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,148257,148257#msg-148257
>
>
Re: mcrypt not loading with php-fpm
November 06, 2010 09:48AM
Matthew Goslett Wrote:
-------------------------------------------------------
> I'm running Ubuntu Lucid and have setup nginx with
> php-fpm using Brian Mercer's package here ->
> https://launchpad.net/~brianmercer
>
> I have php5-mcrypt installed from the standard
> Ubuntu repos and php loads the additional ini
> /etc/php5/fpm/conf.d/mcrypt.ini; however the
> module doesn't show as loaded in phpinfo(). I
> also have a cli version of php installed and a
> phpinfo() shows mcrypt enabled. I have my fpm and
> cli versions set to include the same configs and
> load the same extensions so I'm not sure why it's
> not working in fpm.
>

I haven't experienced any problems using the php5-mcrypt package from the Lucid repo.

Are both cli and fpm loading it by including /etc/php5/conf.d/mcrypt.ini which is symlinked to both /etc/php5/fpm/conf.d/ and /etc/php5/cli/conf.d/ and has this in it:

; configuration for php MCrypt module
extension=mcrypt.so
Re: mcrypt not loading with php-fpm
November 06, 2010 09:54AM
The cli and fpm versions are both using the same /etc/php5/cli/conf.d/mcrypt.ini file symlinked through /etc/php5/fpm/conf.d/*

cat /etc/php5/fpm/conf.d/mcrypt.ini shows:
[code]
# configuration for php MCrypt module
extension=mcrypt.so
[/code]

The cli phpinfo() shows:
[code]
mcrypt

mcrypt support => enabled
Version => 2.5.8
Api No => 20021217
Supported ciphers => cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes => cbc cfb ctr ecb ncfb nofb ofb stream
[/code]

where as the only reference to mcrypt in the fpm phpinfo() is that it's loaded the additional config file /etc/php5/cli/conf.d/mcrypt.ini

I can't find any errors related to the loading of the extension in php5-fpm.log or my nginx error log. If I however try to use a mcrypt function, it logs that the function is inexistent.
Jérôme Loyet
Re: mcrypt not loading with php-fpm
November 06, 2010 10:00AM
2010/11/6 Matthew Goslett <nginx-forum@nginx.us>:
> The cli and fpm versions are both using the same
> /etc/php5/cli/conf.d/mcrypt.ini file symlinked through
> /etc/php5/fpm/conf.d/*
>
> cat /etc/php5/fpm/conf.d/mcrypt.ini shows:
> [code]
> # configuration for php MCrypt module
> extension=mcrypt.so
> [/code]
>
> The cli phpinfo() shows:
> [code]
> mcrypt
>
> mcrypt support => enabled
> Version => 2.5.8
> Api No => 20021217
> Supported ciphers => cast-128 gost rijndael-128 twofish arcfour cast-256
> loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256
> serpent xtea blowfish enigma rc2 tripledes
> Supported modes => cbc cfb ctr ecb ncfb nofb ofb stream
> [/code]
>
> where as the only reference to mcrypt in the fpm phpinfo() is that it's
> loaded the additional config file /etc/php5/cli/conf.d/mcrypt.ini
>
> I can't find any errors related to the loading of the extension in
> php5-fpm.log or my nginx error log.  If I however try to use a mcrypt
> function, it logs that the function is inexistent.

- please make a complete diff of both phpinfo input
- are you using chroot ? if so, please disable it to check if it
mcrypt.so is loaded

>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,148257,148264#msg-148264
>
>
Re: mcrypt not loading with php-fpm
November 06, 2010 10:16AM
Matthew Goslett Wrote:
-------------------------------------------------------
> The cli and fpm versions are both using the same
> /etc/php5/cli/conf.d/mcrypt.ini file symlinked
> through /etc/php5/fpm/conf.d/*
>
> cat /etc/php5/fpm/conf.d/mcrypt.ini shows:
>
> # configuration for php MCrypt module
> extension=mcrypt.so
>
>
> The cli phpinfo() shows:
>
> mcrypt
>
> mcrypt support => enabled
> Version => 2.5.8
> Api No => 20021217
> Supported ciphers => cast-128 gost rijndael-128
> twofish arcfour cast-256 loki97 rijndael-192
> saferplus wake blowfish-compat des rijndael-256
> serpent xtea blowfish enigma rc2 tripledes
> Supported modes => cbc cfb ctr ecb ncfb nofb ofb
> stream
>
>
> where as the only reference to mcrypt in the fpm
> phpinfo() is that it's loaded the additional
> config file /etc/php5/cli/conf.d/mcrypt.ini
>
> I can't find any errors related to the loading of
> the extension in php5-fpm.log or my nginx error
> log. If I however try to use a mcrypt function,
> it logs that the function is inexistent.

I remember getting a warning that # is deprecated and so the comment needed to be changed to a ; in
/etc/php5/conf.d/mcrypt.ini but I don't recall that stopping it from loading. Something to try though.

I assume you tried a full "service php5-fpm stop" and "killall php5-fpm" and "service php5-fpm start". Sometimes the restart in the init script is flaky.
Re: mcrypt not loading with php-fpm
November 06, 2010 10:16AM
I'm not running anything in a chroot environment.

I've uploaded copies of the 2 phpinfo() results.

cli - http://pastebin.com/imGHYQKL
fpm - http://pastebin.com/1x8nvyUP
Re: mcrypt not loading with php-fpm
November 06, 2010 10:21AM
ye, I've tried killing fpm completely, restarting it as well as nginx but the result's the same.

I've tried purging and reinstalling php5-mcrypt but again, no such luck.

I've changed the # to ;, willing to try anything at this point :) but it just removes the deprecated warning.
Jérôme Loyet
Re: mcrypt not loading with php-fpm
November 06, 2010 10:24AM
2010/11/6 Matthew Goslett <nginx-forum@nginx.us>:
> I'm not running anything in a chroot environment.
>
> I've uploaded copies of the 2 phpinfo() results.
>
> cli - http://pastebin.com/imGHYQKL
> fpm - http://pastebin.com/1x8nvyUP

in fact you have problem with all dynamic extension. gd, curl, apc,
mcrypt are not loeded with FPM
Re: mcrypt not loading with php-fpm
November 06, 2010 10:27AM
well spotted :) I didn't pick up on anything else, just mcrypt since Roundcube Webmail displayed a warning during installation.

Any ideas as to how I could debug this, or should I perhaps try a complete re-install? It's a development server so no harm in fiddling here.
Jérôme Loyet
Re: mcrypt not loading with php-fpm
November 06, 2010 10:32AM
2010/11/6 Matthew Goslett <nginx-forum@nginx.us>:
> well spotted :) I didn't pick up on anything else, just mcrypt since
> Roundcube Webmail displayed a warning during installation.
>
> Any ideas as to how I could debug this, or should I perhaps try a
> complete re-install?  It's a development server so no harm in fiddling
> here.
>

stop fpm
strace -efile /path/to/php-fpm -i > /dev/null

and see what file are lstat and/or open

++ Jerome

> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,148257,148277#msg-148277
>
>
Re: mcrypt not loading with php-fpm
November 06, 2010 10:41AM
thanks

I'm not experienced with strace or debugging so would appreciate any help interpreting this.

strace of php binary - http://pastebin.com/HS6Cg0gU
strace of php5-fpm binary - http://pastebin.com/cwWYANG7
Jérôme Loyet
Re: mcrypt not loading with php-fpm
November 06, 2010 10:54AM
2010/11/6 Matthew Goslett <nginx-forum@nginx.us>:
> thanks
>
> I'm not experienced with strace or debugging so would appreciate any
> help interpreting this.
>
> strace of php binary - http://pastebin.com/HS6Cg0gU
> strace of php5-fpm binary - http://pastebin.com/cwWYANG7

it shows that mcrypt.ini is open (and hopefully read) in both case:
stat64("/etc/php5/cli/conf.d/mcrypt.ini", {st_mode=S_IFREG|0644,
st_size=58, ...}) = 0
open("/etc/php5/cli/conf.d/mcrypt.ini", O_RDONLY|O_LARGEFILE) = 3

it show that mcrypt.so is open only with CLI
open("/usr/lib/php5/20090626+lfs/mcrypt.so", O_RDONLY) = 3

after reading all .ini conf files.
FPM opens:
mysqli.so
pdo.so
pdo_mysql.so
pspell.so
suhosin.so

CLI opens:
apc.so
curl.so
gd.so
imap.so
mcrypt.so
memcache.so
mysql.so
mysqli.so
pdo.so
pdo_mysql.so
pspell.so
suhosin.so

I have no fucking idea why there is such a difference.

On my dev env, I can load apc, curl and gd in fpm without any problem.

>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,148257,148282#msg-148282
>
>
Re: mcrypt not loading with php-fpm
November 06, 2010 10:58AM
thanks

I guess I'll try a complete purge of all php packages and re-install.
Re: mcrypt not loading with php-fpm
November 06, 2010 11:15AM
A re-install seems to have fixed everything.

I think it may have been the order in which I originally installed it, php, php-cli, extensions, then php fpm, although I'm not sure why this should make a difference. I re-installed php, php-cli, php fpm and then extensions and they're all loading 100%.
Jérôme Loyet
Re: mcrypt not loading with php-fpm
November 06, 2010 11:22AM
glad to ear it works, but there's maybe a small bug with ubuntu PHP packaging.

2010/11/6 Matthew Goslett <nginx-forum@nginx.us>:
> A re-install seems to have fixed everything.
>
> I think it may have been the order in which I originally installed it,
> php, php-cli, extensions, then php fpm, although I'm not sure why this
> should make a difference.  I re-installed php, php-cli, php fpm and then
> extensions and they're all loading 100%.
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,148257,148294#msg-148294
>
>
Sammie Taunton
Re: mcrypt not loading with php-fpm
November 06, 2010 01:12PM
I can comfirm that installing php-fpm with mcrypt works just fine when compiling together. Its part of my standard install.

Sent from my iPhone

On Nov 6, 2010, at 10:21, Jérôme Loyet <ml@fatbsd.com> wrote:

> glad to ear it works, but there's maybe a small bug with ubuntu PHP packaging.
>
> 2010/11/6 Matthew Goslett <nginx-forum@nginx.us>:
>> A re-install seems to have fixed everything.
>>
>> I think it may have been the order in which I originally installed it,
>> php, php-cli, extensions, then php fpm, although I'm not sure why this
>> should make a difference. I re-installed php, php-cli, php fpm and then
>> extensions and they're all loading 100%.
>>
>> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,148257,148294#msg-148294
>>
>>
Re: mcrypt not loading with php-fpm
November 27, 2010 07:32AM
I have the exact same issue just with apc.so / eaccelerator.so.

memcache.so works okay.
Cli outputs / loads apc.so.

fpm just dont.

------------------------------------------------
Nils Eriksen, CEO
http://www.procontractors.eu/
Re: mcrypt not loading with php-fpm
November 27, 2010 07:55AM
Fixed!

Just needed to ensure that my php-fpm init script did infact kill all process.
Why it was unable to identify changes to the php.ini config file.

------------------------------------------------
Nils Eriksen, CEO
http://www.procontractors.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 188
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready