Wednesday 30 March 2011

PHP5.3.6 nts: You have chosen to open ... .php which is a php script.

I was having a play with installing PHP 5.3.6 nts (which has been out for about a week now). So i'll just pretend this is a trusty step by step windows guide to installing Php5.3.6 to walk me through that. (link now updated to to the 5.3.6 guide -  1th April 11)

After install i noticed the browser error (in Firefox and Internet Explorer): "You have chosen to open ... .php" "which is a php script" and i noticed that guide doesn't really discuss this message completely in it's Php 5.3 troubleshooter for those that encounter this error upon first testing.

So this data applies to an apache 2.2 install on a home test system. But you'll get the gist of it either way. Obviously, the browser doesn't know what to do with the file and asks what to open it with or asks if you want to download it.

But the problem actually lies earlier, the browser should not care if it is a php file, that is why we are configuring the apache config file..

So, two possible scenarios come to mind which will spit back that exact error. To fix it, One, configure your apache httpd.conf file correctly and then Two, now that your .conf file is corrected, stop testing the cached copy which wasn't working and still isn't working.. So either select another .php file to test or rename the test file (reboot system / clear browser cache - what ever works for you). But fix the configuration first.

On my install, I noticed the httpd.conf edit steps were incomplete (the installer expects that you self edit this step) and so needed to use the above link for the copy paste code for change 1 & 2 and then reboot a couple of times (yes, reboot a couple of times, and no, i don't know why - i'll guess it is because my Apache is VC6 and this version of PHP is VC9 only) for everything to come up roses.

No comments:

Post a Comment

Important Note:

Anyone is free to post links here but only if a back link to this site (or www.websiteadministrator.com.au) is added from your blog or website.