This article matches the following questions:
PhpCustom does not resolve, why can’t I open a PHP file? Why do the website turn on the PHP to become downloaded? Why can’t PHP unable to resolve?
After website management sets the PHP website, the open directory is different from yourself? Why can’t I resolve the PHP file, what is the reason why the PHP file is unable to resolve?
Novice often encounter problems:
After you don’t operate, you will turn on the PHP file through http://127.0.0.1, it will become download! Cause Analysis: Because it does not operate or does not understand
and FCGi operating mode , it is actually learning to make in the management of website management Port mode
and domain name mode can avoid these problems, It is recommended to have patient read complete text. Be sure to read! If the previous pile of text, your basic difference cannot be understood, you can directly see the correct usage of the domain name mode
port mode . As shown in the figure below, the 80-port of the software main interface is the port used by the default website
website management is used in the site, the 80-port is used without tie Declare domain name, this time you use http: // localhost or http://127.0.0.1 access website, actually to access the default site of the main interface, and the site management site is not effective! Because the site inside the website management uses an 80-port, you enable the domain name mode, no binding domain name is naturally unable to access it! If you don’t want to bind the domain name, you should use port mode to freely assign other non-80 ports, you can use different ports to access. Reiterated! ! If the site is bound to the site, you must bind a test domain name, otherwiseTurn the site port of the site management to a non-80-port, then right click “Port Access Website” (if only in the local test site, it is recommended to distinguish between different sites and different PHP versions, if used on the server, It is recommended to distinguish between different sites and different php versions)
Some novices are not bound to the domain name when website management
is added, so
Website Management All sites using the 80-port are not valid, you use http: // localhost or http://127.0.0.1 to access the website, actually accessing Apache default sites, and website There is no relationship inside the site, and the apache default site does not configure the PHP version, naturally become downloaded, unable to resolve PHP, if you want to use the Apache default site, you can configure the PHP version for the default site. , Restart the service, empty the browser cache. (Generally, the default site is generally not recommended, it is recommended to use the website management, use the domain name mode or port mode) If you want to use the Apache default site, we can open the settings of the default website, Right click on the E icon,
You can modify the directory and domain name of the default site after you open, if you want to set a PHP version for the default site of Apache,
Just click on “Default Site PHP Version Settings” button settings (can switch the default site to PHP version /
) Default Site Settings Handler mode After the PHP version, restart the service and clear the browser cache, will not display the downloading PHP page file.
If the PHP version of the default site is not set! ! So naturally unable to resolve PHP, access the default site will change this prompt. Select the PHP version to the default site
(This action must restart the server and
After emptying the browser cache! Otherwise, still displayed)
According to the reason, the default site itself is set by the default site itself sets the PHP version. The default is to correct PHP, why novices do some operations After you pass http: // localhost or http://127.0.0.1 to access the default site be changed? Usually because the default site’s PHP version is causing, what is the default site’s PHP version will be empty? It is possible that the user is deleted or cleared, and it may be that when upgrading apache, change the Apache default bit, such as the 32-bit Apache becomes 64-bit, the system will automatically pass it properly. The default site is not suitable for the PHP version of the current Apache bit (only the PHP version of the Handler mode mode, the PHP version under the FCGi is not emptied), because the default site is used by Handler mode, while Handler mode, apache The number of digits must be consistent with the number of PHP, that is, 32-bit Apache must be with 32-bit PHP! There is no setting in FCGi mode, and the number of Apache is in normal combination in the FCGI mode! Under the WIN system, the PHP version of the FCGI mode is also powerful than PHP in the handler mode, so it is generally recommended to use the FCGi mode PHP version! ! If you want to use FCGI mode, you only need to add a website in your site management, select the FCGi run mode! The Handler mode under WIN system is not flexible, because I only optimize the PHP version of the FCGi mode, and the Handler mode under Win is not very good, it is not very flexible, so it is not recommended to use Handler mode. mode. HANDLER mode is the default site, so I do not recommend using the default site, you can change the default icon to close the E site right away, using only FCGI operating mode sites can be managed. There is a PHP download, or the directory open by the PHP website is different, mainly the novice will not use the website management, open the default site, correct website managementPlease continue to look down, read complete text )
Generally, we can distinguish between different sites and different phps in two modes. Version.
Domain Name Mode
(Server Operation Common)
: All ports must be set to 80, then
The domain name must be bound to distinguish between different sites and different PHP versions with different domain names. If not binding domain names will not take effect! !
Tips: mode using the domain name, the domain name must be binding, otherwise it is not a domain model, if not the domain mode, we recommend using port mode, you can configure a port 80 non. Port mode (commonly used local test):
All website ports in the management must be set to non-80 , And all ports cannot be repeated! Port mode Do not use the 80 port, if you use the 80-port in the management of the website, it means that you are enabled by the domain name mode! ! Because port mode is different sites and different PHP versions.
If you still don’t understand, please read the article, or check the video tutorial of this article: Video tutorial address: no recording, free recording