Re: [PHP-DEV] Shared memory in extensions

2001-04-03 Thread Alexander Feldman

On Tue, 3 Apr 2001, Thomas Wentzel wrote:

[snip]

> Where can I find a good explanation as to what the differences are
> between
> MINIT, RINIT, MSHUTDOWN and RSHUTDOWN?

http://www.zend.com/apidoc/x629.php

> 
> hehe - how would one go about removing a shared memory segment
> manually??

ipcrm (see also ipcs)

[snip]

Regards:

Alex


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Shared memory in extensions

2001-04-03 Thread Thomas Wentzel

Alexander!

You're absolutely right - that was exactly what I had done!
Hmm I guess that at his point I have noone fooled :) I'm totally new
to all this shm stuff and PHP extensions or rather the intrinsic details
of their 'inner' workings... I simply figured that if I allocate a
shared 
memory segment in PHP_MINIT_FINCTION then it should be destroyed in
PHP_MSHUTDOWN_FUNCTION. The error I did (I reckon) was to compile and 
replace the PHP-module before restarting apache. This way the new 
PHP_MSHUTDOWN_FUNCTION was called before PHP_MINIT_FUNCTION.

Where can I find a good explanation as to what the differences are
between
MINIT, RINIT, MSHUTDOWN and RSHUTDOWN?

hehe - how would one go about removing a shared memory segment
manually??

Well thank you all (Alexander in particular) for your answers they
helped alot

Thomas

Alexander Feldman wrote:
> 
> Hi Thomas,
> 
> I tried to create a shared segment of size 5 megabytes in the
> PHP_MINIT_FUNCTION and I had no problems.
> 
> The situation you described seems as you have called shmctl with IPC_RMID
> but not everyone had detached from the segment. Then you tried to use
> shmget and it failed - remove manually the shared memory segment and try
> again.
> 
> --
> Alexander Feldman
> Zend Technologies Ltd.
> phone: +972 3 6139665 ext. 113, fax: +972 3 6139671
> http://www.zend.com/
>

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Shared memory in extensions

2001-04-02 Thread Alexander Feldman

Hi Thomas,

I tried to create a shared segment of size 5 megabytes in the
PHP_MINIT_FUNCTION and I had no problems.

The situation you described seems as you have called shmctl with IPC_RMID
but not everyone had detached from the segment. Then you tried to use
shmget and it failed - remove manually the shared memory segment and try
again.

--
Alexander Feldman
Zend Technologies Ltd.
phone: +972 3 6139665 ext. 113, fax: +972 3 6139671
http://www.zend.com/

On Mon, 2 Apr 2001, Thomas Wentzel wrote:

> Hehe - sorry :)
> Errno is set to 43 (Identifier removed (?))
> 
> 
> The URL is:
> http://www.humanfactor.com/cgi-bin/cgi-delegate/apache-ML/nh/1999/Jan/0467.html
> - enjoy ;)
> 
> Thomas
> 
> Gavin Sherry wrote:
> > 
> > Thomas,
> > 
> > When shmget() fails, it sets errno. It would be useful if you could
> > provide this information (see shmget(2)).
> > 
> > Also, do you have a URL got SHM across HTTP patch? This sounds like fun =)
> > 
> > Gavin
> > 
> > On Mon, 2 Apr 2001, Thomas Wentzel wrote:
> > 
> > > shmid=shmget((key_t)5346,sizeof(dbinfo),0666|IPC_CREAT);
> > > which returns -1
> > >
> > > I just found something about a patch to apache, that should enable
> > > som shared memory pools across http session! Is this something I
> > > should use? It was a rather old patch (for apache 1.3.4/5)...
> > >
> > > Thanx
> > >   Thomas
> > >
> > > Alexander Feldman wrote:
> > > >
> > > > On Mon, 2 Apr 2001, Thomas Wentzel wrote:
> > > >
> > > > > Linux!
> > > > >
> > > > > RedHat 6.2, Apache 1.3.14, PHP 4.0.4pl1
> > > > >
> > > > > I forgot to mention that because shmget fails and that it does so in
> > > > > PHP_MINIT_FUNCTION, apache wil not start!
> > > >
> > > > With what parameters are you calling shmget? What is the errno after this
> > > > call?
> > > >
> > >
> > >
> > 
> > --
> > PHP Development Mailing List 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Shared memory in extensions

2001-04-02 Thread Thomas Wentzel

Hehe - sorry :)
Errno is set to 43 (Identifier removed (?))


The URL is:
http://www.humanfactor.com/cgi-bin/cgi-delegate/apache-ML/nh/1999/Jan/0467.html
- enjoy ;)

Thomas

Gavin Sherry wrote:
> 
> Thomas,
> 
> When shmget() fails, it sets errno. It would be useful if you could
> provide this information (see shmget(2)).
> 
> Also, do you have a URL got SHM across HTTP patch? This sounds like fun =)
> 
> Gavin
> 
> On Mon, 2 Apr 2001, Thomas Wentzel wrote:
> 
> > shmid=shmget((key_t)5346,sizeof(dbinfo),0666|IPC_CREAT);
> > which returns -1
> >
> > I just found something about a patch to apache, that should enable
> > som shared memory pools across http session! Is this something I
> > should use? It was a rather old patch (for apache 1.3.4/5)...
> >
> > Thanx
> >   Thomas
> >
> > Alexander Feldman wrote:
> > >
> > > On Mon, 2 Apr 2001, Thomas Wentzel wrote:
> > >
> > > > Linux!
> > > >
> > > > RedHat 6.2, Apache 1.3.14, PHP 4.0.4pl1
> > > >
> > > > I forgot to mention that because shmget fails and that it does so in
> > > > PHP_MINIT_FUNCTION, apache wil not start!
> > >
> > > With what parameters are you calling shmget? What is the errno after this
> > > call?
> > >
> >
> >
> 
> --
> PHP Development Mailing List 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Shared memory in extensions

