使用HTML文件扩展名解析PHP [英] Parsing PHP with HTML file extension

查看:74
本文介绍了使用HTML文件扩展名解析PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是又老又笨又懒。


我一直想继续使用我的所见即所得(所见即所得 -

为我的同伴愚蠢)html编辑器。但有人告诉我你要将你的文件重命名为。$ b,这样才能正确解析它们。哦,如果你支持
由Apache托管,并且可以访问.htaccess文件机制


在我的情况下,通过cPanel并且


然后Apache处理程序


扩展程序处理程序

只需输入

HTML应用程序/ x-httpd-php


然后点击添加


我想(从我读到的)如果你的页面只使用很少的PHP,那么这只是一个好主意,但它肯定会让简单的调用生活变得更加简单。

PHP资源。


这里是细节的链接
http://www.wellho.net/mouth/1355_-ph...tic-Pages.html

仍然愚蠢和懒惰

Len Bell

解决方案

lenbell schreef:


这是老傻和懒惰再次


我一直想继续使用我的所见即所得(所见即所得 -

为我的同伴愚蠢)html编辑器。但有人告诉我你要将你的文件重命名为。$ b,这样才能正确解析它们。哦,如果你支持
由Apache托管,并且可以访问.htaccess文件机制


在我的情况下,通过cPanel并且


然后Apache处理程序


扩展程序处理程序

只需输入

HTML应用程序/ x-httpd-php


然后点击添加按钮



嗨老傻瓜;-)


>

我想(从我读到的)这个只是一个好主意,如果你的页面只使用了很少的PHP,但它肯定会使简单的调用生活变得更容易

PHP资源。



是的,这是可能的。

但是通过PHP传递完整的HTML文件会给你的服务器带来很多

不需要开销。

您的服务器现在必须读取WHOLE html文件并检查它是否包含

php标签:<?php


所以,是的,它可能,但对你的服务器来说不是很好。


但我不明白为什么你给你的文件扩展名html如果他们

包含php。这不是很令人困惑吗?

事实上你使用的是什么,你有时会得到什么样的编辑器是没有理由的。


那你为什么还要这样设置呢?


问候,

Erwin Moller
< blockquote class =post_quotes>
>

这里是细节的链接
http://www.wellho.net/mouth/1355_-ph...tic-Pages .html


仍然愚蠢和懒惰

Len Bell


lenbell写道:


这是老傻和懒惰再次


我一直想要继续使用我所见即所得(你看到的是什么

你得到的 - 对于我的同伴们来说)html编辑器。但我被告知

你必须将你的文件重命名为.PHP,这样才能正确解析

。哦,如果你是由Apache托管并且有一些

访问.htaccess文件机制的话,那就相反了。

在我的情况下通过cPanel并且


然后Apache处理程序


扩展程序处理程序

只需输入

HTML应用程序/ x-httpd-php


然后点击添加


我想(从我读到的)如果您的页面只有少量使用PHP



这只是一个好主意相反,这是一个巨大的浪费资源。这意味着每个

html文件都必须由解释器扫描,以查看

中是否有任何php。因为几乎没有,所以你的所有页面都会慢下来

没有充分理由。


嘿,你设法写了一整段!你的残疾是明显改善了吗?很快你可能会想出一些东西

写作是否合理!


2008年5月28日星期三08:24:27 -0400, lenbell写道:


这是老傻又懒在这里


我一直想继续使用我的所见即所得(所见即所得 -

为我的傻瓜)html编辑。但有人告诉我你要将你的文件重命名为。$ b,这样才能正确解析它们。哦,如果你支持
由Apache托管,并且可以访问.htaccess文件机制


在我的情况下,通过cPanel并且


然后Apache处理程序


扩展程序处理程序

只需输入

HTML应用程序/ x-httpd-php


然后点击添加


我想(从我读到的)如果你的页面只使用很少的PHP,那么这只是一个好主意,但它肯定会让简单的调用生活变得更加简单。

PHP资源。


这里是细节的链接
http://www.wellho.net/mouth/1355_-ph...tic-Pages.html

仍然很愚蠢和懒惰

Len Bell



建议反对这个的原因是它不可能在

所有主机,许多配置正确的系统都不允许这样做。它通过解析所有页面来增加处理负荷

寻找php开放标签,但这在

东西。


-

明天是你职业生涯中的第一天,如果你这样做的话>
非常糟糕,100%的工作都失败了,如果你真的很好而且确实很幸运,只有99%的工作完全浪费时间。 - Hal Bogerd


It''s old stupid and lazy here again

I have been wanting to keep using my WYSIWYG (What You See Is What You Get -
for my fellow stupids) html editor. But I was told that you HAD to rename
your files to .PHP so they would be parsed correctly. Oh contraire if you
are hosted by Apache and have some access to the .htaccess file mechanism

In my case through the "cPanel" and

then "Apache Handlers"

Extension(s) Handler
just enter
HTML application/x-httpd-php

Then click "Add"

I guess (from what I read) that this is only a good idea if your page makes
only small use of PHP but it sure makes life easier for simple calls out to
PHP resources.

Here''s a link to the details
http://www.wellho.net/mouth/1355_-ph...tic-Pages.html

Still stupid and lazy
Len Bell

解决方案

lenbell schreef:

It''s old stupid and lazy here again

I have been wanting to keep using my WYSIWYG (What You See Is What You Get -
for my fellow stupids) html editor. But I was told that you HAD to rename
your files to .PHP so they would be parsed correctly. Oh contraire if you
are hosted by Apache and have some access to the .htaccess file mechanism

In my case through the "cPanel" and

then "Apache Handlers"

Extension(s) Handler
just enter
HTML application/x-httpd-php

Then click "Add"

Hi old stupid ;-)

>
I guess (from what I read) that this is only a good idea if your page makes
only small use of PHP but it sure makes life easier for simple calls out to
PHP resources.

Yes, that is possible.
But passing full HTML files through PHP gives your server a lot of
unneeded overhead.
Your server must now read the WHOLE html file and check if it contains
php tags: <?php

So, yes, it is possible, but not very nice for your server.

But I fail to see why you give your files the extension html if they
contain php. Isn''t that very confusing?
The fact you use a What-you-see-is-what-you-sometimes-get-editor is no
reason.

So why do you want that setup anyway?

Regards,
Erwin Moller

>
Here''s a link to the details
http://www.wellho.net/mouth/1355_-ph...tic-Pages.html

Still stupid and lazy
Len Bell


lenbell wrote:

It''s old stupid and lazy here again

I have been wanting to keep using my WYSIWYG (What You See Is What
You Get - for my fellow stupids) html editor. But I was told that
you HAD to rename your files to .PHP so they would be parsed
correctly. Oh contraire if you are hosted by Apache and have some
access to the .htaccess file mechanism
In my case through the "cPanel" and

then "Apache Handlers"

Extension(s) Handler
just enter
HTML application/x-httpd-php

Then click "Add"

I guess (from what I read) that this is only a good idea if your page
makes only small use of PHP

On the contrary, it is a tremendous waste of resources. It means that every
html file has to be scanned by the interpreter to see if there is any php in
it. Since there hardly ever will be, you will be slowing down all your pages
for no good reason.

And hey, you managed to write a whole paragraph! Your disability is
obviously improving! Very soon you might actually come up with something
sensible to write!


On Wed, 28 May 2008 08:24:27 -0400, lenbell wrote:

It''s old stupid and lazy here again

I have been wanting to keep using my WYSIWYG (What You See Is What You Get -
for my fellow stupids) html editor. But I was told that you HAD to rename
your files to .PHP so they would be parsed correctly. Oh contraire if you
are hosted by Apache and have some access to the .htaccess file mechanism

In my case through the "cPanel" and

then "Apache Handlers"

Extension(s) Handler
just enter
HTML application/x-httpd-php

Then click "Add"

I guess (from what I read) that this is only a good idea if your page makes
only small use of PHP but it sure makes life easier for simple calls out to
PHP resources.

Here''s a link to the details
http://www.wellho.net/mouth/1355_-ph...tic-Pages.html

Still stupid and lazy
Len Bell

The reason for recommending against this is that it''s not possible on
all hosts, and many properly-configured systems won''t allow this. It
/also/ does increase the processing load somewhat by parsing all pages
looking for php open tags, but that''s pretty minor in the scheme of
things.

--
Tomorrow is the first day of the rest of your life in a career where, if you
really suck, 100% of your work fails and if you''re really good and really
lucky only 99% of it is a complete waste of time. - Hal Bogerd


这篇关于使用HTML文件扩展名解析PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