[PHP] Example PHP shared memory code

2009-05-23 Thread Richard W
Hi I was wondering if anyone has some sample code whereby the PHP script connects to and reads data from some shared memory in Linux, where the shared memory was originally created by a* linux thread (as opposed to some PHP script)*? The example code needs to use shmop_open(...). Thanks in

Re: [PHP] Shared memory - linx and PHP newbie

2009-05-22 Thread Richard W
Thanks Daniel for your suggestions. What I have found are: 1) I'm assuming the key is good. A value of 1947143245 is returned. 2) I have set the permission of the shared memory (program.SCShared) to 777 octal (full read/write/execute access). The group and owner of the file is my login

[PHP] Shared memory - linx and PHP newbie

2009-05-21 Thread Richard W
Hi I have a query regarding shared memory created under Linux and then accessing it by PHP script. For my application, I have created a shared memory block in Debian Linux using the shm_open(..), ftruncate(...) and mmap(...) function calls. The shared memory block is of size 6304 bytes long. It

Re: [PHP] Shared memory - linx and PHP newbie

2009-05-21 Thread Daniel Brown
On Thu, May 21, 2009 at 10:15, Richard W rw180...@gmail.com wrote: Any help will be greatly appreciated, especially answering 2) as to why I can't read the data. Are you certain that the problem lies within the shmop reading? Check to see if the file is actually being accessed properly,

[PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Kent Larsson
Hi, Is it possible to have shared memory in the form of shared global variables in PHP? Or any other form of shared memory? And if that is the case, is there any form of mutex functionality which may be used to assure syncronized access to this memory? My next question is related to the first

Re: [PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Per Jessen
Kent Larsson wrote: Hi, Is it possible to have shared memory in the form of shared global variables in PHP? Or any other form of shared memory? And if that is the case, is there any form of mutex functionality which may be used to assure syncronized access to this memory? My next

Re: [PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Kent Larsson
Hi, Thank you for your answer. I was hoping there were a solution. :-/ It would have been nice as PHP has a large install base and is a quite common element in cheap web hosting solutions. Has anyone else got any more comments or suggestions? In absence of shared memory and threads. What I

Re: [PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Eric Butera
On Mon, Sep 1, 2008 at 5:45 PM, Kent Larsson [EMAIL PROTECTED] wrote: Hi, Thank you for your answer. I was hoping there were a solution. :-/ It would have been nice as PHP has a large install base and is a quite common element in cheap web hosting solutions. Has anyone else got any more

Re: [PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Micah Gersten
http://us2.php.net/apc Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Kent Larsson wrote: Hi, Is it possible to have shared memory in the form of shared global variables in PHP? Or any other form of shared memory? And if that is the case, is there any

Re: [PHP] Shared memory, mutex functionality and spawning threads. Is it possible using PHP?

2008-09-01 Thread Per Jessen
Kent Larsson wrote: In absence of shared memory and threads. What I really must have is some kind of mutex functionality. I will be manipulating files on disk and I don't want two instances to be able to touch the disk at the same time. Touch the disk or touch the file? I assume you meant

Re: [PHP] shared memory access - shmod_open

2007-12-11 Thread Rolf_
I tried the php function chmod($sem, 0644) which works fine even if it converts the octal number too, cf. xdebug trace file: 0.0037 50280 - chmod('/tmp/1521387531.sem', 420) ...myScripts/test.php:11 = TRUE 0.0039 50280 - shmop_open(2013277949,

Re: [PHP] shared memory access - shmod_open

2007-12-07 Thread Rolf_
Yes, thank you. I checked this thread before writing here. But following the hints there does not help either. Rolf. Daniel Brown-5 wrote: On Dec 6, 2007 3:44 AM, Rolf_ [EMAIL PROTECTED] wrote: Dear List, I have a problem working with shmop_open() in a Solaris environment. The

Re: [PHP] shared memory access - shmod_open

2007-12-07 Thread Rolf_
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}()

Re: [PHP] shared memory access - shmod_open

2007-12-07 Thread Peter Ford
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()

[PHP] shared memory access - shmod_open

2007-12-06 Thread Rolf_
Dear List, 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 =

Re: [PHP] shared memory access - shmod_open

2007-12-06 Thread Daniel Brown
On Dec 6, 2007 3:44 AM, Rolf_ [EMAIL PROTECTED] wrote: Dear List, 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': [snip!] Rolf, I don't

Re: [PHP] shared memory access - shmod_open

2007-12-06 Thread Richard Lynch
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);

Re: [PHP] Shared Memory Problem

2005-11-17 Thread Jochem Maas
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

Re: [PHP] Shared Memory Problem

2005-11-16 Thread Yaswanth Narvaneni
Hi Curt, These are my open shared memories in the server output of ipcs command. -- Shared Memory Segments keyshmid owner perms bytes nattch status 0x 18645001 gOLeM 600393216 2 dest 0x162e 18808842 root

Re: [PHP] Shared Memory Problem

2005-11-16 Thread Yaswanth Narvaneni
Hi! There is a strange problem now. This is the error message my php file gives. kernel not configured for shared memory kernel not configured for semaphores kernel not configured for message queues The source is as follows: ?php $shm_id = shmop_open(5678, a, 0, 0); if (!$shm_id) { echo

Re: [PHP] Shared Memory Problem

2005-11-16 Thread Yaswanth Narvaneni
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

[PHP] Shared Memory Problem

2005-11-15 Thread Yaswanth Narvaneni
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

Re: [PHP] Shared Memory Problem

2005-11-15 Thread Curt Zirzow
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

[PHP] shared memory

2004-05-19 Thread venkata ramana
Is the shared memory created with php comaptible with that created with a C program? I mean to ask, can we access the data written into shared memory by a C program from a php program? Thanks, ramana. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] shared memory

2004-05-19 Thread Burhan Khalid
venkata ramana wrote: Is the shared memory created with php comaptible with that created with a C program? I mean to ask, can we access the data written into shared memory by a C program from a php program? I would hope not, as this would cause major security problems and system instability. I

Re: [PHP] shared memory

2004-05-19 Thread venkata ramana
Thanks for your reply, but I afraid you did not get my point. I am talking about shared memory that is used for Interprocess communication. We can access the shared memory created by one C program in other C program and same is the case with php. I am trying to communicate with a C program from

[PHP] Shared Memory

2003-03-20 Thread Adam Voigt
Is the Shared Memory allocated with the SHMOP functions persistent? Like when a script ends, on the next call of a script, can you read the same memory block and have the data be there? -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key:

Re: [PHP] Shared Memory

2003-03-20 Thread Mincu Alexandru
nope! of course not there are two different procs. On Thu, 2003-03-20 at 17:19, Adam Voigt wrote: Is the Shared Memory allocated with the SHMOP functions persistent? Like when a script ends, on the next call of a script, can you read the same memory block and have the data be there? --

[PHP] Shared Memory in PHP

2002-12-13 Thread Krishnan
Hi all, I am new to PHP and would like the expert opinion of this forum on something that I am trying to do I have about 500K entries (name,value pairs) for which I want ti implement a very fast lookup. I have access to an Oracle database server but I am afraid that it does not have any

[PHP] Shared Memory Error.

2002-02-18 Thread Paul J. Stevens
I am using PHP Version 4.0.4pl1 with an Embedded Linux (PeeWee Linux, which is based on Red Hat 6.2 w/ a 2.2.18 Kernel). I have tried using shmop_open(), shm_open() shm_attach(). All of these give an error message of function not defined. It is not clear form the documentation that I have

Re: [PHP] Shared Memory Error.

2002-02-18 Thread Lars Torben Wilson
On Sun, 2002-02-17 at 23:34, Paul J. Stevens wrote: I am using PHP Version 4.0.4pl1 with an Embedded Linux (PeeWee Linux, which is based on Red Hat 6.2 w/ a 2.2.18 Kernel). I have tried using shmop_open(), shm_open() shm_attach(). All of these give an error message of function not

[PHP] read php shared memory with C

2001-12-14 Thread César Gómez
Hi all, Any one knows how to read a memory segment shared by php in C? I know how to read data from shared memory in C when the segment contains a (char *) or other type but PHP store the data like a Hash and I don't know to read it. Thanks in advance. P.D: Sorry for my English -- PHP

Re: [PHP] read php shared memory with C

2001-12-14 Thread Andrey Hristov
Read zend.h to see the structure of zval (the main zend strucutre). Regards, Andrey Hristov - Original Message - From: César Gómez [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 13, 2001 10:46 AM Subject: [PHP] read php shared memory with C Hi all, Any one knows

Re: [PHP] shared memory

2001-04-11 Thread Rasmus Lerdorf
One of the things you have to realize is that Apache-1.3.x is is single-threaded pre-forking multi-process web server. That means that you have many processes handling requests. You never know which process will take a request, so storing any sort of data in a process won't do much good as the

[PHP] shared memory

2001-04-09 Thread Stephen Haberman
Hello, I've recently started PHP development after a few years of working with ASP. So far I really like PHP, but am having trouble using some of the techniques I had in ASP. For example, I really like using ASP's Application object to cache data in, but I can't seem to have an equivalent in

[PHP] Shared Memory weiredness

2001-04-09 Thread Alexander Skwar
Hello. I don't understand it at all. I'm trying to cache some data in a shared memory segment with PHP 4.0.4pl1's shm functions. I do this like this: ?php $key["shm"] = 0x4711; $key["var"] = 0x0815; $file = "services"; $size = filesize( $file ); $fd = fopen( $file, "r" ); $data = fread( $fd,

[PHP] shared memory questions

2001-03-14 Thread Monte Ohrt
Hi, I have a situation where I'd like to store some data in shared memory as opposed to repetitive database requests. Basically, I'd read in a (small) database table and serialize the results into shared mem. I've read through the semaphore and shared memory documentation, but some things are

WG: [PHP] Shared Memory with Yast-installed mod_php4 from SuSE.

2001-01-24 Thread Thomas Weber
-Ursprungliche Nachricht- Von: Thomas Weber [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 24. Januar 2001 09:50 An: [EMAIL PROTECTED] Betreff: AW: [PHP] Shared Memory with Yast-installed mod_php4 from SuSE. Thanks Stathis i tried it twice to compile it, ./configure , make

Re: WG: [PHP] Shared Memory with Yast-installed mod_php4 from SuSE.

2001-01-24 Thread Christian Reiniger
On Wednesday 24 January 2001 09:55, Thomas Weber wrote: Thanks Stathis i tried it twice to compile it, ./configure , make, make install. but i don't get a new libphp4.so! I found only a libphp4.a wich is 9MB (the original libphp4.so is only 2.5MB . You forgot the --with-apxs

AW: WG: [PHP] Shared Memory with Yast-installed mod_php4 from SuSE.

2001-01-24 Thread Thomas Weber
2001 12:15 An: Php-General Betreff: Re: WG: [PHP] Shared Memory with Yast-installed mod_php4 from SuSE. On Wednesday 24 January 2001 09:55, Thomas Weber wrote: Thanks Stathis i tried it twice to compile it, ./configure , make, make install. but i don't get a new libphp4.so! I found

[PHP] Shared Memory with Yast-installed mod_php4 from SuSE.

2001-01-23 Thread Thomas Weber
Hi, i try to use the shared memory functions on a SuSE Linux 7.0 server with Apache and mod_php4 out of the box installed with yast. For shmop i need to configure PHP with --enable-shmop with isn't enabled in this installation. I know how to enable this when compiling and installing the source

Re: [PHP] Shared Memory with Yast-installed mod_php4 from SuSE.

2001-01-23 Thread Rouvas Stathis
Hit Thomas, you need to recompile PHP with the options you want (as a shared apache module) and then replace libphp4.so on /usr/lib/apache/ with your own version. A good thing is to keep SuSE's version as a backup:-) Don't forget to restart apache afterwards. (/etc/rc.d/apache stop;