You are not logged in.

#1 2009-10-04 07:42:06

Recursive
Member
Registered: 2009-03-18
Posts: 5

[SOLVED] PHP shared memory functions are not defined

I have a server set up with Apache + PHP using the SAPI module. When I try to load a php file off my server that uses the shm_attach() function, it fails. The error log says: " PHP Fatal error:  Call to undefined function shm_attach()" . According to the PHP website (http://www.php.net/manual/en/sem.installation.php), this function should be compiled in if the --enable-sysvshm option is passed to configure. The output of phpinfo() indicates that this flag was used for the Arch Linux build of PHP (it contains the flags "'--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared'", which should enable not only shared memory but all of the PHP IPC commands). So, what gives? Why am I getting this error?

Last edited by Recursive (2009-10-04 08:21:44)

Offline

#2 2009-10-04 07:59:20

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [SOLVED] PHP shared memory functions are not defined

I believe that '--enable-foo=shared' compiles 'foo' as a separate extension (instead of built-in). Try uncommenting the relevant extensions in /etc/php/php.ini:

php.ini, around line 985 wrote:

;extension=sysvmsg.so
;extension=sysvsem.so
;extension=sysvshm.so

Offline

#3 2009-10-04 08:20:57

Recursive
Member
Registered: 2009-03-18
Posts: 5

Re: [SOLVED] PHP shared memory functions are not defined

That was the problem. Thanks much.

Offline

Board footer

Powered by FluxBB