Hi,
I am trying to develop a very basic but portable chat engine with php.
I would like to develop it without any database or filesystem stuff,
because I want it very portable and easy to install. So I was looking
for a way to make scripts communicate, or keep a kind of state . So
someone told me to look for shared memory operations... shmop_open and
all this things.... but I cant seem to find a script that uses this,
or something that works...
I tried some examples (always same ones) on different phpsites, like
creating a shmop object, writing on it then reading from it, all in
the same script... what i would like to do is slightly different; have
a writer page, and a reader page, then i could do some kind of chat
..... the writer page would be the textsubmitter stuff... the reader
page would be an autoreloading page ... then with some simple
parameters I could finalize a very simple chat, pluggable anywhere ...
so ... When I do a write page, it works, but when I try to read, on
another script, with for example this:
<?
$shm_id = shmop_open(0xff 3, "a", 0644, 100);
echo $shm_id;
?>
0xff3 being the place where i created on the wrietr page ... then i
get:
Warning: shmop_open(): unable to attach or create shared memory
segment in /var/www/localhost/htdocs/chat/read.php on line 2
So I dont understand why it doesn't work !
Thanks for your attention
Patricio Stegmann
I am trying to develop a very basic but portable chat engine with php.
I would like to develop it without any database or filesystem stuff,
because I want it very portable and easy to install. So I was looking
for a way to make scripts communicate, or keep a kind of state . So
someone told me to look for shared memory operations... shmop_open and
all this things.... but I cant seem to find a script that uses this,
or something that works...
I tried some examples (always same ones) on different phpsites, like
creating a shmop object, writing on it then reading from it, all in
the same script... what i would like to do is slightly different; have
a writer page, and a reader page, then i could do some kind of chat
..... the writer page would be the textsubmitter stuff... the reader
page would be an autoreloading page ... then with some simple
parameters I could finalize a very simple chat, pluggable anywhere ...
so ... When I do a write page, it works, but when I try to read, on
another script, with for example this:
<?
$shm_id = shmop_open(0xff 3, "a", 0644, 100);
echo $shm_id;
?>
0xff3 being the place where i created on the wrietr page ... then i
get:
Warning: shmop_open(): unable to attach or create shared memory
segment in /var/www/localhost/htdocs/chat/read.php on line 2
So I dont understand why it doesn't work !
Thanks for your attention
Patricio Stegmann
Comment