"CentOS 6에 PHP 5.6 설치 (yum webtatic)"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-== 참고 자료 == +==참고==))
잔글 (봇: 자동으로 텍스트 교체 (-<source +<syntaxhighlight ))
8번째 줄: 8번째 줄:


==확인==
==확인==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# php -v | head -1
[root@zetawiki ~]# php -v | head -1
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)  
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)  
</source>
</source>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# rpm -qa | grep ^php
[root@zetawiki ~]# rpm -qa | grep ^php
php-common-5.3.3-27.el6_5.x86_64
php-common-5.3.3-27.el6_5.x86_64
30번째 줄: 30번째 줄:


==설치 시도 (오류)==
==설치 시도 (오류)==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# yum install --enablerepo=webtatic-testing php56w php56w-opcache
[root@zetawiki ~]# yum install --enablerepo=webtatic-testing php56w php56w-opcache
... (생략)
... (생략)
39번째 줄: 39번째 줄:


==yum-plugin-replace 설치==
==yum-plugin-replace 설치==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# yum install yum-plugin-replace
[root@zetawiki ~]# yum install yum-plugin-replace
... (생략)
... (생략)
56번째 줄: 56번째 줄:
Is this ok [y/N]: y
Is this ok [y/N]: y
</source>
</source>
<source lang='console'>
<syntaxhighlight lang='console'>
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy
Importing GPG key 0xCF4C4FF9:
Importing GPG key 0xCF4C4FF9:
64번째 줄: 64번째 줄:
Is this ok [y/N]: y
Is this ok [y/N]: y
</source>
</source>
<source lang='console'>
<syntaxhighlight lang='console'>
... (생략)
... (생략)
Installed:
Installed:
73번째 줄: 73번째 줄:


==php-common 교체==
==php-common 교체==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# yum replace --enablerepo=webtatic-testing php-common --replace-with=php56w-common
[root@zetawiki ~]# yum replace --enablerepo=webtatic-testing php-common --replace-with=php56w-common
... (생략)
... (생략)
80번째 줄: 80번째 줄:
This may be normal depending on the package.  Continue? [y/N] y
This may be normal depending on the package.  Continue? [y/N] y
</source>
</source>
<source lang='console'>
<syntaxhighlight lang='console'>
... (생략)
... (생략)
========================================================================
========================================================================
119번째 줄: 119번째 줄:
Is this ok [y/N]: y
Is this ok [y/N]: y
</source>
</source>
<source lang='console'>
<syntaxhighlight lang='console'>
... (생략)
... (생략)
Installed:
Installed:
141번째 줄: 141번째 줄:


==확인 2==
==확인 2==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# php -v
[root@zetawiki ~]# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apc.so' - /usr/lib64/php/modules/apc.so: undefined symbol: zend_unmangle_property_name in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apc.so' - /usr/lib64/php/modules/apc.so: undefined symbol: zend_unmangle_property_name in Unknown on line 0
153번째 줄: 153번째 줄:


==php56w-opcache 설치==
==php56w-opcache 설치==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# yum install --enablerepo=webtatic-testing php56w-opcache
[root@zetawiki ~]# yum install --enablerepo=webtatic-testing php56w-opcache
... (생략)
... (생략)
170번째 줄: 170번째 줄:
Is this ok [y/N]: y
Is this ok [y/N]: y
</source>
</source>
<source lang='console'>
<syntaxhighlight lang='console'>
... (생략)
... (생략)
Installed:
Installed:
179번째 줄: 179번째 줄:


