"리눅스 PHP 버전 확인"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-<source +<syntaxhighlight , -</source> +</syntaxhighlight>))
 
(사용자 2명의 중간 판 25개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==방법 1: php==
==방법 1: php==
;명령어
* CentOS, 우분투 공통
<source lang='bash'>
<syntaxhighlight lang='console'>
php -v
[root@zetawiki ~]# php -v
</source>
<source lang='bash'>
php --version
</source>
 
;예시
<source lang='dos'>
[root@jmnote ~]# php -v
PHP 5.2.10 (cli) (built: Nov 13 2009 11:44:05)
PHP 5.2.10 (cli) (built: Nov 13 2009 11:44:05)
Copyright (c) 1997-2009 The PHP Group
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
     with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies
     with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies
</source>
</syntaxhighlight>
<source lang='dos'>
<syntaxhighlight lang='console'>
[root@jmnote ~]# php --version
[root@zetawiki ~]# php --version
PHP 5.2.10 (cli) (built: Nov 13 2009 11:44:05)
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
</syntaxhighlight>
    with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies
<syntaxhighlight lang='console'>
</source>
[root@zetawiki ~]# php -r "echo phpversion();"
5.2.10
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# php -r 'echo PHP_VERSION;'
5.2.10
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# php -i | grep 'PHP Version'
PHP Version => 5.3.3
PHP Version => 5.3.3
</syntaxhighlight>
 
==방법 2: php-config==
{{참고|php-config}}
<syntaxhighlight lang='console'>
[root@zetawiki ~]# php-config --version
5.5.30
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# php-config --vernum
50530
</syntaxhighlight>


==방법 2: rpm==
==방법 3: 우분투==
;명령어
* dkpg
<source lang='bash'>
<syntaxhighlight lang='console'>
rpm -qa php
root@zetawiki:~# dpkg -l php5
</source>
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
</syntaxhighlight>
:→ 5.5.9


;실행예시
==방법 4: CentOS==
<source lang='dos'>
* rpm
[root@jmnote ~]# rpm -qa php
<syntaxhighlight lang='console'>
[root@zetawiki ~]# rpm -qa php
php-5.2.10-1.el5.centos
php-5.2.10-1.el5.centos
</source>
</syntaxhighlight>
:→ 5.2.10
:→ 5.2.10


==방법 3: yum==
* yum
;명령어
<syntaxhighlight lang='console'>
<source lang='bash'>
[root@zetawiki ~]# yum list installed php
yum list installed php
</source>
 
;실행예시
<source lang='dos'>
[root@jmnote ~]# yum list installed php
... (생략)
... (생략)
Installed Packages
Installed Packages
php.x86_64                                        5.2.10-1.el5.centos                                        installe
php.x86_64                                        5.2.10-1.el5.centos                                        installed
</source>
</syntaxhighlight>
:→ 5.2.10
:→ 5.2.10


==같이 보기==
==같이 보기==
*[[아파치 버전 확인]]
* [[PHP 버전 목록]]
*[[MySQL 버전 확인]]
* [[php.ini의 위치]]
*[[리눅스 버전 확인]]
* [[PHP_VERSION]]
* [[아파치 버전 확인]]
* [[리눅스 버전 확인]]
* [[MySQL 버전 확인]]
* [[PHP phpversion()]]
* [[PHP 모듈 설치 확인]]
* [[The program 'php' is currently not installed.]]


[[분류:리눅스]]
[[분류:리눅스]]
[[분류: 버전]]
[[분류:버전 확인]]

2021년 9월 24일 (금) 23:17 기준 최신판

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 }}