2001-04-02 Thread Gavin Sherry

Thomas,

When shmget() fails, it sets errno. It would be useful if you could
provide this information (see shmget(2)).

Also, do you have a URL got SHM across HTTP patch? This sounds like fun =)

Gavin


On Mon, 2 Apr 2001, Thomas Wentzel wrote:

> shmid=shmget((key_t)5346,sizeof(dbinfo),0666|IPC_CREAT);
> which returns -1
> 
> I just found something about a patch to apache, that should enable
> som shared memory pools across http session! Is this something I 
> should use? It was a rather old patch (for apache 1.3.4/5)...
> 
> Thanx
>   Thomas
> 
> Alexander Feldman wrote:
> > 
> > On Mon, 2 Apr 2001, Thomas Wentzel wrote:
> > 
> > > Linux!
> > >
> > > RedHat 6.2, Apache 1.3.14, PHP 4.0.4pl1
> > >
> > > I forgot to mention that because shmget fails and that it does so in
> > > PHP_MINIT_FUNCTION, apache wil not start!
> > 
> > With what parameters are you calling shmget? What is the errno after this
> > call?
> >
> 
> 


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Shared memory in extensions

2001-04-02 Thread Thomas Wentzel

shmid=shmget((key_t)5346,sizeof(dbinfo),0666|IPC_CREAT);
which returns -1

I just found something about a patch to apache, that should enable
som shared memory pools across http session! Is this something I 
should use? It was a rather old patch (for apache 1.3.4/5)...

Thanx
  Thomas

Alexander Feldman wrote:
> 
> On Mon, 2 Apr 2001, Thomas Wentzel wrote:
> 
> > Linux!
> >
> > RedHat 6.2, Apache 1.3.14, PHP 4.0.4pl1
> >
> > I forgot to mention that because shmget fails and that it does so in
> > PHP_MINIT_FUNCTION, apache wil not start!
> 
> With what parameters are you calling shmget? What is the errno after this
> call?
>

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Shared memory in extensions

2001-04-02 Thread Alexander Feldman

On Mon, 2 Apr 2001, Thomas Wentzel wrote:

> Linux!
> 
> RedHat 6.2, Apache 1.3.14, PHP 4.0.4pl1
> 
> I forgot to mention that because shmget fails and that it does so in 
> PHP_MINIT_FUNCTION, apache wil not start! 

With what parameters are you calling shmget? What is the errno after this
call?

-- Alex

> 
> Thomas
> 
> I compile the module _into_ PHP due to the 
> Alexander Feldman wrote:
> > 
> > On Mon, 2 Apr 2001, Thomas Wentzel wrote:
> > 
> > > Hi
> > >
> > > Can anybody help me?
> > >
> > > I'm trying to allocate some shared memory in the PHP_MINIT_FUNCTION -
> > > but it fails everytime during the shmget function.
> > > I then did a little stand-alone C-prog, that did the same (tried to
> > > allocate 3,5M of mem) and it works fine - everytime!
> > > Is there some issued when using shared mem in php extensions?
> > 
> > On what platform is this?
> > 
> > >
> > > BR
> > >   Thomas
> > 
> > -- Alex
> > 
> > >
> > > --
> > > PHP Development Mailing List 
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> > 
> > --
> > PHP Development Mailing List 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Shared memory in extensions

2001-04-02 Thread Thomas Wentzel

Linux!

RedHat 6.2, Apache 1.3.14, PHP 4.0.4pl1

I forgot to mention that because shmget fails and that it does so in 
PHP_MINIT_FUNCTION, apache wil not start! 

Thomas

I compile the module _into_ PHP due to the 
Alexander Feldman wrote:
> 
> On Mon, 2 Apr 2001, Thomas Wentzel wrote:
> 
> > Hi
> >
> > Can anybody help me?
> >
> > I'm trying to allocate some shared memory in the PHP_MINIT_FUNCTION -
> > but it fails everytime during the shmget function.
> > I then did a little stand-alone C-prog, that did the same (tried to
> > allocate 3,5M of mem) and it works fine - everytime!
> > Is there some issued when using shared mem in php extensions?
> 
> On what platform is this?
> 
> >
> > BR
> >   Thomas
> 
> -- Alex
> 
> >
> > --
> > PHP Development Mailing List 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> --
> PHP Development Mailing List 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Shared memory in extensions

2001-04-02 Thread Alexander Feldman

On Mon, 2 Apr 2001, Thomas Wentzel wrote:

> Hi
> 
> Can anybody help me?
> 
> I'm trying to allocate some shared memory in the PHP_MINIT_FUNCTION - 
> but it fails everytime during the shmget function.
> I then did a little stand-alone C-prog, that did the same (tried to 
> allocate 3,5M of mem) and it works fine - everytime!
> Is there some issued when using shared mem in php extensions?

On what platform is this?

> 
> BR
>   Thomas

-- Alex

> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]