如何检测php运行速度_这是检查正在运行PHP版本的方法

如何检测php运行速度

If you can't get something to work and think it might be because you have the wrong version of PHP, there's a really simple way to check the current version. 

如果您无法使用某些功能,并认为可能是因为您使用了错误的PHP版本,则有一种非常简单的方法来检查当前版本。

Different versions of PHP may have different default settings, and in the case of newer versions, might have new functions.

不同版本PHP可能具有不同的默认设置,而在较新版本的情况下,可能具有新功能。

If a PHP tutorial is giving instructions for a particular version of PHP, it's important to understand how to check the version you have installed.

如果PHP教程给出了特定版本PHP的说明,那么了解如何检查已安装的版本非常重要。

如何检查PHP版本 ( How to Check the PHP Version )

Running a simple PHP file will not only tell you your PHP version but an abundance of information about all your PHP settings. Just put this single line of PHP code in a blank text file and open it on the server:

运行一个简单PHP文件不仅会告诉您您PHP版本,而且还会提供有关所有PHP设置的大量信息。 只需将这行PHP代码放入空白文本文件中,然后在服务器上将其打开:


<?php phpinfo() ?>

Below is how to check the locally installed version of PHP. You can run this in Command Prompt in Windows or Terminal for Linux/macOS.

以下是如何检查本地安装PHP版本。 您可以在Windows或Linux / macOS的终端的命令提示符中运行此命令。


php -v

Here's an example output:

这是示例输出:


PHP 5.6.35 (cli) (built: Mar 29 2018 14:27:15)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

Windows中未显示PHP版本吗? ( Is the PHP Version Not Showing in Windows? )

Given that you actually are running PHP on your web server, the most common reason for the version of PHP not showing up is if the path to PHP is not set up with Windows.

鉴于您实际上是在Web服务器上运行PHP ,因此未显示PHP版本的最常见原因是Windows上未设置PHP路径。

You might see the error like this if the correct environment variable isn't configured:

如果未配置正确的环境变量,您可能会看到这样的错误


‘php.exe’ is not recognized as an internal or external command, operable program or batch file.

In a Command Prompt, type the following command, where the path after "C:" is the path to PHP (yours may be different):

在命令提示符中,键入以下命令,其中“ C:”之后的路径是PHP的路径(您可能有所不同):


set PATH=%PATH%;C:\php\php.exe

翻译自: https://www.thoughtco.com/what-version-of-php-running-2694207

如何检测php运行速度

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值