ホームページ  >  記事  >  バックエンド開発  >  Nginx1.19 php8.0ソースコードのコンパイルとインストールの詳細説明

Nginx1.19 php8.0ソースコードのコンパイルとインストールの詳細説明

藏色散人
藏色散人転載
2021-03-31 17:10:582607ブラウズ

推奨学習: 「PHP8 チュートリアル

##centos7 以降のバージョンに備えてください

最初のステップ

nginx パッケージをダウンロードし、指定されたディレクトリに置きます。通常は mnt ディレクトリに置きます:

Downloadアドレス: nginx.org/ en/download.html

Nginx1.19 php8.0 源码编译安装

nginx 圧縮パッケージを解凍します

tar zxvf nginx-1.19.7.tar.gz
依存関係パッケージを準備します:

yum -y install zlib-devel pcre-devel openssl-devel
Prepare nginx ユーザー:

useradd -M -s /sbin/nologin nginx
ソースコードのコンパイルとインストール:

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_random_index_module --with-http_sub_module

make
make install
設定構成ファイル:

user  nginx;
サービス管理:

1. 構成構文の検出

/usr/local/nginx/sbin/nginx -t
2. サービスを開始します

/usr/local/nginx/sbin/nginx
3. サービスをリロードします

/usr/local/nginx/sbin/nginx -s reload
pkill -HUP nginx
4. サービスをシャットダウンします

/usr/local/nginx/sbin/nginx -s stop
pkill nginx
5. boot

vi /etc/rc.local/usr/local/nginx/sbin/nginx
から開始しますプロセス管理:

pstree |grep nginx
ps -ef |grep nginx
ps aux |grep nginx
ポート管理:

netstat -tunpl |grep nginx
クライアント テスト:(パブリック IP を入力)

http://192.168.2.1
nginx reload

[root@wml sbin]# pkill -HUP nginx

##php8.0 ソース コードのコンパイルとインストール1. php8 の依存関係をインストールします

yum -y install autoconf freetype gd libpng libpng-devel libjpeg libxml2 libxml2-devel zlib curl curl-devel net-snmp-devel libjpeg-devel php-ldap openldap-devel openldap-clients freetype-devel gmp-devel libzip libzip-devel sqlite-devel

2. php8 の依存関係パッケージをインストールします

1. ## を解凍します#

tar -zxvf oniguruma-6.9.4.tar.gz
2. ディレクトリの切り替え

cd oniguruma-6.9.4/
3 configureconfigure

./autogen.sh
4. コンパイル設定ファイルの生成

./configure --prefix=/usr
5. コンパイルしてインストール

make && make install
2. PHP8 メインパッケージのコンパイル

1. 解凍

tar xzf php-8.0.0.tar.gz

2. ディレクトリの切り替え

cd php-8.0.0/
3. コンパイル設定ファイルの生成

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --enable-mysqlnd --with-mysqli --with-pdo-mysql --enable-opcache --with-pcre-jit --enable-gd --with-jpeg --with-freetype --with-gettext --with-curl --with-openssl --enable-sockets --enable-mbstring --enable-xml --with-zip --with-zlib --with-snmp --with-mhash --enable-ftp --enable-bcmath --enable-soap --enable-shmop --enable-sysvsem --enable-pcntl --with-gmp
4. コンパイルしてインストール

make && make install

error コンパイルおよびインストール中にエラーが発生しました

解决办法 yum install automake

Nginx1.19 php8.0 源码编译安装

解决办法 执行 yum install libtool

Nginx1.19 php8.0 源码编译安装

解决办法 参考 下图

Nginx1.19 php8.0 源码编译安装

以上がNginx1.19 php8.0ソースコードのコンパイルとインストールの詳細説明の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事はlearnku.comで複製されています。侵害がある場合は、admin@php.cn までご連絡ください。