PHP-7.0.33 소스설치
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/usr/local/mysql/tmp/socket/mysql.socket --with-gettext --with-mhash --with-gmp --with-gd --with-png-dir=/usr/local/lib --enable-gd-native-ttf --enable-bcmath --enable-exif --with-bz2 --enable-mbstring --enable-opcache --with-curl --with-imap=/usr/local/imap-2007f --with-imap-ssl --with-openssl --with-openssl-dir --enable-pcntl --enable-mbregex --enable-zip --with-kerberos --disable-debug --enable-soap --with-gdbm --enable-ftp --enable-calendar --enable-shmop --enable-inline-optimization --enable-sigchild --enable-sockets --enable-fpm --enable-maintainer-zts --enable-opcache --with-libdir=/lib --with-jpeg-dir=/usr --with-iconv=/usr/local/libiconv --with-zlib --with-mcrypt --with-libxml-dir --with-pcre-regex --with-pcre-dir
[zend_opcache]
;zend_extension=/usr/local/php/lib/php/extensions/no-debug-zts-20151012/opcache.so
zend_extension=/usr/local/src/APM_Setup/ioncube/ioncube_loader_lin_7.0_ts.so
zend_loader.enable = 1
zend_loader.disable_licensing=0
zend_loader.obfuscation_level_support=3
기본 개발tool 설치
yum -y install gcc gcc-c++ termcap libtermcap libtermcap-devel gdbm-devel zlib* libxml* freetype* libpng* libjpeg* curl-devel gd gd-devel libmcrypt libmcrypt-devel mhash mhash-devel libxml2 iconv unixODBC qpixman qpixman-devel dialog xorg-x11-devel gmp gmp-devel
ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib64
ln -s /usr/local/lib/libmcrypt.so.4 /usr/local/lib64/libmcrypt.so.4
ln -sf /usr/lib64/libldap.so /usr/lib/libldap.so
========================================================================
wget https://www.php.net/distributions/php-7.0.33.tar.gz
tar zxvf php-7.0.33.tar.gz
cd /usr/local/src/APM_Setup/php-7.0.33
========================================================================
========================================================================
mysql 오류 날때
--with-mysqli=/설치디렉토리/mysql/bin/mysql_config - 삭제
--enable-embedded-mysqli=shared --- + 추가
7.0 버전부터는
========================================================================
configure: error: Please reinstall the iconv library.
cd /usr/local/src/APM_Setup/
wget https://wnstjqdl.tistory.com/attachment/cfile29.uf@240AD75052B2A82B214370.gz
mv cfile29.uf@240AD75052B2A82B214370.gz libiconv-1.14.tar.gz
tar zxvf libiconv-1.14.tar.gz
cd /usr/local/src/APM_Setup/libiconv-1.14/
./configure --prefix=/usr/local/libiconv
make -j 8
make 오류시
In file included from progname.c:26:0:
./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)
make[2]: *** [progname.o] Error 1
make[2]: Leaving directory `/usr/src/libiconv-1.14/srclib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/libiconv-1.14/srclib'
make: *** [all] Error 2
vi /usr/local/src/APM_Setup/libiconv-1.14/srclib/stdio.h
:set nu해서 번호줄을 찾는다. 1010이라고하는데
/"gets is a security hole - use fgets instead" 이라고 쳐서 찾는다.
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
찾은 곳에 양 위 아래로 구문을 넣어준다.
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
#endif
그럼
========================================================================
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
#endif
========================================================================
이렇게 바뀐다 :wq 해서 나온후 바로 make 해준다
(절때!!! make clean 하지말것 그럼 넣어준 구문이 사라진다!!!)
make install (끝)
========================================================================
========================================================================
Error 1
configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation.
libc-client-devel
-->
cd /usr/local/src/APM_Setup/
wget https://www.mirrorservice.org/sites/ftp.cac.washington.edu/imap/imap-2007f.tar.gz
tar zxvf imap-2007f.tar.gz
cd /usr/local/src/APM_Setup/imap-2007f
mkdir /usr/local/imap-2007f/
mkdir /usr/local/imap-2007f/include/
mkdir /usr/local/imap-2007f/lib/
make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd EXTRACFLAGS=-fPIC IP=4
\cp -f /usr/local/src/APM_Setup/imap-2007f/c-client/*.h /usr/local/imap-2007f/include/
\cp -f /usr/local/src/APM_Setup/imap-2007f/c-client/*.c /usr/local/imap-2007f/lib/
\cp -f /usr/local/src/APM_Setup/imap-2007f/c-client/c-client.h /usr/local/imap-2007f/lib/libc-client.h
cd /usr/local/src/APM_Setup/imap-2007f
\cp -f c-client/*.h /usr/local/imap-2007f/include/
\cp -f c-client/*.c /usr/local/imap-2007f/lib/
\cp -f c-client/c-client.a /usr/local/imap-2007f/lib/libc-client.a
※ make중에 위와 같은 에러를 만날 수 있다. 이 경우 아래와 같이 조치해준다.
yum whatprovides '*/security/pam_appl.h' ← 무엇을 필요로 하는지 찾은 후 yum설치
ex)yum -y install pam-devel-1.1.8-12.el7_1.1.x86_64
다른버전이 나올 수 있다. 잘 확인하고 설치하도록
========================================================================
vi /usr/local/src/APM_Setup/php-7.0.33/ext/imap/php_imap.c
:855
/usr/local/src/APM_Setup/php-7.0.33/ext/imap/php_imap.c: In function ‘zm_startup_imap’:
/usr/local/src/APM_Setup/php-7.0.33/ext/imap/php_imap.c:855:13: error: ‘auth_gss’ undeclared (first use in this function)
auth_link(&auth_gss); /* link in the gss authenticator */
^
auth_log 이걸로 변경
/usr/local/src/APM_Setup/php-7.0.33/ext/imap/php_imap.c:855:13: note: each undeclared identifier is reported only once for each function it appears in
make: *** [ext/imap/php_imap.lo] 오류 1
cd /usr/local/src/APM_Setup/php-7.0.33/
다시 ./configure 옵션들 다쓴다. 그럼 정상적으로 완료
========================================================================
cp -arp /usr/local/src/APM_Setup/php-7.0.33/php.ini-production /usr/local/apache/conf/php.ini
PHP 설정 파일 수정
vi /usr/local/apache/conf/php.ini
post_max_size = 100M
upload_max_filesize = 100M
allow_url_fopen = Off
short_open_tag = On
=================================================================================
PHP 경로 설정
vi /etc/profile
APACHE_HOME=/usr/local/apache
MySQL_HOME=/usr/local/mysql
PHP_HOME=/usr/local/php
PATH=$PATH:$HOME/bin:$APACHE_HOME/bin:$MySQL_HOME/bin:$PHP_HOME/bin:
export APACHE_HOME PATH MySQL_HOME PHP_HOME
(빨강색 부분을 뒤에다 추가해준다)
source /etc/profile
========================================================================
/AddType 검색하면 <IfModule mime_module>
AddType application/x-httpd-php .php .html .htm .inc .pia
AddType application/x-httpd-php-source .phps
vi /usr/local/apache/htdocs/phpinfo.php
<?php
phpinfo();
?>
========================================================================
Zend Opache 동적 모듈 추가로 설정하기
cd /usr/local/src/APM_Setup/php-7.0.33/ext/opcache/
/usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
Zend Opache 모듈 소스설치 설정하기
cd /usr/local/src/APM_Setup/
wget http://pecl.php.net/get/ZendOpcache
mv ZendOpcache ZendOpcache.tar.gz
tar zxvf ZendOpcache.tar.gz
cd zendopcache-7.0.5
/usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
./configure --with-php-config=/usr/local/php/bin/php-config
make -j 8
make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
find / -name opcache.so
/usr/local/php/lib/php/extensions/no-debug-zts-20151012/opcache.so
========================================================================
맨하단에 추가
[zend_opcache]
zend_extension=/usr/local/php/lib/php/extensions/no-debug-zts-20151012/opcache.so
*설정값
opcache.enable=1
; Zend Opacache 활성화 여부 결정
opcache.enable_cli=1
; PHP CLI 버전에서 Zend Opcache 활성화 여부 결정
opcache.memory_consumption=64
;개인적으로 사용할 땐 64M 정도, 기본 값
opcache.interned_strings_buffer=4
;개인적으로 사용할 땐 4 정도, 기본 값
opcache.max_accelerated_files=4000
; opcache 해쉬 테이블에서 가질 수 있는 키 값의 최대 값(200~100000 사이에 값만 가질 수 있음)
opcache.max_wasted_percentage=5
;재시작이 스케줄 될 때까지 "wasted"최대 메모리 비율
opcache.use_cwd=1
;같은 이름을 가진 파일들 사이에서 가능한 충돌을 제거하게 됩니다.
opcache.validate_timestamps=1
; 비활성화 시, Opcache 를 수동으로 리셋해주거나, 파일시스템이 변한 것에 대해 효과를 얻기 위해서는 웹 서버를 재시
작 해야 함.
opcache.revalidate_freq=60
;php 소스 변경 확인 시간 60sec
Zend Opache 설정확인
/usr/local/php/bin/php -m | grep Zend
Zend OPcache
[Zend Modules]
Zend OPcache
/etc/init.d/apachectl restart
=================================================================================
'WEB&WAS > PHP' 카테고리의 다른 글
PHP-7.2.34 소스설치 (0) | 2020.09.28 |
---|---|
PHP-7.1.33 소스설치 (0) | 2020.09.28 |
PHP-5.6.40 소스설치 (0) | 2020.09.28 |
php-5.5.38 소스설치 (0) | 2020.09.28 |
php-5.4.45 소스설치 (0) | 2020.09.28 |