If you write PHP long enough you’ll eventually come to the point where you want to use some of its extensions. But are they enabled? Are they even installed? Here’s how to find out in a few key strokes.
In the bad old days (like back when PHP4 or even the earlier PHP5 releases were in wide use) you’d have to create a PHP file, add the line
echo phpinfo(), then open the file in a browser to see how PHP was configured. Or you could dig through the ini files. Either way it was a slow and boring process.
Now all you have to do is pop open a terminal window and run
php -i. BOOM! There’s your list of enabled extensions and everything else the old
echo phpinfo() file would show you.
Maybe you knew about this but I just found out and it’s pretty exciting to me. I first learned PHP back when it was shitty. I mean, I think it’s still shitty but I hear that PHP7 has made PHP into a language that developers can take seriously.
I’m just getting back into PHP after about 3 years. During that time I’ve mostly focused on Ruby and Node.js development. Now I’m giving PHP another shot and so far it looks the same but somehow feels different. After I dig into modern PHP development for a bit I might write a post about my thoughts on whether it’s a language worth keeping in your tool box or not.