You are here: Re: [PHP] Shared Memory Problem « PHP « IT news, forums, messages
Re: [PHP] Shared Memory Problem

Posted by Jochem Maas on 11/17/05 14:40

Yaswanth Narvaneni wrote:
> Hi!
>
> I found the solution to my prob. SELinux was enabled in the server
> which needs disabling. After disabling SELinux it was working great.
> Thanks for your help guys.
>
> Another small query though, is there anyway to enable SELinux and as
> well use shared memory between PHP and C++? I know using Zend engine

the zend engine is free.. I think you mean 'Zend <Some Product Name>' instead :-)

> would solve the prob, but we need to buy zend which is very costly for
> me, any other solution is welcome.

I have no idea if it either possible or efficient enough for your
needs but you may be able to use pipes?

http://php.net/proc_open


>
> Regards,
> Yaswanth
>
> On 11/16/05, Curt Zirzow <czirzow@gmail.com> wrote:
>
>>On Wed, Nov 16, 2005 at 03:33:22AM +0530, Yaswanth Narvaneni wrote:
>>
>>>Hi!
>>>
>>>I have a server written in C++ and my webpages are in PHP. The PHP has
>>>to communicate with the server using shared memory. This was working
>>>fine on the server running FC-1 with php-4.3.8. We recently migrated
>>>to CentOS 4.1 (Equivalent to RHEL 4.1) running php-4.3.9. The error it
>>>displays is as follows:
>>>
>>>shmop_open(): unable to attach or create shared memory segment in
>>>/var/www/html/sharedmem.php on line 2
>>>
>>>The server opens the shm in 666 (originally was 644) even then it was
>>>not working. I can see the shared mem open using 'ipcs' command.
>>>
>>>...
>>>$shm_id = shmop_open($shm_key, "a",0,0) or die("FATAL ERROR:: Unable
>>>to Access Shared Memory");
>>
>>You might want to try to open it within the same mode that the
>>server created it in:
>>
>>1)
>> $shm_id = shmop_open($shm_key, "a",0666,0);
>>
>>2)
>> are you 100% sure the key is valid? the error message you are
>> getting seems to point in this direction since the shmop_open is
>> failing on the C call to shmget(), wich usually fails when either
>> you dont have enough memory to create it (which you arn't doing),
>> some other creation problems, or that the key supplied wasn't
>> found.
>>
>>
>>Curt.
>>--
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
> --
> "In theory there is no difference between theory and practice.
> In practice there is." -- Fortune Cookie
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация