Php

php7 설치

techapi 2025. 3. 10. 13:40
반응형

### php 7 기준 ###

 

1. PHP 7 소스 설치

yum install httpd httpd-devel (httpd 없을 경우, 필요시)

 

 

2. 소스설치

 

2.1. 소스 다운로드

wget http://mirror.cogentco.com/pub/php/php-7.1.5.tar.gz

 

2.2. ldap lib (ldap 필요시)

ln -s /usr/lib64/libldap.so /usr/lib/libldap.so

ln -s /usr/lib64/libldap_r.so /usr/lib/libldap_r.so

 

2.3. 설치 시작

yum install openssl-devel libxml2-devel curl curl-devel libxml2-devel libjpeg-devel libpng-devel freetype-devel libicu libicu-devel gcc-c++ postgresql-devel libxslt-devel mysql-devel libtool pcre pcre-devel lua-devel sqlite-devel oniguruma-devel gmp-devel bzip2-devel readline-devel

 

1)

./configure \

  --prefix=/usr/local/php \

  --with-apxs2=/usr/bin/apxs \

--enable-mbstring \

--enable-ftp \

  --with-curl \

  --with-openssl \

  --with-xmlrpc \

  --enable-soap \

  --enable-zip \

  --with-gd \

  --with-jpeg-dir \

  --with-png-dir \

  --with-mysqli \

  --with-pgsql \

  --enable-embedded-mysqli \

  --with-freetype-dir \

  --with-ldap \

  --enable-intl \

  --with-xsl

 

2)

./configure \

--prefix=/usr/local/php \

--with-config-file-path=/etc \

--enable-fpm \

--enable-inline-optimization \

--disable-debug \

--disable-rpath \

--enable-shared  \

--enable-soap \

--with-libxml-dir \

--with-xmlrpc \

--with-openssl \

--with-mcrypt \

--with-mhash \

--with-pcre-regex \

--with-sqlite3 \

--with-zlib \

--enable-bcmath \

--with-iconv \

--with-bz2 \

--enable-calendar \

--with-curl \

--with-cdb \

--enable-dom \

--enable-exif \

--enable-fileinfo \

--enable-filter \

--with-pcre-dir \

--with-gd \

--with-openssl-dir \

--with-jpeg-dir \

--with-png-dir \

--with-zlib-dir  \

--with-freetype-dir \

--enable-gd-native-ttf \

--enable-gd-jis-conv \

--with-gettext \

--with-gmp \

--with-mhash \

--enable-json \

--enable-mbstring \

--enable-mbregex \

--enable-mbregex-backtrack \

--with-libmbfl \

--enable-pdo \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

--with-zlib-dir \

--with-pdo-sqlite \

--with-readline \

--enable-session \

--enable-shmop \

--enable-simplexml \

--enable-sockets  \

--enable-sysvmsg \

--enable-sysvsem \

--enable-sysvshm \

--enable-wddx \

--with-libxml-dir \

--with-xsl \

--enable-zip \

--enable-mysqlnd-compression-support \

--with-pear \

--enable-opcache

 

make clean

make

make install

 

 

cp php.ini-production /etc/php.ini

 

/etc/profile

PATH=$PATH:/usr/local/apache/bin:/usr/local/php/bin

 

source /etc/profile

 

2.4. httpd.conf 수정

/etc/httpd/conf/httpd.conf

LoadModule php7_module        /usr/lib64/httpd/modules/libphp7.so

AddType application/x-httpd-php  .php .html

DirectoryIndex index.php index.html

 

2.5. bash profile path 추가

vi ~/.bash_profile

PATH=$PATH:$HOME/bin:/data/mysql/mysql/bin:/usr/local/php/bin

source ~/.bash_profile

 

php -v

 

2.6. php.ini 환경 정보 수정

/etc/php.ini (심볼링 링크)

short_open_tag = On

error_reporting = E_ALL & ~E_NOTICE   ## Notice 로그 없애기

 

## ftp 사용시 php.ini 추가 ##

[ftp]

extension=ftp.so

 

 

반응형

'Php' 카테고리의 다른 글

AWS php7 설치  (0) 2025.03.10
php7-fpm 설치  (0) 2025.03.10