0

I have a production server that is currently running Ubuntu 14.04 with PHP 5.5.9+dfsg-1ubuntu4, and it has a bug. I found a patch and I would like to verify it by building the same PHP version and options/extensions from source with the patch applied.

I have cloned the repository from http://git.php.net/, checked out tag php-5.5.9, created a new branch, applied the patch, installed all the build dependencies, and created the configure script with buildconf

Now I want to build it configured with all the same options and extensions that are present on my production server. At the very least, I know that I am going to need to run:

./configure --with-pdo-odbc=unixODBC

But how do I detect all the other options that were configured when PHP was built on my production server?

Community
  • 1
  • 1
Jeff Puckett
  • 37,464
  • 17
  • 118
  • 167
  • phpinfo() contains the compile command line somewhere in all of the output. – Marc B Jul 13 '16 at 17:05
  • As @MarcB said, you can use `phpinfo()`. You can also use `php -i`, given that you have access to the command line. – elixenide Jul 13 '16 at 17:08
  • @EdCottrell I do have access to the CLI, and looking at both I can see that the information is probably there, but no straight forward translation of the specific compile flags I need. – Jeff Puckett Jul 13 '16 at 17:12
  • @MarcB there is definitely no *"compile command line"* in my `phpinfo()` output. Is this something that's possibly only available in later versions of PHP? – Jeff Puckett Jul 13 '16 at 17:13
  • 1
    or maybe it was only in older php's. the version I've got now doesn't include it either. it's been a looong time since I had to dig through phpinfo output. either it's optional, or was removed in newer versions. – Marc B Jul 13 '16 at 17:16
  • @MarcB so I went ahead and plowed through with options I knew I needed, still unsure as to whether I got everything, but when I run `phpinfo()` with my custom build I *do in fact* see a `Configure Command` table cell with the exact flags I passed when building. Not sure why this isn't present in `PHP 5.5.9+dfsg-1ubuntu4` but it appears there when custom building `PHP-5.5.9` How mysterious is that? – Jeff Puckett Jul 13 '16 at 19:08
  • guess it could be a diff between `php -i` and `phpinfo()`. I only checked cli here. – Marc B Jul 13 '16 at 19:47
  • @MarcB yes, using `php -i` also shows the `Configure Command` on custom build only, but I still have no idea how to get it from the Ubuntu distribution. – Jeff Puckett Jul 13 '16 at 19:53

0 Answers0