Re: shared memory access - shmod_open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for your reply. 

shmop_open($sem_key, "w", 420, 1) creates the same error message:

-----------
[07-Dec-2007 12:34:23] PHP Warning:  shmop_open(): unable to attach or
create shared memory segment in ...
[07-Dec-2007 12:34:23] PHP Stack trace:
[07-Dec-2007 12:34:23] PHP   1. {main}() ...test.php:0
[07-Dec-2007 12:34:23] PHP   2. shmop_open(1996497860, 'w', 420, 1) ...
test.php:13
------------

Now PHP (or whatever) doesn't change the value 420. I already googled for
the message, but could not find any hints.

Regards,
Rolf.




Richard Lynch wrote:
> 
> On Thu, December 6, 2007 2:44 am, Rolf_ wrote:
>> I have a problem working with shmop_open() in a Solaris environment.
>> The
>> following cli-script works fine, except shmod_open returns a warning
>> 'unable
>> to attach or create shared memory segment':
>>
>> <?php
>> $sem = "/tmp/" . rand() . ".sem";
>> touch ($sem);
>> echo "sem $sem \n";
>>
>> $sem_key = ftok($sem, 'w');
>> echo "sem_key $sem_key \n";
>>
>> if ($sem_key == -1) { die ("ftok error"); }
>>
>> $shm_id = shmop_open($sem_key, "w", 0644, 1);
>> echo "shm_id $shm_id\n";
>> ?>
>>
>> I checked the $sem_key with the Solaris ipcs command. The file exists
>> and
>> the read/write rights are correct. I tried explictly to call
>> shmop_open with
>> the right key - the error message remains the same.
>>
>> Checking out different access mode like "r" does not succeed too. In
>> the
>> Xdebug output, php changes the value 0644 to 420, i.e.
>> shmop_open(1258300033, 'w', 420, 1). Of course, I compiled php with
>> --enable-shmop.
>>
>> Does anyone has an idea what I might also check?
> 
> Perhaps the 0644 needs to be expressed in some other way?
> 
> I know it works fine that way for chmod and friends, so I wouldn't
> expect it, but...
> 
> Or maybe 420 *IS* the right value, and you're on a red herring.
> 
> Try Googling for the error message and Solaris if you haven't done
> that yet.
> 
> -- 
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/shared-memory-access---shmod_open-tf4954760.html#a14211151
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux