Search code examples
apacheapache-modulesphp-7

PHP7 install broke my localhost


I got PHP7 compiled and built locally. php -v outputs all the beautiful info I would want it to. I completely failed at loading it into apache, though. The configure\make process was mostly myself and SO, but for loading it into Apache, I followed the steps at this blog, starting with

Once done you’ll need to setup Apache to use the new version of PHP. The following lines will disable the original PHP5 version and enable the new PHP7 version

That's where things went foul. Really, all it accomplished was breaking local's php entirely. I can't even successfully roll-back my configs for some reason. phpinfo() just shows the source code, so php isn't being processed at all.

The state of things now: PHP is dead.

Where I would like to be: Apache2 loads PHP7

Help, anyone? Much appreciated!


Solution

  • I fixed it myself. For reference:

    1. My original ./configure command didn't include --with-apxs2=/usr/bin/apxs so - naturally - no apache module was built, just the CLI.
    2. Disabling php5 (per the apache config blog) removed the *.php MIME type. I added it back following steps similar to those from AskUbuntu

    After taking care of those two things, phpinfo() gives me the oh-so-pretty PHP Version 7.0.0 header. Now, to get XDebug in it... wish me luck! :D