-1

I am trying to deploy a Laravel 9 site onto an IIS Server (and no, I don't have the option of using a Linux server). If I run the local server setup with "php artisan serve", it works fine through 127.0.0.1 on the server, including all calls to the database.

However, if I try to run the site through the IIS server via its domain name, I get a 500 server error. Failed Response Tracing shows a FASTCGI_UNKNOWN_ERROR: "The directory name is invalid. (0x8007010b)"

Error Screenshot

The DNS is functioning properly as I have tested a phpinfo page on it.

Is there a configuration in IIS I need to set in order for the Laravel site to work?

  • You have to reveal more about the 500 error or no discussion can continue. FRT is there, https://learn.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis – Lex Li Oct 21 '22 at 01:36
  • I suggest you edit your problem description to add detailed 500 error information, otherwise I can't understand why the error appears。 – YurongDai Oct 21 '22 at 06:02
  • @LexLi I am running IIS 10, and when I checked out the troubleshooting link you sent, there is no "Failed Request Tracing" option under the Config menu for the default web site. – ImageMagician Oct 21 '22 at 14:47
  • You probably didn't enable Failed Request Tracing when installing IIS on this machine. It must be enabled as role service or Windows feature before you can set up FRT rules. – Lex Li Oct 21 '22 at 15:01
  • I got FRT running. I have edited my original question with the screenshot of the report. – ImageMagician Oct 23 '22 at 20:59

2 Answers2

1

It turned out I didn't have my php-cgi.exe file mapped accurately in IIS. I had to edit my Handler Mappings and link the FastCgiModule handler to my current installment of PHP, mapping it to the php-cgi.exe file.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 27 '22 at 01:09
  • his answer is very clear. you can already understand what part he is pointing out if you really are configuring a server. `[+1]` – kapitan Aug 17 '23 at 12:39
0

The problem is not clear, but try to point IIS directly to public folder of Laravel, like this:

enter image description here

Hope this helps!