==확인 3==
==확인 3==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# php -v
[root@zetawiki ~]# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apc.so' - /usr/lib64/php/modules/apc.so: undefined symbol: zend_unmangle_property_name in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apc.so' - /usr/lib64/php/modules/apc.so: undefined symbol: zend_unmangle_property_name in Unknown on line 0
192번째 줄: 192번째 줄:
==아파치 재시작==
==아파치 재시작==
*아파치에 적용하기 위해 아파치를 재시작
*아파치에 적용하기 위해 아파치를 재시작
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# service httpd restart
[root@zetawiki ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Stopping httpd:                                            [  OK  ]
201번째 줄: 201번째 줄:
==(APC 모듈 비활성화 조치)==
==(APC 모듈 비활성화 조치)==
*APC 모듈 Warning을 없애기 위해 비활성화한다.
*APC 모듈 Warning을 없애기 위해 비활성화한다.
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# vi /etc/php.ini
[root@zetawiki ~]# vi /etc/php.ini
</source>
</source>
<source lang='ini'>
<syntaxhighlight lang='ini'>
;[apc]
;[apc]
;extension=apc.so
;extension=apc.so
210번째 줄: 210번째 줄:
:→ apc 모듈 설정 부분을 주석처리함
:→ apc 모듈 설정 부분을 주석처리함


<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# php -v
[root@zetawiki ~]# php -v
PHP 5.6.0beta4 (cli) (built: Jun  7 2014 19:18:41)  
PHP 5.6.0beta4 (cli) (built: Jun  7 2014 19:18:41)  
223번째 줄: 223번째 줄:
{{참고|미디어위키 오류 메시지 표시}}
{{참고|미디어위키 오류 메시지 표시}}
*미디어위키 웹페이지에서 아래와 같은 오류 발생
*미디어위키 웹페이지에서 아래와 같은 오류 발생
<source lang='text'>
<syntaxhighlight lang='text'>
[54c0a219] /w/ Exception from line 133 of /var/www/html/w/includes/objectcache/ObjectCache.php: CACHE_ACCEL requested but no suitable object cache is present. You may want to install APC.
[54c0a219] /w/ Exception from line 133 of /var/www/html/w/includes/objectcache/ObjectCache.php: CACHE_ACCEL requested but no suitable object cache is present. You may want to install APC.


239번째 줄: 239번째 줄:
</source>
</source>


<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# vi /var/www/html/w/LocalSettings.php
[root@zetawiki ~]# vi /var/www/html/w/LocalSettings.php
</source>
</source>
<source lang='php'>
<syntaxhighlight lang='php'>
## Shared memory settings
## Shared memory settings
#$wgMainCacheType = CACHE_ACCEL;
#$wgMainCacheType = CACHE_ACCEL;
253번째 줄: 253번째 줄:
*아래 명령어로 간단하게 원래 상태로 복구할 수 있다.
*아래 명령어로 간단하게 원래 상태로 복구할 수 있다.
:즉 PHP 5.6 → 5.3.3
:즉 PHP 5.6 → 5.3.3
<source lang='bash'>
<syntaxhighlight lang='bash'>
yum remove php56w-opcache
yum remove php56w-opcache
yum replace php56w-common --replace-with=php-common
yum replace php56w-common --replace-with=php-common

2020년 11월 2일 (월) 00:40 판

  다른 뜻에 대해서는 CentOS 6에 PHP 5.6 설치 (yum remi) 문서를 참조하십시오.

1 개요

CentOS 6에 PHP 5.6 설치 (yum)
  • beta 버전 rpm을 사용... 중요한 시스템이라면 영향도를 충분히 고려하시라.
  • PHP 패키지들의 기초라 할 수 있는 php-common을 교체하는 과정이 포함되어 있음[1]
  • 이 문서 대신 CentOS 6에 PHP 5.6 설치 (yum remi)를 추천함 ★

2 확인

<syntaxhighlight lang='console'> [root@zetawiki ~]# php -v | head -1 PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57) </source> <syntaxhighlight lang='console'> [root@zetawiki ~]# rpm -qa | grep ^php php-common-5.3.3-27.el6_5.x86_64 php-mysql-5.3.3-27.el6_5.x86_64 php-cli-5.3.3-27.el6_5.x86_64 php-devel-5.3.3-27.el6_5.x86_64 php-5.3.3-27.el6_5.x86_64 php-xml-5.3.3-27.el6_5.x86_64 php-pear-1.9.4-4.el6.noarch php-pdo-5.3.3-27.el6_5.x86_64 php-gd-5.3.3-27.el6_5.x86_64 php-intl-5.3.3-27.el6_5.x86_64 </source>

3 webtatic 저장소 추가

4 설치 시도 (오류)

<syntaxhighlight lang='console'> [root@zetawiki ~]# yum install --enablerepo=webtatic-testing php56w php56w-opcache ... (생략) Error: php56w-common conflicts with php-common-5.3.3-27.el6_5.x86_64

You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

</source>

5 yum-plugin-replace 설치

<syntaxhighlight lang='console'> [root@zetawiki ~]# yum install yum-plugin-replace ... (생략)

5.1 ============================================================
Package               Arch      Version              Repository   Size
5.2 ============================================================

Installing:

yum-plugin-replace    noarch    0.2.6-1.ius.el6      webtatic     17 k

Transaction Summary

5.3 ============================================================

Install 1 Package(s)

Total download size: 17 k Installed size: 34 k Is this ok [y/N]: y </source> <syntaxhighlight lang='console'> Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy Importing GPG key 0xCF4C4FF9:

Userid : Andy Thompson <andy@webtatic.com>
Package: webtatic-release-6-4.noarch (installed)
From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy

Is this ok [y/N]: y </source> <syntaxhighlight lang='console'> ... (생략) Installed:

 yum-plugin-replace.noarch 0:0.2.6-1.ius.el6                           

Complete! </source>

6 php-common 교체

<syntaxhighlight lang='console'> [root@zetawiki ~]# yum replace --enablerepo=webtatic-testing php-common --replace-with=php56w-common ... (생략) WARNING: Unable to resolve all providers: ['config(php-common)', 'curl.so()(64bit)', 'fileinfo.so()(64bit)', 'json.so()(64bit)', 'phar.so()(64bit)', 'zip.so()(64bit)', 'config(php)', 'libphp5.so()(64bit)', 'config(php-pdo)', 'pdo.so()(64bit)', 'pdo_sqlite.so()(64bit)', 'sqlite3.so()(64bit)', 'config(php-gd)', 'gd.so()(64bit)', 'config(php-mysql)', 'mysql.so()(64bit)', 'mysqli.so()(64bit)', 'pdo_mysql.so()(64bit)', 'config(php-devel)', 'config(php-xml)', 'dom.so()(64bit)', 'wddx.so()(64bit)', 'xmlreader.so()(64bit)', 'xmlwriter.so()(64bit)', 'xsl.so()(64bit)', 'config(php-intl)', 'intl.so()(64bit)']

This may be normal depending on the package. Continue? [y/N] y </source> <syntaxhighlight lang='console'> ... (생략)

6.1 ============================================================
Package         Arch    Version                Repository         Size
6.2 ============================================================

Installing:

php56w          x86_64  5.6.0-0.7.beta4.w6     webtatic-testing  2.5 M
php56w-cli      x86_64  5.6.0-0.7.beta4.w6     webtatic-testing  2.4 M
php56w-common   x86_64  5.6.0-0.7.beta4.w6     webtatic-testing  1.1 M
php56w-devel    x86_64  5.6.0-0.7.beta4.w6     webtatic-testing  2.5 M
php56w-gd       x86_64  5.6.0-0.7.beta4.w6     webtatic-testing  140 k
php56w-intl     x86_64  5.6.0-0.7.beta4.w6     webtatic-testing  175 k
php56w-mysql    x86_64  5.6.0-0.7.beta4.w6     webtatic-testing  107 k
php56w-pdo      x86_64  5.6.0-0.7.beta4.w6     webtatic-testing   92 k
php56w-pear     noarch  1:1.9.4-1.w6           webtatic-testing  363 k
php56w-xml      x86_64  5.6.0-0.7.beta4.w6     webtatic-testing  143 k

Removing:

php             x86_64  5.3.3-27.el6_5         @updates          3.5 M
php-cli         x86_64  5.3.3-27.el6_5         @updates          6.2 M
php-common      x86_64  5.3.3-27.el6_5         @updates          2.9 M
php-devel       x86_64  5.3.3-27.el6_5         @updates          3.0 M
php-gd          x86_64  5.3.3-27.el6_5         @updates          324 k
php-intl        x86_64  5.3.3-27.el6_5         @updates          166 k
php-mysql       x86_64  5.3.3-27.el6_5         @updates          216 k
php-pdo         x86_64  5.3.3-27.el6_5         @updates          168 k
php-pear        noarch  1:1.9.4-4.el6          @base             2.2 M
php-xml         x86_64  5.3.3-27.el6_5         @updates          307 k

Installing for dependencies:

php56w-process  x86_64  5.6.0-0.7.beta4.w6     webtatic-testing   32 k
t1lib           x86_64  5.1.2-6.el6_2.1        base              160 k

Transaction Summary

6.3 ============================================================

Install 12 Package(s) Remove 10 Package(s)

Total download size: 9.7 M Is this ok [y/N]: y </source> <syntaxhighlight lang='console'> ... (생략) Installed:

 php56w.x86_64 0:5.6.0-0.7.beta4.w6                                    
 php56w-cli.x86_64 0:5.6.0-0.7.beta4.w6                                
 php56w-common.x86_64 0:5.6.0-0.7.beta4.w6                             
 php56w-devel.x86_64 0:5.6.0-0.7.beta4.w6                              
 php56w-gd.x86_64 0:5.6.0-0.7.beta4.w6                                 
 php56w-intl.x86_64 0:5.6.0-0.7.beta4.w6                               
 php56w-mysql.x86_64 0:5.6.0-0.7.beta4.w6                              
 php56w-pdo.x86_64 0:5.6.0-0.7.beta4.w6                                
 php56w-pear.noarch 1:1.9.4-1.w6                                       
 php56w-xml.x86_64 0:5.6.0-0.7.beta4.w6                                

Dependency Installed:

 php56w-process.x86_64 0:5.6.0-0.7.beta4.w6                            
 t1lib.x86_64 0:5.1.2-6.el6_2.1                                        

Complete! </source>

7 확인 2

<syntaxhighlight lang='console'> [root@zetawiki ~]# php -v PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apc.so' - /usr/lib64/php/modules/apc.so: undefined symbol: zend_unmangle_property_name in Unknown on line 0 PHP 5.6.0beta4 (cli) (built: Jun 7 2014 19:18:41) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.6.0-dev, Copyright (c) 1998-2014 Zend Technologies </source>

APC 모듈을 적재하는 과정에서 Warning 발생
→ (이것은 필자가 APC 모듈이 설정했기 때문에 발생하는 것이다. 만약 설정되지 않았다면 뜨지 않을 것이다.)
→ PHP 5.6.0beta4 버전임

8 php56w-opcache 설치

<syntaxhighlight lang='console'> [root@zetawiki ~]# yum install --enablerepo=webtatic-testing php56w-opcache ... (생략)

8.1 ============================================================
Package         Arch    Version                Repository         Size
8.2 ============================================================

Installing:

php56w-opcache  x86_64  5.6.0-0.7.beta4.w6     webtatic-testing   97 k

Transaction Summary

8.3 ============================================================

Install 1 Package(s)

Total download size: 97 k Installed size: 292 k Is this ok [y/N]: y </source> <syntaxhighlight lang='console'> ... (생략) Installed:

 php56w-opcache.x86_64 0:5.6.0-0.7.beta4.w6                            

Complete! </source>

9 확인 3

<syntaxhighlight lang='console'> [root@zetawiki ~]# php -v PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apc.so' - /usr/lib64/php/modules/apc.so: undefined symbol: zend_unmangle_property_name in Unknown on line 0 PHP 5.6.0beta4 (cli) (built: Jun 7 2014 19:18:41) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.6.0-dev, Copyright (c) 1998-2014 Zend Technologies

   with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

</source>

→ APC 모듈 Warning은 그대로 발생
→ Zend OPcache가 추가됨

10 아파치 재시작

  • 아파치에 적용하기 위해 아파치를 재시작

<syntaxhighlight lang='console'> [root@zetawiki ~]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] </source>

  • 일반적인 경우(APC 설정을 하지 않은 경우)라면 여기까지 하면 OK

