douruduan8812
2014-01-21 08:52
浏览 30
已采纳

是否可以通过查看网站知道哪个页面正在加载php版本? [关闭]

I would like to make a tool that would check what version of PHP the page is loading, I work a lot with wordpress and this would save me a lot of time, Thanks!

图片转代码服务由CSDN问答提供 功能建议

我想制作一个工具来检查页面加载的PHP版本,我工作了很多 wordpress,这将节省我很多时间,谢谢!

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • duanche2007 2014-01-21 08:54
    已采纳

    You may look at the HTTP response headers, which may include the X-Powered-By header. If it doesn't, there's no real way to find out. E.g.:

    deceze$ curl -I localhost
    HTTP/1.1 200 OK
    Date: Tue, 21 Jan 2014 08:53:47 GMT
    Server: Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/0.9.8y DAV/2 PHP/5.4.15
    X-Powered-By: PHP/5.4.15
    Vary: Accept-Encoding
    Content-Type: text/html
    

    The above is assuming the question is about figuring out the PHP version of arbitrary 3rd party servers. If you have actual access to the server yourself, there's a ton of ways to find out.

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • douzhaocheng4533 2014-01-21 08:55

    You have to put a php file in your server (FTP) with the following code:

    <?php phpinfo(); ?>
    

    This will output the php version as well as other info

    http://php.net/phpversion

    Cheers

    评论
    解决 无用
    打赏 举报
  • douhe4336 2014-01-21 08:55

    Try:

    echo phpversion();
    

    use this to return php version.

    评论
    解决 无用
    打赏 举报
  • douyi5157 2014-01-21 09:09

    Try this,

    print_r(apache_response_headers() );
    

    OUTPUT:

    Array
     (
        [X-Powered-By] => PHP/5.4.17
    )
    

    To get apache version:

        $version = apache_get_version();
        echo "$version
    ";
    

    OUTPUT:

     Apache/2.2.23 (Fedora)
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题