PHP5.3 업그레이드 후 php.ini세팅 / 확장모듈설치
정리해야함.
cafe24 > michel88 계정 문의계시판 php.ini 세팅관련 문의글도 같이 작성할것
가상서버 호스팅은 기본적으로 php 5.1 설치가 됩니다.
php 5.3 으로 사용을 원하신다면 다음과 같은 방법으로 재 설치를 해주시면 간단히 php 버전을 업그레이드 할 수 있습니다.
[root@yoogyeoms ~]# vim /etc/yum.repos.d/php53.repo // 파일을 생성해 아래 와 같이 입력 후 저장
[php53]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
[root@yoogyeoms ~]# yum --enablerepo=php53 search php53 // 패키지 확인
[root@yoogyeoms ~]# yum remove php* // 기존 php 5.1 삭제
[root@yoogyeoms ~]# yum --enablerepo=php53 install php53 php-pear php53-mysql // php5.3 php-pear php53-mysql 설치
[root@yoogyeoms ~]# php -v // 설치된 버전 확인
가령 추가로 mbstring 을 설치해야 한다면 아래와 같이 한다.
[root@yoogyeoms ~]# yum --enablerepo=php53 install php53-mbstring
[root@yoogyeoms ~]# vi /etc/php.ini
extension=php_mbstring.extension
를 추가한 후
[root@yoogyeoms ~]# service httpd restart
아파치를 재시작 한다.
그리고 아래와 같이 많은 확장 모듈이 있다. 필요한 경우 세팅하고 아파치를 재시작하면 된다.
- php53-gd
- php53-ldap
- php53-mbstring
- php53-mysql
- php53-xml
[root@michel88 html]# getconf LONG_BIT
64
[root@michel88 html]# php -f phpinfo.php | grep "PHP Extension"
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mbstring.extension' - /usr/lib64/php/modules/php_mbstring.extension: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
PHP Extension => 20090626
PHP Extension Build => API20090626,NTS
[root@michel88 html]# php -f phpinfo.php | grep "Thread Safety"
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mbstring.extension' - /usr/lib64/php/modules/php_mbstring.extension: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Thread Safety => disabled
[root@michel88 html]# getconf -a | grep libc
GNU_LIBC_VERSION glibc 2.5
[root@michel88 html]# php -version
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mbstring.extension' - /usr/lib64/php/modules/php_mbstring.extension: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
PHP 5.3.3 (cli) (built: Oct 31 2014 09:52:36)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
[root@michel88 html]# php -f phpinfo.php | grep Debug
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mbstring.extension' - /usr/lib64/php/modules/php_mbstring.extension: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Debug Build => no
Debug => No
[root@michel88 html]#
[root@michel88 php.d]# pwd
/etc/php.d
[root@michel88 php.d]# ll
합계 48
-rw-r--r-- 1 root root 62 1월 22 14:03 ICERTSecu.ini
-rw-r--r-- 1 root root 49 10월 31 2014 curl.ini
-rw-r--r-- 1 root root 57 10월 31 2014 fileinfo.ini
-rw-r--r-- 1 root root 49 10월 31 2014 json.ini
-rw-r--r-- 1 root root 57 10월 31 2014 mbstring.ini
-rw-r--r-- 1 root root 51 10월 31 2014 mysql.ini
-rw-r--r-- 1 root root 53 10월 31 2014 mysqli.ini
-rw-r--r-- 1 root root 47 10월 31 2014 pdo.ini
-rw-r--r-- 1 root root 59 10월 31 2014 pdo_mysql.ini
-rw-r--r-- 1 root root 61 10월 31 2014 pdo_sqlite.ini
-rw-r--r-- 1 root root 49 10월 31 2014 phar.ini
-rw-r--r-- 1 root root 47 10월 31 2014 zip.ini
[root@michel88 php.d]#
[root@michel88 php.d]# cd /usr/lib64/php/modules/
[root@michel88 modules]# ll
합계 4848
-rwxr-xr-x 1 root root 126692 3월 19 2014 ICERTSecu.so
-rwxr-xr-x 1 root root 62240 10월 31 2014 curl.so
-rwxr-xr-x 1 root root 1837888 10월 31 2014 fileinfo.so
-rwxr-xr-x 1 root root 32856 10월 31 2014 json.so
-rwxr-xr-x 1 root root 2169776 10월 31 2014 mbstring.so
-rwxr-xr-x 1 root root 54328 10월 31 2014 mysql.so
-rwxr-xr-x 1 root root 131536 10월 31 2014 mysqli.so
-rwxr-xr-x 1 root root 98280 10월 31 2014 pdo.so
-rwxr-xr-x 1 root root 28808 10월 31 2014 pdo_mysql.so
-rwxr-xr-x 1 root root 24264 10월 31 2014 pdo_sqlite.so
-rwxr-xr-x 1 root root 253120 10월 31 2014 phar.so
-rwxr-xr-x 1 root root 82880 10월 31 2014 zip.so
[root@michel88 modules]#