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

잔글 (봇: 자동으로 텍스트 교체 (-<source +<syntaxhighlight , -</source> +</syntaxhighlight>))
 
(사용자 2명의 중간 판 37개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==리눅스==
==방법 1: php==
===방법 1===
* CentOS, 우분투 공통
;명령어
<syntaxhighlight lang='console'>
<source lang='bash'>
[root@zetawiki ~]# php -v
php -v
</source>
 
<source lang='bash'>
php --version
</source>
 
;예시
<source lang='dos'>
[root@myhost ~]# 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
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
[root@myhost ~]# php -v
</syntaxhighlight>
<syntaxhighlight lang='console'>
[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'>
[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>
 
==방법 3: 우분투==
* dkpg
<syntaxhighlight lang='console'>
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
</syntaxhighlight>
:→ 5.5.9


===방법 2===
==방법 4: CentOS==
;명령어
* rpm
<source lang='bash'>
<syntaxhighlight lang='console'>
yum info php
[root@zetawiki ~]# rpm -qa php
</source>
php-5.2.10-1.el5.centos
</syntaxhighlight>
:→ 5.2.10


;예시
* yum
<source lang='dos'>
<syntaxhighlight lang='console'>
[root@myhost ~]# yum info php
[root@zetawiki ~]# yum list installed php
Loaded plugins: fastestmirror
... (생략)
Determining fastest mirrors
* base: centos.tt.co.kr
* extras: centos.tt.co.kr
* updates: centos.tt.co.kr
addons                                                  |  951 B    00:00
base                                                    | 1.1 kB    00:00
c5-testing                                              | 1.9 kB    00:00
extras                                                  | 2.1 kB    00:00
updates                                                  | 1.9 kB    00:00
updates/primary_db                                      | 512 kB    00:00
Excluding Packages from CentOS-5 - Base
Finished
Reducing CentOS-5 Testing to included packages only
Finished
Excluding Packages from CentOS-5 - Updates
Finished
Installed Packages
Installed Packages
Name      : php
php.x86_64                                         5.2.10-1.el5.centos                                         installed
Arch      : x86_64
</syntaxhighlight>
Version    : 5.2.10
:→ 5.2.10
Release    : 1.el5.centos
Size      : 3.3 M
Repo      : installed
Summary    : The PHP HTML-embedded scripting language. (PHP: Hypertext
          : Preprocessor)
URL        : http://www.php.net/
License    : PHP
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
          : easy for developers to write dynamically generated webpages. PHP
          : also offers built-in database integration for several commercial
          : and non-commercial database management systems, so writing a
          : database-enabled webpage with PHP is fairly simple. The most common
          : use of PHP coding is probably as a replacement for CGI scripts.
          :
          : The php package contains the module which adds support for the PHP
          : language to Apache HTTP Server.


[root@myhost ~]#
==같이 보기==
</source>
* [[PHP 버전 목록]]
* [[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 }}