Popular Searches

How to See What Configure Options PHP Was Compiled With

PHP Logo

PHP in the repositories comes with tons of modules that aren’t needed, and we’ve always custom-compiled our own version with only the things that we need. But when you’re switching from one server to another, or you want to compile it again and you forgot to save the options, there’s luckily a few easy ways to see the configure options. It’s also really helpful for setting up a local development environment that matches production.

The first method is really simple — make a new PHP page, and just add the following:



Navigate to the page in your browser, and you’ll see a crazy page like this, which has the configure command right there:

Hmm, looks like my local development machine is really out of date. Maybe I should compile a new copy of PHP, huh?

The second option is using the command line, which is way easier. Just type the following on the terminal:

php -i | grep configure

You’ll get all the output from phpinfo but on the command line, and the grep part of the statement searches for just the line that contains the configure command.

And now we’ve successfully completed another silly filler article. When is he gonna write something useful, you ask? I agree.

Lowell Heddings Lowell Heddings
Lowell is the founder and CEO of LifeSavvy Media. He’s been running the show since creating How-To Geek back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work. Read Full Bio »

The above article may contain affiliate links, which help support CloudSavvy IT.