0

Setup:

Windows Server 2012.
Plesk 12.5.30.
IIS 6.2 (build 9200).

Problem

After adding a new domain via PLESK, I navigated to the following directory

C:\inetpub\vhosts\[domainname]\httpdocs

Inside this directory was the welcome to plesk index page. I removed this. I then copied an existing Wordpress site into this folder (consisting of css, html and php files).

When the domain URL is entered into a web browser, the server returns a 404 error and does not serve the Wordpress site.

Troubleshooting So Far

If I create an index.html file in this folder, it displays just fine. So this is the correct folder and IIS is serving static HTML files from it.

The below is the contents of the web.config file in the above directory.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <tracing>
            <traceFailedRequests>
                <add path="*">
                    <traceAreas>
                        <add provider="ASP" areas="" verbosity="Verbose" />
                        <add provider="ASPNET" areas="AppServices,Infrastructure,Module,Page" verbosity="Verbose" />
                        <add provider="ISAPI Extension" areas="" verbosity="Verbose" />
                        <add provider="WWW Server" areas="Authentication,Cache,CGI,Compression,FastCGI,Filter,Module,RequestNotifications,RequestRouting,Rewrite,Security,StaticFile,WebSocket" verbosity="Verbose" />
                    </traceAreas>
                    <failureDefinitions statusCodes="404" />
                </add>
            </traceFailedRequests>
        </tracing>
    </system.webServer>
</configuration>

There is nothing mentioned here about PHP could this be the problem? I haven't found anything online to shed any additional light on this.

There is one other config file in the httpdocs directory it appears to be oddly misspelled.. somethging.user.ini and contains the following lines:

[PHP]
open_basedir="C:/Inetpub/vhosts/[domain name];C:\Windows\Temp\"
error_log="C:\Inetpub\vhosts\rake4you.at\logs\php_errors\[domain name]\php_error.log"

Where domain name is the correct folder, which is the name of the domain being hosted.

I have tried correcting the spelling of this ini file, changing the name to user.ini ; and also deleting it all together. I've also tried converting the foward slashes to back slashes in the first line.

But the 404 errors on any php pages still persist.

I have also considered folder permissions and found this question IIS_IUSRS and IUSR permissions in IIS8 however the steps suggested do not work for me, as the user account referred to there (IIS AppPool\MyApplicationPoolName) does not exist, when I substitute 'MyApplicationPoolName' with the ApplicationPoolName in question (which I retrieved by going to IIS --> Application Pools).

Any suggestions on how I can resolve the 404 errors for PHP pages.

Thanks for advice.

Community
  • 1
  • 1
Gary
  • 883
  • 10
  • 32
  • Are you sure IIS has been configured to serve `.php` files? – pmahomme Aug 11 '16 at 20:10
  • Yes IIS is serving some .php files, because the PLESK cpanel is in php, and that is being served OK. I think it's a configuration issue, related to this particular domain / web folder. – Gary Aug 11 '16 at 20:41

1 Answers1

0

Wouldn't usually answer my own question, but I've just invested another 11 hours figuring out what is wrong, here is the solution, which will hopefully help someone else in the future.

1) In PLESK firstly ensure you are in the 'Service Provider' view. If you are, the first option from the menu on the left will be 'Hosting Services'.

If you are not change to this view using the button on bottom left of screen.

2) Select 'domains' from the menu on the left of the screen.

3) Select the blue hyperlink which is the name of your domain.

4) Click 'php settings'.

5) Tick the box that says

PHP support (PHP version 5.4.45 , run PHP as  FastCGI application

Change the PHP version to the one you want the domain to work with using the drop-down box.

6) Apply the changes using the 'apply' button at bottom of the screen.

That's it the PHP files will now be served correctly.

Gary
  • 883
  • 10
  • 32