logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: php.html
Author
spser



Joined: 29 Aug 2016
Posts: 97

PostPosted: Fri 01 Feb '19 5:36    Post subject: php.html Reply with quote

假如文件命名为 a.php.html 并且是gbk编码.

就会乱码.

apache 2.4.38
php 7.3.1

请求帮助.

Mod Edit

Quote:

Suppose the file is named a.php.html and is gbk encoded.

It will be garbled.

Apache 2.4.38
Php 7.3.1

Ask for help.


/Mod Edit
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Fri 01 Feb '19 9:48    Post subject: Reply with quote

Why not using UTF-8?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Fri 01 Feb '19 9:56    Post subject: Reply with quote

I tried and it works for me. Do you parse .html files?

Back to top
spser



Joined: 29 Aug 2016
Posts: 97

PostPosted: Fri 01 Feb '19 10:17    Post subject: Reply with quote

a.php.html
Code:
 test
<?php
phpinfo();
?>


竟然运行成功了, 显示了phpinfo信息..
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Fri 01 Feb '19 16:13    Post subject: Reply with quote

what do you see if you look into the generated code in your browser? (screenshot would be nice)
Back to top
spser



Joined: 29 Aug 2016
Posts: 97

PostPosted: Sat 09 Feb '19 15:24    Post subject: Reply with quote

<IfModule mime_module>
TypesConfig "conf/mime.types"
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddType text/html .php .phps .phpc .cgi

AddHandler cgi-script .cgi .pl .asp
AddHandler application/x-httpd-php .php

AddOutputFilter INCLUDES .shtml
</IfModule>

a.php.html
<?php
phpinfo();
?>

竟然运行成功了, 显示了phpinfo信息..
错误配置应该是来自:
AddHandler application/x-httpd-php .php
Back to top


Reply to topic   Topic: php.html View previous topic :: View next topic
Post new topic   Forum Index -> Apache