• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

plesk 8.1 / win2k3 / php / mime type issue

A

altgamer

Guest
Hi, I'm hoping somebody can help me with an issue I'm having. (I have a Windows 2003 server).. I've been using Plesk for well over a year now, used to be using Plesk 7.5, etc and upgraded to Plesk 8.1 for Windows. Most everything is fine except I seem to be having some minor mime type problems.

First, I tried adding the mime type in Plesk 8.1 control panel, under web directories, etc and have confirmed it's there.

I've made sure the mime type exists and is added in IIS manager, for the local computer.
Extension: .php2
MIME type: application/x-httpd-php

It matches the original .php extension. (Please note PHP works fine on the server under the .php extension without problem (it's 5.2.0 running under cgi mode, not isapi))

After that failed to work, I went into Web Sites, and went to properties on mine, etc and configured the websites mime types. Also added .php2 there, and yet again it fails. I then tried going into the web sites configuration and manually adding .php2 with the full path to the php executable. The exact same path the regular .php extension uses. It yet again failed.

No matter what I try, the .php2 extension, every time I try accessing a file it requests to download the file, rather then display it.

I have double checked to make sure no .* mime types exist, and the server itself gives off a 404 error for unknown types. So I am pretty sure theres no .* that would be causing a stream.

I have tried going through my error logs, regular logs, etc but they all just have the typical status codes of 200 as if the server is doing this on purpose.

I've also tried getting rid of the mime types, and then I get a 404 error when trying to access the files.

And yes, I have tried restarting the web site by itself, iis multiple times, and the server multiple times. Nothing seems to fix this.
It worked perfectly when I was using Plesk 7.5 etc. It has only broken on Plesk 8.1 (Note, I didn't have 8.0)

Also, Scripts and Executables is checked, and permissions are in order.

For those that may suggest it.. I know I don't need a .php2 extension, I'm more or less using it as an example. I'm trying to get ones like .view or .data etc to make url's look a bit cleaner and such.

I've spent several hours on google trying to find an answer, other help guides, faq's, etc and can't find a single thing that works.
So if anybody knows the answer or could help out, I'd appreciate it.

Thanks.
 
Did you ever figure out your problem? I'm having something similar happening with Plesk 7.5.6 (worked perfectly before I installed the latest service pack to plesk)

PHP files just fail to display. No download prompt, just a document not found error.
 
Nope, never found the answer.

I'm tempted to open a support ticket with my dedicated server provider in hopes they can shed some light on my issue.

Does anybody at all know the answer or can help out? :(

-alt
 
I've tried reinstalling php 5, downgrading a few versions, tried installing over, etc... doesn't seem to help.

I have a feeling this is occurring because the Plesk 8.x series allows both PHP5 and PHP4 for a site. And I am guessing it somehow handles the mime types different so it can't be setup as easily for the 8.x series.

I tried switching the website to php4 via the cp and it still failed though. (and yes, I restarted iis and the server after)

Also tried isapi mode on php5 but that didn't fix it.
 
I recall having this issue before, but I do not recall what I did to fix it.

If you aren't on the latest version, updating plesk with a full install could help or the latest 8.1.1.2 (has an updated PHP).

How does PHP show up in your Component Manager?
 
I'm currently running Plesk 8.1.1, I haven't updated to a 8.1.1.2 release as my server is currently functioning great otherwise, and from what I understand the update only really involves HSPcomplete / Plesk Expand, etc which I don't currently use/have so it doesn't really apply to me.

I'm tempted to do a complete reinstall or a full install, but I don't want to do anything that might cause issues as it's a production server that is running live sites and has clients on it. So I'm also trying to avoid downtime.

As far as the Component Manager part, under Web Scripting, both PHP 4.4.3 and PHP 5.2.3 are listed. Everything has the little green button/icon next to it. And I can switch them on sites, etc without any issue. Verified by checking out a phpinfo file on a site.

I appreciate the help by the way, only wish I could find an answer to this, it's the first time I've ever come across this type of thing. Normally changing the mime type's are one of the easier things. :-/

-alt
 
Not to cut in on the 8.x series discussion but I haven't got much support for this issue under my 7.5.6 install.

PHP is listed for all my sites as running as CGI (i tried that and ISAPI with no success). It doesn't matter what site I try and use with PHP. They all work with ASP.NET fine so I know that it is a PHP specific issue especially since my ASP.NET sites wont let me access the php based webmail.

I'm also tempted to do a full reinstall but that's A LOT of domains I would have to reconfigure so hopefully someone resolves it.

One of the sites I'm having trouble with is www.allianceelitez.com if anyone wants to know. Not that the lame error its giving will help. webmail.allianceelitez.com doesn't work either but the error is different.

I wonder if I should try the PHP 5 upgrade since I think its still running off 4.x as came with the initial 7.x plesk install. I don't understand how one service update could screw everything.
 
I'm assuming you checked to make sure your default documents includes your default.php and/or index.php?
 
Yeah I think i mentioned that in my post above, close to the top. Just to be safe I added the 2 common php doc types in IIS (index.php, default.php).

I just looked and noticed that my sites dont have any MIME types specified. I can't remember but is that supposed to contain the PHP type?

I don't think it does, but this problem does "sound" like IIS just for some reason isn't recognizing PHP files since there are no obvious interpreter errors.
 
I will check my server and see how the mime types are set up (in about 30 minutes, have a quick meeting).
 
Well.. this is interesting..

I tried doing this on other sites, and they all failed the same..

I decided to try other mime types, such as jpg's... I tried adding a "jpg2" extension, and sure enough that had a 404 error.. Tried manually going into it through iis and manually added the mime type and then it did the same thing... it tried streaming it.. asking me to download it..

One thing I didn't think to try, was trying it on the main directory.. It worked. I tried it in a sub-directory again, and it failed.. I went back into the plesk control panel, to see if maybe I missed something in the web directory part.. I went into the folder/directory management.. and sure enough.. there is no mime type tab, so it appears you can only change it on the main directory.. So apparently... my own mistake of not checking before... but.. it appears Plesk 8.1.1 won't apply mime types to sub-directories of a domain, or you can't change it on a sub-directory basis.. ?

I ended up trying the repair plesk installation from the plesk reconfigurator, and it appears to of fixed the issue.
The php mime type works on sub-directories now, etc...

I still have no idea what caused this, and what the actual fix was. I don't think it was a permissions issue as I had previously run the updater after the upgrade to update everything.. And everything else had been running great, no errors anywhere and the events viewer etc showed no errors.

Soo, I have no idea, but I'm glad it's fixed now lol.

I appreciate all the help though, thanks again :)
 
Interesting thing to note. Glad you got it fixed. Sorry I didn't get back with how mine was set up. Got swamped with work.
 
Could you still check your mime types for me man? My problem is different than his (not even asking for download, just not displaying). I'm going to try a document type change on the entire root and see if that helps but I don't think it will.

I ran the reconfigutor and still no fix so my last straw I guess would be comparing mime types with you for php. Thanks.
 
AnarchyRising;

I previously had a php glitch with 7.5 / 7.6 that affected my PHP 4 installation after an upgrade of another component. It's one of the reasons I don't like to update unless it's either a security update, or something that affects my server directly.

But anyways, I had the same issue.. I kept getting a 404 not found. And if I remember, it was resolved by reinstalling php using the installer rather then manual. All I can figure is that something got mis configured in IIS.

After a few months I decided to make the move to PHP5. Little did I know at the time it didn't exactly have great compatibility. I had several problems relating the 404 error, mime types, asking to download, etc.. I ended up fixing most of them, but anytime I would add a site, domain, client, etc in Plesk it would reset/resync all of the updates I did to IIS and it would be messed up in one way or another again.

It's one of the reasons I went ahead and made the move to Plesk 8 since 8.x has php 5.x compatibility built in from the beginning. I'm not sure if It was just my server, bad luck, or what might of caused all the issues prior, as I keep my server running pretty smoothly.

As far as mime types, I'm not 100% sure if it's the same between Plesk 7 / 8, but here are what some of mine are:


In IIS..

Properties of local computer, and Mime Types..
- Extension: .php
- Mime type: application/x-httpd-php


Web Sites properties.. under the Home Directory tab, and Configuration..
- Executable: "C:\Program Files\SWsoft\Plesk\Additional\PleskPHP5\php-cgi.exe"
- Extension: .php
- All verbs, and script engine is checked.


On an actual domain, in properties, home directory, and configuration again..
- Executable: "C:\Program Files\SWsoft\Plesk\Additional\PleskPHP5\php-cgi.exe"
- Extension: .php
- All verbs, script engine and verify file exists is checked.


On Web Service Extensions under local computer dropdown (it's at the end)..
I have PHP Extensions as allowed. If you go into properties, Mine has:
Filename: C:\Program Files\SWsoft\Plesk\Additional\PleskPHP5\php-cgi.exe
Filename: C:\Program Files\SWsoft\Plesk\Additional\PleskPHP5\php5isapi.dll

Both are added and set as Allowed.


Also, one other way I've seen a 404 error occur, is due to permissions.
So go into your php directory, and make sure php.exe / php-cgi.exe / php5isapi.dll, or whichever version you use has permission from the plesk service / client, etc. I forget the name, but for me.. psaadm / psacln / psaserv have permission to read, read and execute as Allowed.

Also keep in mind the path to php. Obviously it will probably be different for you since you have Plesk 7, and PHP 4.. sooo..


I'm not all that skilled in server knowledge, so I don't know whether or not any of this will help you out, or if you should fully do it, etc... But I hope it helps out somewhat. :)


-alt
 
Thanks buddy I will give all your suggestions a shot.

Sorry for the long delay in my reply but I was out of town. I came back to a horde of pissed off PHP coders wanting to know why their scripts dont work haha.

Thanks man I'll let you know how it goes.
 
One thing I could ask is if there is an upgrade price from 7.5.x to 8 that you paid? All I can find in forums and on the swsoft site is full version 8 prices which is a tad out of my budget. I use Godaddy as a dedicated server provider and they are great as far as reliability goes. But they don't help with upgrades or tech issues on a true dedicated plan.

Still trying what you suggested but I think upgrading might be better than trying all this stuff that's more than likely going to waste my time, and yours ;)
 
Originally posted by altgamer

I'm not all that skilled in server knowledge, so I don't know whether or not any of this will help you out, or if you should fully do it, etc... But I hope it helps out somewhat. :)


-alt [/B]

Well one of them fixed it. I deleted all settings and reapplied them (the ones you suggested) and it seems to be working fine (aside from some new PHP errors in a nuke site that worked fine before hand-- probably a config problem, no worries).

Thanks a lot man for helping me flesh this out.
 
The dedicated provider I use (Softlayer) provides the control panel license for me for an extra $10/mo. All I had to do was pay a small $3 fee to have the control panel upgraded to 8.x for my server. I figured it was safer to have experienced techs upgrading it for me in case anything goes wrong they cover and fix it.

Glad to be able to help out though. :)

-alt
 
Back
Top