0

I am getting this error/warning PHP exec(): unable to fork ["command I plan on running"] when attempting to run the exec() within a PHP script. It is running on an IIS server. I have attempted the following:

  • Changing Authentication settings on IIS server for web site
  • giving read/write access to relevant users on cmd.exe
  • Scanned the php.ini file for any disables for exec() function

I am running out of clues as to why this error is occurring. versions of the same script are working well on other VMs.

1

2 Answers 2

1

Please check these 2 locations:

(1) Application Pool > Advanced Settings > Process Model > Identity

This should be set to a domain user.

(2) Web site > Authentication > Anonymous Authentication This should be set to the same "Specific user" as the application pool (in 1 above).

After (1) and (2) above, please try running exec() in IIS again (please remember to restart the IIS service before you retry)

Sign up to request clarification or add additional context in comments.

1 Comment

my App requires Basic and Windows Authentication so I have Anonymous Authentication disabled. Is there any solution without changing these settings?
-1

https://www.itdroplets.com/iis-php-and-windows-authentication-run-as-a-service-account/

In Section (1), go to system.webServer/serverRuntime and change authenticatedUserOverride from UseAuthenticatedUser to UseWorkerProcessUser (2). Make sure you click on Apply.

Dropping this here so when I forget in the future I can look it up again. This is what resolved the issue for me. :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.