※ 현재 php는 소스로 설치되어있는 상태입니다.
php 모듈 확인은 아래 명령을 통해 현재 설치된 모듈을 확인할 수 있다.
/usr/local/php/bin/php -m
1. mysqli 설치
# cd /usr/local/src/php-5.6.25/ext/mysqli
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config \
--with-mysqli=/usr/local/mysql/bin/mysql_config
# make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
# vi /usr/local/apache/conf/php.ini
[extension]
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=mysqli.so
설치 시 오류 사항
/usr/local/src/php-5.6.25/ext/mysqli/mysqli_api.c:36:62:fatal error: /usr/local/php/ext/mysqlnd/mysql_float_to_double.h : 그런 파일이나 디렉터리가 없습니다.
해결 방법 : vi mysqli_api.c
# include “ext/mysqlnd/mysql_float_to_double.h” 이 부분을 찾아서
# include “/usr/local/src/php-5.6.25/ext/mysqlnd/mysql_float_to_double.h 로 바꿔줍니다.
2. imagick 설치
1) 필수 패키지 설치
# yum -y install ImageMagick ImageMagick-devel
2) 파일 다운로드 및 설치
# cd /usr/local/src
# wget http://pecl.php.net/get/imagick-3.4.3.tgz
# tar xvfz imagick-3.4.3.tgz
# cd imagick-3.4.3
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
# vi /usr/local/apache/conf/php.ini
[extension]
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=imagick.so
3. soap 설치
# cd /usr/local/src/php-5.6.25/ext/soap
# ./configure --enable-soap --with-php-config=/usr/local/php/bin/php-config
# make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
# vi /usr/local/apache/conf/php.ini
[extension]
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=soap.so
4. php-openssl 설치
# cd /usr/local/src/php-5.6.25/ext/openssl
# ls 했을 때 config.m4가 없을 경우
# cp config0.m4 config.m4
# /usr/local/php/bin/phpize
# ./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config
# make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
# vi /usr/local/apache/conf/php.ini
[extension]
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=openssl.so
5. intl 설치
# cd /usr/local/src/php-5.6.25/ext/intl
# /usr/local/php/bin/php/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --enable-intl
# make && make install
# vi /usr/local/apache/conf/php.ini
[extension]
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=intl.so
설치 시 오류사항
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
# yum install libicu-devel
6. ldap 설치
# cd /usr/local/src/php-5.6.25/ext/ldap
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --enable-ladp
# make && make install
# vi /usr/local/apache/conf/php.ini
[extension]
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=ldap.so
설치 시 오류사항
configure: error: Cannot find ldap.h
# yum install openldap-devel
configure: error: Cannot find ldap libraries in /usr/lib.
# cp -arp /usr/lib64/libldap* /usr/lib/
'LINUX > WEB' 카테고리의 다른 글
Ioncube 설치 (0) | 2019.05.27 |
---|---|
Cmake 소스설치 (0) | 2019.05.27 |
NGINX 소스설치 (0) | 2019.05.27 |
PHP 설치 시 에러사항 (1) | 2019.05.27 |
Apache + PHP 에러사항 (0) | 2019.05.27 |