The file name suffix is an html file. If php code is available, php code will be ignored?

Source: Internet
Author: User
The file name suffix is an html file. If php code is available, php code will be ignored? Reply to discussion (solution)

Yes!
The. html. htm file is directly returned by default, and the html code is parsed by the browser.

If you want to change .php to .html and make PHP parse, you can only configure it on the server.

Yes!
The. html. htm file is directly returned by default, and the html code is parsed by the browser.

The suffix is a PHP file.
The file contains php code and html code.

The php code is parsed by Apache.
The html code is parsed by the browser.

Yes?

If you want to change .php to .html and make PHP parse, you can only configure it on the server.

How to configure Apache?

If you want to change .php to .html and make PHP parse, you can only configure it on the server.

What are the advantages of doing so?
Will it increase the burden on Apache servers?

The suffix is a PHP file.
The file contains php code and html code.

The php code is parsed by Apache.
The html code is parsed by the browser.

Yes? The php code is parsed by the php parser. Apache is only responsible for transferring

That's of course!
If you want to change .php to .html and make PHP parse, you can only configure it on the server.

What are the advantages of doing so?
Will it increase the burden on Apache servers?


If you want to change .php to .html and make PHP parse, you can only configure it on the server.

How to configure Apache?
This depends on how apache calls php.
In the module mode, specify. html as the php type.
Use CGI to associate. html with the php parser.


The suffix is a PHP file.
The file contains php code and html code.

The php code is parsed by Apache.
The html code is parsed by the browser.

Yes? The php code is parsed by the php parser. Apache is only responsible for transferring

Where does the php parser parse?



If you want to change .php to .html and make PHP parse, you can only configure it on the server.

How to configure Apache?
This depends on how apache calls php.
In the module mode, specify. html as the php type.
Use CGI to associate. html with the php parser.

What is a php parser?
What is the module mode?
What is CGI?

I don't know how to explain it. these concepts should be understood before installing apache.
If you don't want to post a large article, you can take a look at the knowledge of Baidu, google, and wiki.

I don't know how to explain it. these concepts should be understood before installing apache.
If you don't want to post a large article, you can take a look at the knowledge of Baidu, google, and wiki.

What is the interpreter?
Http://zh.wikipedia.org/wiki/%E7%9B%B4%E8%AD%AF%E5%99%A8

If you want to change .php to .html and make PHP parse, you can only configure it on the server.

PHP parser: parse html and php code.
Browser parser: Only html code can be parsed.

Yes?

Change:
1. Apache is installed with a PHP parser.
By default, only php files with the suffix are parsed.

If you want Apache to parse the suffix: html file.
Apache must be configured.

Yes?


If you want to change .php to .html and make PHP parse, you can only configure it on the server.

PHP parser: parse html and php code.
Browser parser: Only html code can be parsed.

Yes? PHP only parses PHP code, and ignore other code. How to distinguish PHP code from other code is to use tags
The pages are transmitted by apache. for PHP, since apache is configured to be parsed by the PHP parser, apache calls php to complete code parsing when you access the PHP file, finally, the execution result is output to the user.

If apacheconfigures .html to be parsed by PHP, the above functions can also be implemented.

To prevent attacks against programs, some servers compile the parser and parse programs with special extensions to confuse attackers.

No, unless you change the configuration file.



If you want to change .php to .html and make PHP parse, you can only configure it on the server.

PHP parser: parse html and php code.
Browser parser: Only html code can be parsed.

Yes? PHP only parses PHP code, and ignore other code. How to distinguish PHP code from other code is to use tags
The pages are transmitted by apache. for PHP, since apache is configured to be parsed by the PHP parser, apache calls php to complete code parsing when you access the PHP file, finally, the execution result is output to the user.

If apacheconfigures .html to be parsed by PHP, the above functions can also be implemented.

To prevent attacks against programs, some servers compile the parser and parse programs with special extensions to confuse attackers.

On the Apache server, how does one configure it so that it can parse the file with the suffix ". html?

Addtype application/x-httpd-php. html

Addtype application/x-httpd-php. html

Is it a command?


Addtype application/x-httpd-php. html

Is it a command? Apache configuration file.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.