Home  >  Q&A  >  body text

linux - Why can't I open php files after turning on apache?


阿神阿神2690 days ago956

reply all(3)I'll reply

  • 黄舟

    黄舟2017-06-07 09:25:43

    Apache is only responsible for processing requests and returning responses. It does not have the function of parsing PHP itself. You need to install PHP, allow Apache to call PHP (install the PHP module), and write the configuration file. In this way, when you request a PHP file, Apache recognizes that it is a PHP file, and then hands it to the PHP module for processing. After processing, Apache will generate a response from the PHP processed output information and return it to your browser.

    reply
    0
  • typecho

    typecho2017-06-07 09:25:43

    Correct answer upstairs, you need php-fpm or Apache php module, etc. to parse PHP

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-07 09:25:43

    Just reinstalled this afternoon.
    Just because you have installed apache does not mean that you have installed php, so you still need to continue apt-get php/php5, and maybe mysql. Search for tutorials on the Internet and follow the installation.

    reply
    0
  • Cancelreply