ID:               27271
 Updated by:       [EMAIL PROTECTED]
 Reported By:      yury at gorodok dot net
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: win32 only
 PHP Version:      5.0.0b4 (beta4)
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

As Ilia said, Shmop won't work when PHP is in CLI or CGI mode.


Previous Comments:
------------------------------------------------------------------------

[2004-02-17 11:26:48] yury at gorodok dot net

http://us2.php.net/manual/en/ref.shmop.php says:

<<Note that versions of Windows previous to Windows 2000 do not support
shared memory.>>

I use Windows 2000. It's not <previous> and I've not found anything
about emulation nor current enviroment.

Sorry, that I don't know Windows enough to undestand that shmop CANN'T
work on it properly.

May be, there should be a note in manual?

------------------------------------------------------------------------

[2004-02-17 10:48:20] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

SHM is emulated on win32 and the nature of the emulation 

that it would work only in a persistent environment such as 

Apache or IIS (not cgi or cli). 

------------------------------------------------------------------------

[2004-02-16 23:13:57] yury at gorodok dot net

sh.php

<?php $shm_key= 111; $str="I was here."; $shm_id= shmop_open($shm_key,
"c", 0644, strlen($str));

 if ($shm_id== false) echo "I was unable to create shmop!<BR>";

 else { $wrb=shmop_write($shm_id,$str, 0); 

        if($wrb!= strlen($str)) echo $wrb." bytes was written of
".strlen($str)."!<BR>";

        echo "shm_id=".$shm_id."<BR>";  shmop_close($shm_id);} ?>



hh.php

<?php $shm_key= 111; [EMAIL PROTECTED]($shm_key, "a", 0, 0);

 if ($shm_id== false) echo "Couln'd open shm <".$shm_key.">!<BR>";

 else {$A=shmop_read($shm_id, 0, shmop_size($shm_id)); echo $A."<BR>";

       echo "shm_id=".$shm_id; shmop_close($shm_id); } ?>



hs.php

<?php $shm_key= 111; [EMAIL PROTECTED]($shm_key, "a", 0, 0);

 if ($shm_id== false) echo "Couln'd open shm <".$shm_key.">!<BR>";

 else {$A=shmop_read($shm_id, 0, shmop_size($shm_id)); echo $A."<BR>";

        echo "shm_id=".$shm_id;  shmop_delete($shm_id); 
shmop_close($shm_id); } ?>

------------------------------------------------------------------------

[2004-02-16 11:23:13] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.



------------------------------------------------------------------------

[2004-02-16 03:42:54] yury at gorodok dot net

Description:
------------
shmop doesn't work properly.

I start sh.php, which creates shmop segment and write a strring there.

After that I start hh.php, which should read string and write it in my
browser.

The hs.php deletes segment.



On FreeBSD with PHP 4.3.4(apache module and command line) this works
just fine.

But on Win2000SP2 with PHP5.0.0b4(commandline and cgi) I can access

shared memory segment only while the first script is running (I' ve
adde sleep(30) in it for test reasons).



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27271&edit=1

Reply via email to