Since I've started blogging about little idiosyncracies I've been experiencing in PHP, I've been getting feedback that you want more. Okay. I'll start adding little tid-bits that might help out someone out there. So here's one I found (again) today.
While testing the bug fix I mentioned in an blog entry last week, I found that trying to load the phpinfo() script caused my browser to try loading the file as an application. That is, it tried to download the file, rather than execute the script. This happened in Firefox and IE. For those not familiar with phpinfo(), it's a function that displays the setup of PHP, including loaded extensions, environment variables, PHP variables, and so on. Here's what you would use:
phpinfo.php
<?php
phpinfo();
?>
I'm getting side-tracked. You'll likely all know how to use this function, but that was for newbies.
So, if you try to load this script using
localhost in the URL, your browser will not know how to deal with it, nor will PHP, so it strangely asks you what to do with it. This doesn't happen to my other PHP scripts. So, don't use:
http://
localhost/phpinfo.php
Use
http://
127.0.0.1/phpinfo.php
If this is far too simple a blog, let me know. I'll get back into the more unusual stuff.