Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7900711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:02:13+00:00 2026-06-03T09:02:13+00:00

I have a sample php script to connect to MSMQ on windows. I can

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:02:14+00:00Added an answer on June 3, 2026 at 9:02 am

    From here, you already know the parameters are:

    Function Open(Access, ShareMode)
    

    and they also say that

    Access can be set to one of the following:

    MQ_PEEK_ACCESS: Messages can only be looked at. They cannot be removed from the queue.

    MQ_SEND_ACCESS: Messages can only be sent to the queue.

    MQ_RECEIVE_ACCESS: Messages can be retrieved (read and removed) from the queue, peeked at, or purged. See the description of the ShareMode argument for information on limiting who can retrieve messages from the queue.

    MQ_PEEK_ACCESS | MQ_ADMIN_ACCESS: Messages in the local outgoing queue can only be peeked at (read without being removed from the queue).

    MQ_RECEIVE_ACCESS | MQ_ADMIN_ACCESS: Messages in the local outgoing queue can be retrieved (read and removed from the queue), peeked at (read without being removed from the queue), or purged (deleted).

    In MSDN’s docs for MQACCESS they give you the numerical values for the constants:

    typedef  enum 
    {
      MQ_RECEIVE_ACCESS = 1,
      MQ_SEND_ACCESS = 2,
      MQ_PEEK_ACCESS = 0x0020,
      MQ_ADMIN_ACCESS = 0x0080
    } MQACCESS;
    

    The second parameter, ShareMode:

    ShareMode specifies who can access the queue. Set to one of the following:

    MQ_DENY_NONE: Default. The queue is available to all members of the Everyone group. This setting must be used if Access is set to MQ_PEEK_ACCESS or MQ_SEND_ACCESS.

    MQ_DENY_RECEIVE_SHARE: Limits those who can retrieve messages from the queue to this process. If the queue is already opened for retrieving messages by another process, this call fails and an MQ_ERROR_SHARING_VIOLATION (0xC00E0009) error is generated. Applicable only when Access is set to MQ_RECEIVE_ACCESS.

    These constants are:

    Const MQ_DENY_NONE = 0
    Const MQ_DENY_RECEIVE_SHARE = 1
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple php script on a server that's using fsockopen to connect
I have a php script that limits the amount of times people can download
I have a simple php script on my domain that sends me an email:
I have a simple PHP script that will either serve up a streaming ASF
Here I have a simple php script which displays some values from a database
I have simple question. User supplies URL to my PHP script where I fetch
i have the following simple script <input class=input type=text name=password style=color: #797272; value= <?php
I have written a very very very simple!! script in php. header redirection not
I currently have this piece of code: NSString *strURL = [NSString stringWithFormat:@http://www.sample.com /phpFile.php?firstname=%@,txtfirstName.text]; NSString
How to manually create Friendly URLs? (PHP) So I have created simple php file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.