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

    Michael likes this.
  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.
  5. Thanks for all, I have another problem, I want to load an image in the php page, but just works when the image is in the wwwroot directory, and I want to have the image in the same folder with the files of PHP.
     
  6. Elshadriel

    Elshadriel Winhost Staff

    You have to specify the path to the image file, either using absolute or relative pathing.
     
  7. I was able to show the images, putting them inside the wwwroot folder, but now I received a new requirement: We need to change the site in aspx to php. How I can to change the files inside phpfolder for to work in the main folder, or to change in web.config for to make the phpfolder like principal?
     
  8. I solved it, the answer is very obvious haha, I removed the files from the folder and put them in the root directory
     
    Elshadriel likes this.

Share This Page