CentOSにnginx+php7+php-fpmの環境構築操作コマンドメモ

2017年12月2日

#mkdir /data/php7/cft
#./configure –prefix=/data/php7/cft \
–with-curl \
–with-freetype-dir \
–with-gd \
–with-gettext \
–with-iconv-dir \
–with-kerberos \
–with-libdir=lib64 \
–with-libxml-dir \
–with-mysqli \
–with-openssl \
–with-pcre-regex \
–with-pdo-mysql \
–with-pdo-sqlite \
–with-pear \
–with-png-dir \
–with-xmlrpc \
–with-xsl \
–with-zlib \
–enable-fpm \
–enable-bcmath \
–enable-libxml \
–enable-inline-optimization \
–enable-gd-native-ttf \
–enable-mbregex \
–enable-mbstring \
–enable-opcache \
–enable-pcntl \
–enable-shmop \
–enable-soap \
–enable-sockets \
–enable-sysvsem \
–enable-xml \
–enable-zip \
–disable-fileinfo

依存パッケージをインストール
#yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel mysql pcre-devel

# yum -y install curl-devel
# yum -y install libxslt-devel

#make
#make install

設定ファイル
server {
listen 80;
server_name test.arkgame.com;
access_log /data/ctndata/logs/test.arkgame.com.access.log;
error_log /data/ctndata/logs/test.arkgame.com.error.log info;

root /data/php7/cft/www;
index index.html index.htm;
location ~ \.php$ {
root /data/php7/cft/www; #ディレクトリを指定
fastcgi_pass 127.0.0.1:6000;#php-fpmのデフォルトポート9000
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

Linux

Posted by arkgame