Post: Warning: msg_get_queue (): failedforkey0x610005bd: Fileexistsin I wrote the following php file in my environment:
$ Msg_key = ftok (_ FILE __, 'A ');
$ Seg = msg_get_queue ($ msg_key, 0666 );
?>
The command line cannot output errors.
However, when executing a webpage, the following error occurs:
Warning: msg_get_queue (): failed for key 0x610005bd: File exists in/var/www/html/test/sysvmsg. php on line 4
I am troubled by this afternoon. please kindly advise me.
My Environment: linux + apache + php 5.3.3
Reply to discussion (solution)
Look at the php documentation to say http://php.net/msg_get_queue
Echo 100>/proc/sys/fs/mqueue/msg_max
Ftok returns an integer.
Msg_get_queue sends a message
The hexadecimal 0x610005bd is 1627391421 in decimal format.
Do you get and send this number?
If you are getting this message on your * NIX box:
Warning: msg_get_queue () [function. msg-get-queue]: failed for key 0x12345678: No space left on device in/path/to/script. php on line 1
You may use the command "ipcrm" as root to clear the message queue. Use "man ipcrm" to get more info on it.
The default setting for maximum messages in the queue is stored in/proc/sys/fs/mqueue/msg_max. To increase it to a maximum of 100 messages, just run:
Echo 100>/proc/sys/fs/mqueue/msg_max
Please ensure to follow a good programming style and close/free all your message queues before your script exits to avoid those warning messages.
This is in the manual. it is consistent with your situation!
You can use the command ipcrm as the root to clear the message queue, and then use man ipcrm to get more information.
The maximum number of messages in the queue is stored in/proc/sys/fs/mqueue/msg_max by default. to add up to 100 messages, run
Echo 100>/proc/sys/fs/mqueue/msg_max
Http://www.baidu.com/baidu? Wd = Warning % 3A + msg_get_queue % 28% 29% 3A + failed + for + key + 0x610005bd % 3A + File + exists + in + % 2 Fvar % 2 Fwww % 2 Fhtml % 2 Ftest % 2Fsysvmsg. php + on + line + 4 & tn = monline_dg
The reason is that SELinux is not closed.