I have a sample php script to connect to MSMQ on windows. I can create queues and send messages to the queues, however when i try and open the queue to read the messages I keep getting an Access denied exception. the code is here:
http://pastebin.com/S5uCiP2Z
I think the main problem is the
$READ = $MSMQInfo->Open(2,0);
line as i am unsure what the 2, 0 options stand for (i cannot find an reference to those any where – i got that code form another example.) Looking at the docs for MSMQQueueInfo.open at http://msdn.microsoft.com/en-us/library/windows/desktop/ms707027%28v=vs.85%29.aspx I can see a few options but not any numeric options..
Any help would be vastly appreciated. And the reason for integrating with MSMQ is to provide an interim solution whilst moving between systems, our old system uses MSMQ so i need to have this interface.
Thanks
From here, you already know the parameters are:
and they also say that
In MSDN’s docs for MQACCESS they give you the numerical values for the constants:
The second parameter, ShareMode:
These constants are:
it’s indeed a little harder to find, but you can get it for example here, which is not much a reliable source, but I believe it’s correct.