Apache is only responsible for processing requests and returning responses. It does not have the function of parsing PHP itself.
Solution:
You need to install PHP, allow Apache to call PHP (install the PHP module), and write the configuration file.
When requesting a PHP file in this way, 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.
Recommended tutorial: apache tutorial
The above is the detailed content of apache cannot open php file. For more information, please follow other related articles on the PHP Chinese website!