The solution to the problem that Linux cannot open PHP files: First, you need to install PHP; then let Apache call PHP and write the configuration file; finally, request a PHP file and let Apache recognize the PHP file.
Recommendation: "PHP Video Tutorial"
Why can't I open the php file after turning on apache?
Solution:
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.
The above is the detailed content of What to do if linux cannot open php file. For more information, please follow other related articles on the PHP Chinese website!