리눅스 PHP 버전 확인

1 방법 1: php[ | ]

  • CentOS, 우분투 공통
[root@zetawiki ~]# php -v
PHP 5.2.10 (cli) (built: Nov 13 2009 11:44:05)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies
[root@zetawiki ~]# php --version
PHP 5.2.10 (cli) (built: Nov 13 2009 11:44:05)
... (생략)
[root@zetawiki ~]# php -r "echo phpversion();"
5.2.10
[root@zetawiki ~]# php -r 'echo PHP_VERSION;'
5.2.10
[root@zetawiki ~]# php -i | grep 'PHP Version'
PHP Version => 5.3.3
PHP Version => 5.3.3

2 방법 2: php-config[ | ]

[root@zetawiki ~]# php-config --version
5.5.30
[root@zetawiki ~]# php-config --vernum
50530

3 방법 3: 우분투[ | ]

  • dkpg
root@zetawiki:~# dpkg -l php5
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                Version        Architecture   Description
+++-===================-==============-==============-===========================================
ii  php5                5.5.9+dfsg-1ub all            server-side, HTML-embedded scripting langua
→ 5.5.9

4 방법 4: CentOS[ | ]

  • rpm
[root@zetawiki ~]# rpm -qa php
php-5.2.10-1.el5.centos
→ 5.2.10
  • yum
[root@zetawiki ~]# yum list installed php
... (생략)
Installed Packages
php.x86_64                                         5.2.10-1.el5.centos                                         installed
→ 5.2.10

5 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}