With PHP 5.4 still set on the site, run a phpinfo() page and there will be a large section on what was used previously for ./configure. For the most part, you can almost copy-paste that into the new ./config, except with some changes (e.g. 5.3 had --with-fastcgi instead of --with-cgi as in 5.4)...