PHPinfo.php Pages

Have you ever wondered what version of PHP your website is running? Or had some really specific question about how PHP is configured and what is enabled/disabled on your site? You might even be trying to debug something about PHP that is different on your live site vs. your development site.

Of course, all this PHP version and configuration stuff is handled somewhere. DevOps people, server admins, all y’all hardcore back end and support people probably know exactly where to look and how to change it. I’ll tell ya though: I don’t. But that doesn’t mean I don’t care.

I like to be able to verify if a site is running PHP 7 or not, because PHP 7 is way faster than older versions and I care about how fast PHP is running because I care about web performance, even (and especially) as a front-end developer. I’ve also cared in the past about ImageMagick versions and sendmail support for various reasons.

Good news, PHP, the language itself, makes it extremely easy to find these things out. There is literally a function, phpinfo(); you can call that spits out a giant UI of all this information. In fact, it makes a perfectly valid entire website, so you can literally do this:

You can make a file, say, info.php with that line in it and chuck it at the root of your website, and view all this information.

image_preview

Hey thanks PHP, that’s darn useful! You could think of it like the absolute truth on your server. Much better to look at this to see what’s happening on your server than to trust what some docs say or whatever.

If I were to see something like PHP Version 5.3 in there, I’d know I’d need to take action because PHP 5.3 is EOL (End of Life). If I’m on Media Temple’s Grid, I wouldn’t worry, because it’ll be automatically taken care of, but if I’m running my own box, I might have to pencil in a little admin time!

You might as well kick yourself right up to PHP 7.2. Chances are, an upgrade of PHP version isn’t going to have any adverse effects. If you’re running popular software like WordPress, it’ll be fine unless you’re running some truly ancient plugins or custom code.

From a developer perspective, sometimes having to do software update grunt work is annoying. It’s not a shiny new feature, after all. But something that is easier to get excited about is the performance stuff. At some point, after you’ve covered the basics, it starts getting harder to eek more and more performance out of your site. When you can snag some performance gains without having to throw money at anything or spend ages of development time, by just upgrading software version, that is rather exciting.

Your beautiful web projects have a home at Media Temple. Explore our web hosting plans for developers and designers, spanning shared hosting to managed services for the AWS Cloud.

Comments

Related Articles