简体   繁体   English

用HTML解析PHP时遇到问题

[英]Trouble with parsing PHP in HTML

I have a html page that I'm trying to use php on. 我有一个html页面,我正在尝试使用php。 I've got AddType application/x-httpd-php .html in the .htaccess file like I read I should have. 我在.htaccess文件中有AddType application / x-httpd-php .html,就像我读过的一样。 When I try to access the page in a browser, a dialog box appears that asks whether I would like to save the file or open it in a browser. 当我尝试在浏览器中访问页面时,将出现一个对话框,询问我是否要保存文件或在浏览器中打开文件。 If I choose to open it in a browser, the page comes up without any css, just very basic html. 如果我选择在浏览器中打开它,则该页面将没有任何CSS,只是非常基本的html。 What am I doing wrong? 我究竟做错了什么?

You need to run apache. 您需要运行apache。 And save the files in the server folder made for it. 并将文件保存在为此创建的服务器文件夹中。 And then you need to go to localhost/your-file 然后您需要转到localhost / your-file

Apache documentation is your friend here: https://httpd.apache.org/docs/ Apache文档是您的朋友: https : //httpd.apache.org/docs/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM