如何知道我的Web服务器是否支持PHP?

PHPInfo Response PageThere is a quick and simple test. Create a new page, one completely free of code of any kind, with the filename
test.php (the actual name of the file is immaterial, so long as it follows standard web naming conventions and has a .php suffix). On this page, write a single line of code:

test.php创建一个新页面,该页面完全不包含任何类型的代码(文件的实际名称无关紧要,只要它遵循标准的Web命名约定并带有.php后缀即可)。 在此页面上,编写一行代码:

<?php phpInfo(); ?>

Then upload or place the page in the appropriate directory on your server and use your web browser to navigate to the page.

然后将页面上载或放置在服务器上的适当目录中并使用Web浏览器导航到该页面。

If the server is running PHP, what you will see may surprise you: a huge presentation of data pulled live from the server regarding PHP, Apache, and associated modules. While very simple, this also demonstrates how powerful server-side languages can be: a single function can generate an incredible amount of content.

如果服务器运行的是PHP,您将看到的结果可能会让您感到惊讶:从服务器实时获取的有关PHP,Apache和关联模块的大量数据展示。 尽管非常简单,但这也说明了服务器端语言的强大功能:单个功能可以生成大量内容。

To extend this lesson, take a look at the source code of the generated page (CTRL-U/CMD-U in most browsers). Note that you do not see any trace of PHP code; you only see the HTML and CSS generated by PHP. The browser never directly interacts with PHP; it only receives its output, expressed as HTML, CSS, JavaScript or images.

要扩展本课程,请查看生成的页面的源代码(在大多数浏览器中为CTRL-U / CMD-U )。 注意,您看不到任何PHP代码痕迹。 你只看到 PHP生成HTML和CSS。 浏览器从不直接与PHP交互; 它仅接收其输出,表示为HTMLCSSJavaScript图像

翻译自: https://thenewcode.com/175/How-Do-I-Know-If-My-Web-Server-Supports-PHP

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值