PHP v 7.4 Enable Per site PHP ConfigurationRSS

0 replies

Last post Mar 02, 2020 04:29 PM by tebass

  • PHP v 7.4 Enable Per site PHP Configuration

    Mar 02, 2020 04:29 PM|tebass|LINK

    I'm trying to configure php 7.4 on Windows 2016 IIS 10 in a web hosting environment. I would like each application to have it's own php.ini file.  PHP is working, but it still is pointing to the c:\php\php.ini file. 

    I read to add the following to the applicationhost.config<see below>I am setting the basedir to the location of the application root folder.  This isn't working.

    I'm not clear what I'm missing.  I tried adding the handler mapping to the applicationhost.config file as well per article and it barfs.
    Any assistance would be appreciated.

    <fastCgi>
      <application fullPath="C:\PHP\php-cgi.exe" 
        arguments="-d open_basedir=C:\Websites\Website1" />
      <application fullPath="C:\PHP\php-cgi.exe" 
        arguments="-d open_basedir=C:\Websites\Website2" />
    </fastCgi>
    

    https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-3-configure-php-application-security#enable-per-site-php-configuration