| 8:44 pm on Jan 18, 2013 (gmt 0)|
Oh I should have added that all scripts work as long the filename ends in .php. My earlier developed websites, I used .php extensions, but at some point I just decided to give security a helping hand by camouflaging the use of scripts on the server by building them into .html pages.
But, as soon as I add .html to the end of [ AddType application/x-httpd-php .php .html ] I run into the problem. Remove it and all scripts run except those in html page extensions.
| 12:02 am on Jan 19, 2013 (gmt 0)|
Tangential solution: If you've got time constraints and you haven't arrived at a solution before you absolutely have to go live, there's always mod_rewrite.
:: idly wondering why we haven't yet got the sales pitch for Going Extensionless although it's been over 15 hours... ::
Did you try AddType too?
:: further Forums search leading to definitive answer [webmasterworld.com] (not from me, because I don't touch this stuff with a barge pole) ::
|The AddType / AddHandler stuff is beyond confusing and I usually end up trying several combinations before I find the one that works OK. |
| 1:08 am on Jan 19, 2013 (gmt 0)|
Thanks Lucy for the pointer. I see the quote above was by g1smd so that implies it must be tough if he struggles with it.
It's not time critical yet. I have until Monday before I'll have to renew my old plan, unless they give me a grace period. If worst gets even worst I can always extend the plan for only a month until I get this resolved.
Resorting to mod_rewrite will be the last on my list. Before I do that I would prefer to just run my php as an Apache module -- shut down the fastCGI that is probably the root cause as it's set up right now.
I guess I'll plug away at it and if I get it running I'll post-back what worked. I say that because I think someone out there that had the same problem had posted it in another forum then came back and said he got it working -- but didn't write up the solution :(
It has been one challenge after another for the last 3 days, non-stop. I keep knocking them off but this one is getting the best of me. Some command line input for Plesk has changed too since I used version 9 compared to 11 that the ones I have in my head have to be relearned :(
| 3:29 am on Jan 19, 2013 (gmt 0)|
AddHandler php-script .html -- It Works added to vhost.conf down the stream! That's the short answer.
I'll post a followup summary as soon as possible in the next couple days when I get a chance to catch my breath. There are many environmental variables in play here so it may not work for everyone. But I think this is new to recent versions of the combination of Ubuntu 12.04/Apache 2.2/PHP5/Plesk 11. I suspect there will be a flood of people looking for a solution like this as they upgrade like I'm doing. I also want to test it more as well as check logs to make sure it's not generating errors elsewhere but I'm too tired right now.
Gotta run, a sink full of dishes to wash in the kitchen -- mindless stress relief :)
| 5:13 am on Jan 19, 2013 (gmt 0)|
I see that you've found a solution, if it gives you trouble, you can try altering your normal AddHandler line:
On some hosts I've had to alter the usual line to read:
AddHandler application/x-httpd-php5 .html .htm
(But in those cases php is not running as FastCGI)
| 5:42 pm on Jan 28, 2013 (gmt 0)|
I was hoping to writeup a more in depth summary of my observations surrounding this issue but I'm still assessing it all. I've realized it's going to take a deeper plunge in understanding Plesk's method of "VPS in optimized mode" something I haven't done yet. So I'm going to leave this thread with this:
It is directly related to fastCGI
There are additional conflicts related to fastCGI and PHP as an Apache module vs as CGI vs as fastCGI in my environment of Ubuntu/Apache/Plesk 11.x but I cannot yet fully understand what is going on. It seems it's also all somehow related to VPS in optimized mode. In the end my control panel is not allowing me to use fastCGI, only CGI. But, when I run TOP via SSH it appears PHP is running as an Apache module.
If the old proper syntax is used at the level of apache2.conf or httpd.conf it will cause all pages of all virtual hosts to open a dialog box prompting the visitor to select a program to open the file or download it, even pages with .php extensions
Historically the syntax for parsing .html docs for PHP was:
AddType application/x-httpd-php .php .html <--- but using this now will produce the dilemma mentioned above
Rather this is how to handle it now in apache2.conf or httpd.conf
AddType application/x-httpd-php .php
AddHandler php-script .html
Whereas further downstream in vhosts.conf or .htaccess the first line is not needed because it's included upstream so just add:
AddHandler php-script .html
All the above is related to fastCGI which is now the default method of handling PHP in Plesk 11.x+
|AddHandler application/x-httpd-php5 .html .htm |
That was one of many tried that didn't work.