Site with PHP and ASP

Discussion in 'General troubleshooting' started by Andrés Hernández, Nov 26, 2018.

Tags:
  1. I want to add to my site a page make in php (with js and css). In control panel I have php 5.6.
    I uploaded throught FTP the files to the folder: "phppage". But mysite.com/phppage does not work, in localhost works (the localhost is just with php).
     
  2. I resolved the problem, it's a configuration in the web.config. This was my configuration:

    Code:
    <configuration>
        <location path="." inheritInChildApplications="false">
            <system.webServer>           
                <handlers>            
                        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
                    </handlers>
                    <aspNetCore processPath=".\Udelaempresa.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
                    <staticContent>
                        <clientCache cacheControlMaxAge="14.00:00:00" cacheControlMode="UseMaxAge"></clientCache>
                    </staticContent>
            </system.webServer>
        </location>
    </configuration>
    Just, I changed the file to this:

    Code:
    <configuration>
        <location path="." inheritInChildApplications="false">
            <system.webServer>           
                <handlers>
                    <add name="PHP-FastCGI"
                        path="*.php"
                        verb="GET,HEAD,POST"
                        modules="FastCgiModule"
                        scriptProcessor="C:\Program Files (x86)\PHP\v7.0\php-cgi.exe"
                        resourceType="Either"
                        requireAccess="Script" />
                        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
                    </handlers>
                    <aspNetCore processPath=".\Udelaempresa.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
                    <staticContent>
                        <clientCache cacheControlMaxAge="14.00:00:00" cacheControlMode="UseMaxAge"></clientCache>
                    </staticContent>
            </system.webServer>
        </location>
    </configuration>
    The only thing that I want, it is for PHP pages I must include the file with .php extension, so:
    • mysite.com works
    • mysite.com/phppage doesn't work
    • mysite.com/phppage/index.php works
    I tried with another configurations for this extension problem and works it, but it affect the ASP pages.
     
  3. ComputerMan

    ComputerMan Winhost Staff

  4. Gofer01

    Gofer01 Amateur Web Application Developer

    You can put this in your web.config file. You can make any name in the dictionary a landing page. Just put a supported extension at the end. Or you can use the method of ComputerMan. The tool in the IIS Manager will modify the web.config for you. If you use that tool in the IIS Manager make sure you copy the web.config to your folder where you write your codes on your computer.

    <system.webServer>
    <defaultDocument>
    <files>
    <clear />
    <add value="index.php" />
    <add value="index.aspx" />
    <add value="Default.aspx" />
    <add value="Main.asp" />
    <add value="index.htm" />
    <add value="index.html" />
    <add value="HelpMe.aspx" />
    (And so on)
    </files>
    </defaultDocument>
    </system.webServer>
     
    ComputerMan likes this.

Share This Page