Problem with Shared Memory and Semaphores


The environment is Centos 6.3 with PHP 5.3.3. It has been compiled with "’–enable-sysvsem’ ‘–enable-sysvshm’ ‘–enable-sysvmsg’ " but I do not have semaphore functions or shared memory functions available. PHP has been installed using yum.

I created a very simply script to test this:

<?php function check($func) { if(function_exists($func)) echo "$func() exists
"; else echo "$func() does not exist
"; } check('http_build_query'); check('fopen'); check('sem_get'); check('sem_aquire'); check('sem_release'); check('shm_attach'); check('shm_remove'); check('ftok'); echo phpinfo(); ?>[/php]

The output produces:

http_build_query() exists
fopen() exists
sem_get() does not exist
sem_aquire() does not exist
sem_release() does not exist
shm_attach() does not exist
shm_remove() does not exist
ftok() exists

PHP Version 5.3.3

System	Linux 2.6.32-279.19.1.el6.x86_64 #1 SMP Wed Dec 19 07:05:20 UTC 2012 x86_64
Build Date	Jul 3 2012 16:53:58
Configure Command	 './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' [b]'--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg'[/b] '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' '--without-sqlite3' '--disable-phar' '--disable-fileinfo' '--disable-json' '--without-pspell' '--disable-wddx' '--without-curl' '--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem'
Server API	Apache 2.0 Handler

Is there anything else I need to do to make these functions available? Also, why would ftok() be available when all the other semaphoe and share memory functions are not?

If anyone can point me in the right direction - I am

Go back and look through the error log, see if the files got copied to the right place.

Thanks - I have just found the answer to the issue.

I needed to do a yum install php-process (which I had done), but I had not restarted httpd.

Working now - thanks.

Sponsor our Newsletter | Privacy Policy | Terms of Service