Analysis of the reasons why novices use PHPCUSTOM to open php files and change them to download

New version reminder: This tutorial is only suitable for the old version of PHPCUSTOM with modular functions. The
latest version has moved the default site to the website management list , and the new version will be easier and more efficient to use.

This article matches the following questions

PHPCUSTOM Why is the php file not parsed, why can't the php file be opened? Why does the website become a download after opening php? Why can't php parse it?
After the website management sets up the php website, the opened directory is different from the one set by myself? Why can't the php file be parsed, what is the reason why the php file can't be parsed?

Novices often encounter problems:
After incorrect operation, I found that opening the php file through http://localhost or http://127.0.0.1 will become a download! Cause analysis: Errors caused
by not knowing how to operate or not understanding HANDLER mode and FCGI operation mode , in fact, as long as you learn to use the port mode and domain name mode in the website management , you can avoid these problems. It is recommended that you must be patient to read the full text . Be sure to read it! If you have a poor foundation and can’t understand the previous pile of words, you can just look at the correct use of the domain name mode and port mode in the following. As shown in the figure below, usually port 80 of the main interface of the software is the port used by the default website . If the site in the website management uses port 80 without binding a domain name, you can use http://localhost or http://127.0 at this time .0.1




Visiting the website is actually visiting the default site of the main interface, and the site managed by the website is ineffective! Because the site in the website management uses port 80, it means that you have enabled the domain name mode, and you cannot access it normally without binding a domain name! If you don't want to bind a domain name, you should use the port mode, and you can use different ports to access after restarting after allocating other non-80 ports to the website. Reiterated! ! If the site in the website management is bound to port 80, you must bind a test domain name, otherwise, change the site port in the website management to a non-80 port, and then right-click "port access website" (if you are only testing locally For websites, it is recommended to use port mode to distinguish different sites and different php versions. If it is used on the server, it is recommended to use domain name mode to distinguish different sites and different php versions) Some novices do not bind domain names when adding sites in website management , so website management All sites that use port 80 are ineffective. If you visit the website with http://localhost or http://127.0.0.1 , you are actually visiting the default site of Apache, which has nothing to do with the site in the website management , and if the Apache default site does not have a php version configured at this time, it will naturally become a download and cannot parse php. If you want to use the Apache default site, you can configure the php version for the default site, restart the service, and clear the browser Just cache it. (It is generally not recommended to use the default site. It is recommended to use the website management, and use the domain name mode or port mode.) If you want to use the Apache default site, we can open the default site settings, right click on the E icon as shown in the figure below, and you can click here Modify the directory and domain name of the default site and other information. If you want to set the php version for Apache's default site, just click the button "Default Site PHP Version Setting" to set it











(You can switch the PHP version/  HANDLER mode for the default site )
After setting the PHP version in HANDLER mode for the default site , restart the service and clear the browser cache, the downloaded php page file will not be displayed. If the php version of the default site is not set! ! Then naturally, php cannot be parsed, and visiting the default site will turn into a download prompt. Just select the php version for the default site (this operation must be done after restarting the server and clearing the browser cache! Otherwise, it will still display the download when it is opened). Logically speaking, the default site of the software itself is set with the PHP version, which can parse PHP normally by default. , why the novice through http://localhost or http://127.0.0.1 after some operations










To visit the default site will become a download? Usually it is because the PHP version of the default site is cleared, so under what circumstances will the PHP version of the default site be cleared? It may be caused by the user’s own deletion or cleaning, or it may be that the default number of bits of Apache has been changed when upgrading Apache. For example, if you change 32-bit Apache to 64-bit, the system will automatically clear it in order to start normally. All php versions of the default site that are not suitable for the current Apache digits (only clear the php version in HANDLER mode, the PHP version under FCGI will not be cleared), because the default site uses HANDLER mode, and in HANDLER mode, Apache The number of digits must be the same as that of php, that is, 32-bit Apache must be equipped with 32-bit PHP! However, there is no such setting in fcgi mode, and any number of Apache digits and PHP digits can be combined normally in fcgi mode! In the win system, the php version of fcgi mode is also more powerful than the php version of HANDLER mode, so it is generally recommended to use the php version of fcgi mode! ! If you want to use FCGI mode, you only need to select the fcgi operation mode when adding a website in the website management! The HANDLER mode under the win system is not as good as FCGI, because I only optimized the PHP version of the FCGI mode, and the HANDLER mode under win is not very good and not very flexible, so the HANDLER mode is not recommended. The default site is the HANDLER mode, so it is not recommended to use the default site. You can close the E icon of the default site by right-clicking it, and only use the FCGI operating mode of the website management. There is a php download, or the directory opened by the php website is different from the one you set. The main reason is that novices can’t use the website management and open the default site. For the correct way to use the website management, please continue to read the entire text )



Generally in website management, we can distinguish between different sites and different php versions through two modes.


Domain name mode (commonly used for server operations) :
all ports must be set to 80, and thenThe domain name must be bound , and different domain names are used to distinguish different sites and different php versions. If the domain name is not bound, it will not take effect! !
Friendly reminder: To use the domain name mode, you must bind the domain name, otherwise it will not be the domain name mode. If you do not use the domain name mode, it is recommended to use the port mode and configure a port other than 80.


Port mode (commonly used for local testing):
All website ports in the website management must be set to non-80 , and all ports cannot be repeated! Do not use port 80 in the port mode. If you use port 80 in the website management, it means that you are using the domain name mode! ! Because in port mode, different ports are used to distinguish different sites and different php versions.

If you still don’t understand, please read more articles, or check out the video tutorial of this article: Video tutorial address: Not recorded, record again when you have time

Guess you like

Origin blog.csdn.net/Lccee/article/details/103855556