11 (APC 모듈 비활성화 조치)

  • APC 모듈 Warning을 없애기 위해 비활성화한다.

<syntaxhighlight lang='console'> [root@zetawiki ~]# vi /etc/php.ini </source> <syntaxhighlight lang='ini'>

[apc]
extension=apc.so

</source>

→ apc 모듈 설정 부분을 주석처리함

<syntaxhighlight lang='console'> [root@zetawiki ~]# php -v PHP 5.6.0beta4 (cli) (built: Jun 7 2014 19:18:41) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.6.0-dev, Copyright (c) 1998-2014 Zend Technologies

   with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

</source>

→ APC 모듈 Warning이 사라짐

12 (미디어위키 APC 설정 제거 조치)

  • 미디어위키 웹페이지에서 아래와 같은 오류 발생

<syntaxhighlight lang='text'> [54c0a219] /w/ Exception from line 133 of /var/www/html/w/includes/objectcache/ObjectCache.php: CACHE_ACCEL requested but no suitable object cache is present. You may want to install APC.

Backtrace:

  1. 0 [internal function]: ObjectCache::newAccelerator(array)
  2. 1 /var/www/html/w/includes/objectcache/ObjectCache.php(85): call_user_func(string, array)
  3. 2 /var/www/html/w/includes/objectcache/ObjectCache.php(72): ObjectCache::newFromParams(array)
  4. 3 /var/www/html/w/includes/objectcache/ObjectCache.php(44): ObjectCache::newFromId(integer)
  5. 4 /var/www/html/w/includes/GlobalFunctions.php(3961): ObjectCache::getInstance(integer)
  6. 5 /var/www/html/w/includes/Setup.php(513): wfGetMainCache()
  7. 6 /var/www/html/w/includes/WebStart.php(156): require_once(string)
  8. 7 /var/www/html/w/index.php(43): require(string)
  9. 8 {main}

</source>

<syntaxhighlight lang='console'> [root@zetawiki ~]# vi /var/www/html/w/LocalSettings.php </source> <syntaxhighlight lang='php'>

    1. Shared memory settings
  1. $wgMainCacheType = CACHE_ACCEL;
  2. $wgMemCachedServers = array();

</source>

→ 캐시 설정부분을 주석처리함
→ 여기까지 하니 미디어위키 웹페이지가 정상화되었다.

13 (원상복구)

  • 아래 명령어로 간단하게 원래 상태로 복구할 수 있다.
즉 PHP 5.6 → 5.3.3

<syntaxhighlight lang='bash'> yum remove php56w-opcache yum replace php56w-common --replace-with=php-common </source>

14 같이 보기

15 주석

  1. 다른 모든 PHP 패키지가 여기에 의존성이 있음

16 참고

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