douyong1886 2017-04-11 00:49
浏览 341
已采纳

php中的if(false)是什么意思?

Today, I decided to download wordpress and the first file that I have come across is wp-admin/install.php. the first thing in the file is this:

// Sanity check.
if ( false ) {
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Error: PHP is not running</title>
</head>
<body class="wp-core-ui">
    <p id="logo"><a href="https://wordpress.org/">WordPress</a></p>
    <h1>Error: PHP is not running</h1>
    <p>WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.</p>
</body>
</html>
<?php
}

Now I am kind of wondering, What is if( false ) ? and how does it mean that the user is not running php on their server?

  • 写回答

2条回答 默认 最新

  • dongzhenbi8919 2017-04-11 01:53
    关注

    If the PHP is running on the server, the statement inside if ( false ) will be skipped, because this equates to FALSE or its like if(0) .

    But in such cases that PHP compiler does not exist, the server will parse all html codes inside that statement ,(saying PHP is not running).

    It's a sanity check.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