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 8076527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:16:41+00:00 2026-06-05T15:16:41+00:00

This question is related to another question I wrote: Trouble using DOTNET from PHP.

  • 0

This question is related to another question I wrote:

Trouble using DOTNET from PHP.

Where I was using the DOTNET() function in PHP to call a DLL I had written.

I was able to get it working fine by running php.exe example.php from the command line (with the DLL’s still in the PHP folder).

I moved the php file to an IIS 7 webserver folder on the same machine (leaving the DLLs in the same php folder), but I keep getting a 500 internal service error.

I’ve checked the server logs (in c:\inetput\logs\ and in c:\windows\temp\php53errors) but there doesn’t seem to be any relevant information about what caused the error. I even tried to change the php.ini settings to get more error feedback, but that doesn’t seem to help.

I can only guess that the issue may be related to:

  1. that php file not having the proper permissions (my dll does some file reading/writing)
  2. php can’t find the DLLs

The actual error I get is:

The FastCGI process exited unexpectedly.

Any idea on how to debug this problem?

  • 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-05T15:16:42+00:00Added an answer on June 5, 2026 at 3:16 pm

    The problem here is almost certainly related to file permissions.

    When you run php.exe from the command line you run as your own logged-in user. When running a PHP script from IIS, in response to an http request, php.exe runs as a different user. Depending on your version of Windows it could be

    • IUSR_machine – on IIS6 and prior
    • IUSR on IIS7 and later

    These users need permissions on the php file to be executed.

    Read more about it

    On IIS7 and later I use a command-line tool called icacls.exe to set the permissions on directories or files that need to be read by IIS and the processes it starts (like php.exe). This security stuff applies to all IIS applications: PHP, ASPNET, ASP-classic, Python, and so on.

    IIS also needs to be able to read static files, like .htm, .js, .css, .jpog, .png files and so on. You can set the same permissions for all of them: Read and Execute.

    You can grant permissions directly to the user, like this:

     icacls.exe  YOUR-FILE-GOES-HERE  /grant "NT AUTHORITY\IUSR:(RX)"
    

    You can also grant permissions to the group, to which IUSR belongs, like this:

     icacls.exe YOUR-FILE-HERE  /grant "BUILTIN\IIS_IUSRS:(RX)"
    

    In either case you may need to stop and restart IIS after setting file-level permissions.

    If your .php script reads and writes other files or directories, then the same user needs pernissions on those other files and directories. If you need the .php script to be able to delete files, then you might want

     icacls.exe YOUR-FILE-HERE  /grant "BUILTIN\IIS_IUSRS:(F)"
    

    …which grants full rights to the file.

    You can grant permissions on an entire directory, too, specifying that all files created in that directory in the future will inherit the file-specific permissions set on the directory. For example, set the file perms for the directory, then copy a bunch of files into it, and all the files get the permissions from the parent. Do this with the OI and CI flags (those initials stand for “object-inherit” and “container-inherit”).

     icacls.exe DIRECTORY  /grant "BUILTIN\IIS_IUSRS:(OI)(CI)(RX)"
     copy FILE1 DIRECTORY
     copy FILE2 DIRECTORY
       ...
    

    When I want to create a new vdir in IIS, to allow running PHP scripts, or ASPX or .JS (yes, ASP Classic) or Python or whatever, I do these steps:

    appcmd.exe add app /site.name:"Default Web Site" /path:/vdirpath /physicalPath:c:\docroot
    icacls.exe DIRECTORY  /grant "BUILTIN\IIS_IUSRS:(OI)(CI)(RX)"
    

    Then I drop files into the directory, and they get the proper permissions.

    Setting the ACL (access control list) on the directory will not change the ACL for the files that already exist in the directory. If you want to set permissions on the files that are already in the directory, you need to use icacls.exe on the particular files. icacls accepts wildcards, and it also has a /t switch that recurses.

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

Sidebar

Related Questions

This is actually related to another question I had that was already answered. That
This question is related to another question I asked Basically, I have 2 horizontally
This question is related to another question I just posted . I'm prepping for
This question is kind of related to another question but I have a specific
Another question related to this one . I have a List<SortableObjects> that is the
Related to this question here , but I decided to ask another question for
This is related to another open question of mine . While there aren't any
This is related to another Delphi-version question but still different; I'm looking for a
(This question is related to another one , but different enough that I think
This question is related to another I ask recently, it can be found here

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.