어제와 똑같이 살면서 다른 미래를 기대하지 말자

[CentOS7] PHP 5.6.x to PHP 7.1 업그레이드 본문

IT관심분야/PHP

[CentOS7] PHP 5.6.x to PHP 7.1 업그레이드

플랜액터 2017. 1. 18. 10:21

1. 기존 PHP 삭제

# yum remove php-*


2. remi repo 설치

// CentOS 7

# yum install -y epel-release

or

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm


# rpm -ivh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

or

# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

// CentOS 6

# yum install -y epel-release

or

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm


# rpm -ivh http://rpms.remirepo.net/enterprise/remi-release-6.rpm

or

# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm


# yum --enablerepo=remi update remi-release


3. PHP 7.1 재설치

# yum --enablerepo=remi-php71 install php php-common php-cli php-fpm php-mysqlnd php-gd php-mbstring php-mcrypt php-opcache php-pear php-xml php-xmlrpc php-embedded php-bcmath php-imap php-pdo php-pecl-imagick php-soap php-devel php-ldap php-intl php-pecl-apcu php-snmp php-tidy php-dba php-zip


4. php.ini 수정

# vi /etc/php.ini

; This directive determines whether or not PHP will recognize code between

; <? and ?> tags as PHP source which should be processed as such. It is

; generally recommended that <?php and ?> should be used and that this feature

; should be disabled, as enabling it may result in issues when generating XML

; documents, however this remains supported for backward compatibility reasons.

; Note that this directive does not control the <?= shorthand tag, which can be

; used regardless of this directive.

; Default Value: On

; Development Value: Off

; Production Value: Off

; http://php.net/short-open-tag

; short_open_tag = On

short_open_tag = On


; Maximum amount of memory a script may consume (128MB)

; http://php.net/memory-limit

; memory_limit = 128M

memory_limit = 256M

; Common Values:
;   E_ALL (Show all errors, warnings and notices including coding standards.)
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices)
;   E_ALL & ~E_NOTICE & ~E_STRICT  (Show all errors, except for notices and coding standards warnings.)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
; error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
error_reporting = E_ALL

; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; For production environments, we recommend logging errors rather than
; sending them to STDOUT.
; Possible Values:
;   Off = Do not display any errors
;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
;   On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
; display_errors = Off
display_errors = On

; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors. PHP's default behavior is to suppress those
; errors from clients. Turning the display of startup errors on can be useful in
; debugging configuration problems. We strongly recommend you
; set this to 'off' for production servers.
; Default Value: Off
; Development Value: On
; Production Value: Off
; http://php.net/display-startup-errors
; display_startup_errors = Off
display_startup_errors = On


; Maximum size of POST data that PHP will accept.

; Its value may be 0 to disable the limit. It is ignored if POST data reading

; is disabled through enable_post_data_reading.

; http://php.net/post-max-size

; post_max_size = 8M

post_max_size = 100M


; Maximum allowed size for uploaded files.

; http://php.net/upload-max-filesize

; upload_max_filesize = 2M

upload_max_filesize = 100M


; Maximum number of files that can be uploaded via a single request

; max_file_uploads = 20

max_file_uploads = 100



Comments