简体   繁体   中英

Enabling php5_module libexec/apache2/libphp5.so cause apache to break

I am trying to enable php on my Mac. I am following a tutorial that someone put together that allow me to run multiple websites using httpd-vhosts. That tutorial is here -> https://mallinson.ca/osx-web-development/#comment-25907 .

I actually set this up a year or so ago and everything worked perfectly. I think because of a recent update, it stopped working. I decided to change out the edited files with the original copies and start over. I'm able to go to localhost up to a certain point with it giving me the "It works!" text. However when I uncomment the line "LoadModule php5_module libexec/apache2/libphp5.so" in my httpd.conf file everything starts messing up. I restart apache and go to localhost and it tells me the server can't be found. I refresh the page and it shows me "It works!". I refresh the page and it tells me the server can't be found. I'm so confused. I don't know if it is because of the php module or what.

Any assistance would be helpful. I can give any more information that I need.

Thank you.

What does the apache error log says? It probably crashes the httpd process, hence the local server becoming unvailable.

You say that you haven't used that for one year. If you upgraded OSX in the meantime, you probably switched from Apache 2.2 to Apache 2.4. Check that your PHP module matches Apache specs. Using an outdated PHP module with a newer Apache version will cause this kind of behaviour because they are not using the same API.

Alternatively, since you don't seem to be an expert in httpd/PHP stacks (no offense!) you could use a tool like MAMP to make things easier.

If you want to keep your current setup, make sure you upgrade the PHP module as well so it's compatible with your new Apache version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM