Symfony + IIS 10 Need help

Sergi Díaz Ruiz 75 Reputation points
2024-04-27T08:44:16.6633333+00:00

Morning!!

I need really help with Symfony + IIS 10.

I have the following error:

User's image

Can someone tell me something about this error and how can I solve it?

I can execute PHP I can see phpinfo.php so I can execute CGI...

I think maybe it's problem with rewrite module?

TIA!!!

Internet Information Services
{count} votes

2 answers

Sort by: Most helpful
  1. MotoX80 32,556 Reputation points
    2024-04-27T16:59:14.88+00:00

    Based on the GET and the "Access denied", I would think that it's a problem with your default page.

    I have IIS experience but not with Symfony/PHP. Does it honor IIS's default document setting or do you have to define that somewhere else for RouteListener.php to use?

    Check the NTFS security permissions on the folder where your default page is. You will need to grant the IIS worker process account read access. Thats the IIS_IUSRS group. If you authenticate the client then you may need to add the Users group for read access.

    Trace the call with Process Monitor.

    https://video2.skills-academy.com/en-us/sysinternals/downloads/procmon

    Add a filter for "process name is w3wp.exe". Look in the Path column to see if tries to read your default document. Does the Result show SUCCESS or ACCESS DENIED?

    You might see "name not found" events as IIS looks for default.htm or default.asp which may not exist. That's normal.

    User's image

    Double click an access denied event and see what user account is referenced.

    User's image

    Look for other access denied events and see if they reference Symfony/PHP configuration files.

    0 comments No comments

  2. Sergi Díaz Ruiz 75 Reputation points
    2024-04-29T08:45:45.3833333+00:00

    Morning to all!

    In advance, thanks to all for your answers.

    You are not recommended to run PHP on Windows/IIS either, https://docs.lextudio.com/phpmanager/getting-started/supported-platforms

    It's ok... But I want to use IIS with PHP... I know the risks but I need to do it...

    MotoX80:

    Thanks for the extended answer. Really good troubleshoot. Maybe this post can be useful for someone.

    More or less is a problem with default page, but it's because in Symfony we should redirect all URL to index.php.

    So.... We should install rewrite module and configure well the CGI module:

    https://reintech.io/blog/configuring-php-for-windows-server-using-iis

    At third point:

    cgi.force_redirect = 0
    fastcgi.impersonate = 1
    
    
    

    These lines solved my problem.

    Regards,

    0 comments No comments