コンパイルとインストールの環境
ホストは
172.25.23.6 hostname:server6.com
カーネルバージョン:2.6.32-431.el6.x86_64
パッケージをphp-5.6.20.tar.bz2
として使用します 追加パッケージ:
libmcrypt-2.5.8-9.el6.x86_64.rpm
libmcrypt-devel-2.5.8-9.el6.x86_64.rpm
./configure
の実行中にエラーが発生しました./configure
中的错误错误:
configure: error: xml2-config not found. Please check your libxml2 installation.
解决:
[root@server6 php-5.6.20]# yum install -y libxml2-devel
错误:
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
解决
[root@server6 php-5.6.20]# yum install curl-devel -y
错误:
If configure fails try --with-vpx-dir=<DIR> configure: error: jpeglib.h not found.
解决
[root@server6 php-5.6.20]# yum install -y libjpeg-turbo-devel
错误:
If configure fails try --with-vpx-dir=<DIR>checking for jpeg_read_header in -ljpeg... yes configure: error: png.h not found.
解决
[root@server6 php-5.6.20]# yum install libpng-devel -y
错误:
If configure fails try --with-xpm-dir=<DIR>configure: error: freetype-config not found.
解决
[root@server6 php-5.6.20]# yum install freetype-devel-2.3.11-14.el6_3.1.x86_64 -y
错误:
configure: error: Unable to locate gmp.h
解决
[root@server6 php-5.6.20]# yum install gmp-devel-4.3.1-7.el6_2.2.x86_64 -y
错误:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决
libmcrypt-2.5.8-9.el6.x86_64.rpmlibmcrypt-devel-2.5.8-9.el6.x86_64.rpm[root@server6 php-5.6.20]# yum install ~/libmcrypt-* -y
错误:
configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.
解决
[root@server6 php-5.6.20]# yum install net-snmp-devel -y
进行编译
[root@server6 php-5.6.20]# ./configure --prefix=/usr/local/lnmp/php/ \> --with-config-file-path=/usr/local/lnmp/php/etc \> --with-openssl \> --with-snmp \> --with-gd \> --with-zlib \> --with-curl \> --with-libxml-dir \> --with-png-dir \> --with-jpeg-dir \> --with-freetype-dir \> --with-gettext \> --without-pear \> --with-gmp \> --enable-inline-optimization \> --enable-soap \> --enable-ftp \> --enable-sockets> --enable-mbstring> --with-mysql> --with-mysqli> --with-pdo-mysql> --enable-mysqlnd> --enable-fpm> --with-fpm-user=nginx> --with-fpm-group=nginx> --with-mcrypt > --with-mhash
执行完成需要出现
之后执行
make
命令
[root@server6 php-5.6.20]# make No log handling enabled - turning on stderr logging Created directory: /var/lib/net-snmp/mib_indexes Generating phar.phar PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled. clicommand.inc directorytreeiterator.inc invertedregexiterator.inc directorygraphiterator.inc pharcommand.inc phar.inc
确保结果争取需要出现
之后执行
make install
[root@server6 php-5.6.20]# make installInstalling shared extensions: /usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20131226/Installing PHP CLI binary: /usr/local/lnmp/php/bin/Installing PHP CLI man page: /usr/local/lnmp/php/php/man/man1/Installing PHP FPM binary: /usr/local/lnmp/php/sbin/
需要出现
对于配置文件进行修改
[root@server6 php-5.6.20]# cd /usr/local/lnmp/php/[root@server6 php]# cd etc/[root@server6 etc]# cp php-fpm.conf.default php-fpm.conf[[root@server6 etc]# cp ~/php-5.6.20/php.ini-production /usr/local/lnmp/php/etc/php.ini
修改,前面的数值表示行号
[root@server6 etc]# vim php.ini925 date.timezone = Asia/Shanghai1001 pdo_mysql.default_socket= /usr/local/lnmp/mysql/data/mysql.sock1150 mysql.default_socket = /usr/local/lnmp/mysql/data/mysql.sock1209 mysqli.default_socket = /usr/local/lnmp/mysql/data/mysql.sock [root@server6 etc]# vim php-fpm.conf25 pid = run/php-fpm.pid
复制启动脚本
[root@server6 php-5.6.20]# cd sapi/fpm/[root@server6 fpm]# pwd/root/php-5.6.20/sapi/fpm [root@server6 fpm]# cp init.d.php-fpm /etc/init.d/php-fpm[root@server6 fpm]# chmod +x /etc/init.d/php-fpm
启动服务并且查看状态
[root@server6 fpm]# /etc/init.d/php-fpm startStarting php-fpm done
修改
Nginx
的配置文件
[root@server6 fpm]# cd /usr/local/lnmp/nginx/conf/[root@server6 conf]# vim nginx.conf location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi.conf; }
测试修改后配置文件的正确性
[root@server6 conf]# nginx -tnginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful [root@server6 conf]# nginx
* 查看你服务是否正常启动
* 为php
提供默认的页面
[root@server6 nginx]# cd html/[root@server6 html]# ls50x.html index.html [root@server6 html]# vim index.php<?php phpinfo() ?>
通过浏览器来访问测试
安装
Discuz
论坛程序
[root@server6 ~]# unzip Discuz_X3.2_SC_UTF8.zip -d /usr/local/lnmp/nginx/html/[root@server6 ~]# cd /usr/local/lnmp/nginx/html/[root@server6 html]# mv upload/ bbs[root@server6 html]# cd bbs/[root@server6 bbs]# chmod 777 config/ data/ uc_client/ uc_server/ -R
通过浏览器进行配置
Discuz
的欢迎页面需要确保这个页面没有红色的
x
出现数据库连接成功的安装页面
通过下面这个连接访问
去查看数据库多出来的信息
ultrax
为Discuz

configure: error: xml2-config not found. Please check your libxml2 installation.🎜🎜🎜解決策:🎜
[root@server6 php-5.6.20]# yum install -y libxml2-devel🎜🎜🎜エラー:🎜
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/🎜🎜🎜解決策🎜
[root@server6 php-5.6.20]# yum install curl-devel -y🎜 🎜 🎜エラー:🎜
If configure fails try --with-vpx-dir=<DIR> configure: error: jpeglib.h not found.🎜🎜🎜解決しました🎜
[root@server6 php-5.6.20]# yum install -y libjpeg-turbo-devel🎜🎜🎜エラー:🎜
If configure fails try --with-vpx-dir=<DIR>checking for jpeg_read_header in -ljpeg... yes configure: error: png.h not found.🎜🎜🎜解決しました🎜
[root@server6 php-5.6.20]# yum install libpng-devel -y🎜 li>
If configure fails try --with-xpm-dir=<DIR>configure: error: freetype-config not found.🎜🎜🎜エラー:🎜
[root@server6 php-5.6.20]# yum install freetype-devel-2.3.11-14.el6_3.1.x86_64 -y🎜🎜🎜解決策🎜
configure: error: Unable to locate gmp.h🎜🎜🎜エラー:🎜
[root@server6 php-5.6.20]# yum install gmp-devel-4.3.1-7.el6_2.2.x86_64 -y🎜🎜🎜解決しました🎜
configure: error: mcrypt.h not found. Please reinstall libmcrypt.🎜🎜🎜エラー:🎜
libmcrypt-2.5.8-9.el6.x86_64.rpmlibmcrypt-devel-2.5.8-9.el6.x86_64.rpm[root@server6 php-5.6.20]# yum install ~/libmcrypt-* -y🎜🎜🎜解決しました🎜
configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.🎜🎜🎜エラー:🎜
[root@server6 php-5.6.20]# yum install net-snmp-devel -y🎜🎜🎜解決🎜
[root@server6 php-5.6.20]# ./configure --prefix=/usr/local/lnmp/php/ \> --with-config-file-path=/usr/local/lnmp/php/etc \> --with-openssl \> --with-snmp \> --with-gd \> --with-zlib \> --with-curl \> --with-libxml-dir \> --with-png-dir \> --with-jpeg-dir \> --with-freetype-dir \> --with-gettext \> --without-pear \> --with-gmp \> --enable-inline-optimization \> --enable-soap \> --enable-ftp \> --enable-sockets> --enable-mbstring> --with-mysql> --with-mysqli> --with-pdo-mysql> --enable-mysqlnd> --enable-fpm> --with-fpm-user=nginx> --with-fpm-group=nginx> --with-mcrypt > --with-mhash🎜🎜🎜🎜コンパイル🎜🎜
[root@server6 php-5.6.20]# make No log handling enabled - turning on stderr logging Created directory: /var/lib/net-snmp/mib_indexes Generating phar.phar PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled. clicommand.inc directorytreeiterator.inc invertedregexiterator.inc directorygraphiterator.inc pharcommand.inc phar.inc🎜🎜🎜必要実行完了時に表示されます🎜

make
コマンドを実行します🎜[root@server6 php-5.6.20]# make installInstalling shared extensions: /usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20131226/Installing PHP CLI binary: /usr/local/lnmp/php/bin/Installing PHP CLI man page: /usr/local/lnmp/php/php/man/man1/Installing PHP FPM binary: /usr/local/lnmp/php/sbin/🎜🎜🎜必要に応じて結果が表示されることを確認します🎜

を実行しますmake install
🎜 ul>[root@server6 php-5.6.20]# cd /usr/local/lnmp/php/[root@server6 php]# cd etc/[root@server6 etc]# cp php-fpm.conf.default php-fpm.conf[[root@server6 etc]# cp ~/php-5.6.20/php.ini-production /usr/local/lnmp/php/etc/php.ini🎜🎜🎜 が表示される必要があります🎜

[root@server6 etc]# vim php.ini925 date.timezone = Asia/Shanghai1001 pdo_mysql.default_socket= /usr/local/lnmp/mysql/data/mysql.sock1150 mysql.default_socket = /usr/local/lnmp/mysql/data/mysql.sock1209 mysqli.default_socket = /usr/local/lnmp/mysql/data/mysql.sock [root@server6 etc]# vim php-fpm.conf25 pid = run/php-fpm.pid🎜🎜🎜変更、前の値は行を表します番号🎜
[root@server6 php-5.6.20]# cd sapi/fpm/[root@server6 fpm]# pwd/root/php-5.6.20/sapi/fpm [root@server6 fpm]# cp init.d.php-fpm /etc/init.d/php-fpm[root@server6 fpm]# chmod +x /etc/init.d/php-fpm🎜🎜🎜 起動スクリプトをコピーします🎜
[root@server6 fpm]# /etc/init.d/php-fpm startStarting php-fpm done🎜🎜🎜サービスを起動してステータスを確認します🎜
[root@server6 fpm]# cd /usr/local/lnmp/nginx/conf/[root@server6 conf]# vim nginx.conf location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi.conf; }🎜🎜🎜🎜🎜
Nginx
の設定ファイル🎜 ul>[root@server6 conf]# nginx -tnginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful [root@server6 conf]# nginx🎜🎜🎜変更された設定ファイルの正確性をテストします🎜
[root@server6 nginx]# cd html/[root@server6 html]# ls50x.html index.html [root@server6 html]# vim index.php<?php phpinfo() ?>🎜


[root@server6 ~]# unzip Discuz_X3.2_SC_UTF8.zip -d /usr/local/lnmp/nginx/html/[root@server6 ~]# cd /usr/local/lnmp/nginx/html/[root@server6 html]# mv upload/ bbs[root@server6 html]# cd bbs/[root@server6 bbs]# chmod 777 config/ data/ uc_client/ uc_server/ -R🎜🎜🎜ブラウザからテストにアクセスします🎜🎜

Discuz
フォーラム プログラムをインストールしてください🎜rrreee🎜 🎜🎜🎜ブラウザ経由で設定します🎜🎜🎜🎜Discuz
のウェルカムページ🎜
x
が表示されていないことを確認する必要があります🎜

- 🎜🎜以下のリンクからアクセスしてください🎜
データベース内のテーブルの情報

ultrax
は、作成されたデータベース 🎜🎜🎜 です。NginxとMysqlのコンパイルとインストールについて
http://blog.csdn.net/qq_36294875/article/detail s /79352522[MySQL5.7.11 のコンパイルとインストール]
http://blog.csdn.net/qq_36294875/article/details/79344943
[Nginx のコンパイル、インストール、簡単な構成]
[MySQL5.7.11编译安装]
http://blog.csdn.net/qq_36294875/article/details/79344943[Nginx的编译安装以及简单的配置]
编译安装的环境
主机为
172.25.23.6 hostname:server6.com
2.6.32-431.el6.x86_64
php-5.6.20.tar.bz2
コンパイルとインストール環境
- ホストは
172.25.23.6 hostname:server6.com
ですカーネルバージョン:
./configure
中的错误 错误:
configure: error: xml2-config not found. Please check your libxml2 installation.
解决:
[root@server6 php-5.6.20]# yum install -y libxml2-devel
错误:
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
解决
[root@server6 php-5.6.20]# yum install curl-devel -y
错误:
If configure fails try --with-vpx-dir=<DIR> configure: error: jpeglib.h not found.
解决
[root@server6 php-5.6.20]# yum install -y libjpeg-turbo-devel
错误:
If configure fails try --with-vpx-dir=<DIR>checking for jpeg_read_header in -ljpeg... yes configure: error: png.h not found.
解决
[root@server6 php-5.6.20]# yum install libpng-devel -y
错误:
If configure fails try --with-xpm-dir=<DIR>configure: error: freetype-config not found.
解决
[root@server6 php-5.6.20]# yum install freetype-devel-2.3.11-14.el6_3.1.x86_64 -y
错误:
configure: error: Unable to locate gmp.h
解决
[root@server6 php-5.6.20]# yum install gmp-devel-4.3.1-7.el6_2.2.x86_64 -y
错误:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决
libmcrypt-2.5.8-9.el6.x86_64.rpmlibmcrypt-devel-2.5.8-9.el6.x86_64.rpm[root@server6 php-5.6.20]# yum install ~/libmcrypt-* -y
错误:
configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.
解决
[root@server6 php-5.6.20]# yum install net-snmp-devel -y
进行编译
[root@server6 php-5.6.20]# ./configure --prefix=/usr/local/lnmp/php/ \> --with-config-file-path=/usr/local/lnmp/php/etc \> --with-openssl \> --with-snmp \> --with-gd \> --with-zlib \> --with-curl \> --with-libxml-dir \> --with-png-dir \> --with-jpeg-dir \> --with-freetype-dir \> --with-gettext \> --without-pear \> --with-gmp \> --enable-inline-optimization \> --enable-soap \> --enable-ftp \> --enable-sockets> --enable-mbstring> --with-mysql> --with-mysqli> --with-pdo-mysql> --enable-mysqlnd> --enable-fpm> --with-fpm-user=nginx> --with-fpm-group=nginx> --with-mcrypt > --with-mhash
执行完成需要出现
之后执行
make
命令
[root@server6 php-5.6.20]# make No log handling enabled - turning on stderr logging Created directory: /var/lib/net-snmp/mib_indexes Generating phar.phar PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled. clicommand.inc directorytreeiterator.inc invertedregexiterator.inc directorygraphiterator.inc pharcommand.inc phar.inc
确保结果争取需要出现
之后执行
make install
[root@server6 php-5.6.20]# make installInstalling shared extensions: /usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20131226/Installing PHP CLI binary: /usr/local/lnmp/php/bin/Installing PHP CLI man page: /usr/local/lnmp/php/php/man/man1/Installing PHP FPM binary: /usr/local/lnmp/php/sbin/
需要出现
对于配置文件进行修改
[root@server6 php-5.6.20]# cd /usr/local/lnmp/php/[root@server6 php]# cd etc/[root@server6 etc]# cp php-fpm.conf.default php-fpm.conf[[root@server6 etc]# cp ~/php-5.6.20/php.ini-production /usr/local/lnmp/php/etc/php.ini
修改,前面的数值表示行号
[root@server6 etc]# vim php.ini925 date.timezone = Asia/Shanghai1001 pdo_mysql.default_socket= /usr/local/lnmp/mysql/data/mysql.sock1150 mysql.default_socket = /usr/local/lnmp/mysql/data/mysql.sock1209 mysqli.default_socket = /usr/local/lnmp/mysql/data/mysql.sock [root@server6 etc]# vim php-fpm.conf25 pid = run/php-fpm.pid
复制启动脚本
[root@server6 php-5.6.20]# cd sapi/fpm/[root@server6 fpm]# pwd/root/php-5.6.20/sapi/fpm [root@server6 fpm]# cp init.d.php-fpm /etc/init.d/php-fpm[root@server6 fpm]# chmod +x /etc/init.d/php-fpm
启动服务并且查看状态
[root@server6 fpm]# /etc/init.d/php-fpm startStarting php-fpm done
修改
Nginx
的配置文件
[root@server6 fpm]# cd /usr/local/lnmp/nginx/conf/[root@server6 conf]# vim nginx.conf location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi.conf; }
测试修改后配置文件的正确性
[root@server6 conf]# nginx -tnginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful [root@server6 conf]# nginx
* 查看你服务是否正常启动
* 为php
提供默认的页面
[root@server6 nginx]# cd html/[root@server6 html]# ls50x.html index.html [root@server6 html]# vim index.php<?php phpinfo() ?>
通过浏览器来访问测试
安装
Discuz
论坛程序
[root@server6 ~]# unzip Discuz_X3.2_SC_UTF8.zip -d /usr/local/lnmp/nginx/html/[root@server6 ~]# cd /usr/local/lnmp/nginx/html/[root@server6 html]# mv upload/ bbs[root@server6 html]# cd bbs/[root@server6 bbs]# chmod 777 config/ data/ uc_client/ uc_server/ -R
通过浏览器进行配置
Discuz
的欢迎页面-
需要确保这个页面没有红色的
libmcrypt-2.5.8-9.el6.x86_64.rpm 🎜 libmcrypt-devel-2.5.8-9.el6.x86_64.rpm🎜🎜🎜🎜🎜🎜x
パッケージを
として使用します 追加パッケージ:
./configure
の実行中にエラーが発生しました🎜🎜🎜🎜🎜エラー:🎜🎜🎜configure: error: xml2-config not found. Please check your libxml2 installation.
🎜🎜🎜解決策) 🎜🎜[root@server6 php-5.6.20]# yum install -y libxml2-devel
🎜🎜🎜エラー:🎜🎜🎜configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
🎜🎜🎜解決済み🎜🎜🎜[root@server6 php-5.6.20]# yum install curl-devel -y
🎜🎜🎜エラー:🎜🎜🎜If configure fails try --with-vpx-dir=<DIR> configure: error: jpeglib.h not found.
🎜🎜🎜解決済み🎜 🎜🎜[root@server6 php-5.6.20]# yum install -y libjpeg-turbo-devel
🎜🎜🎜エラー:🎜🎜🎜If configure fails try --with-vpx-dir=<DIR>checking for jpeg_read_header in -ljpeg... yes configure: error: png.h not found.
🎜🎜🎜解決しました🎜🎜🎜[root@server6 php-5.6.20]# yum install libpng-devel -y
🎜🎜🎜エラー:🎜🎜🎜If configure fails try --with-xpm-dir=<DIR>configure: error: freetype-config not found.
🎜 🎜🎜解決済み🎜🎜🎜[root@server6 php-5.6.20]# yum install freetype-devel-2.3.11-14.el6_3.1.x86_64 -y
🎜🎜🎜エラー:🎜🎜🎜configure: error: Unable to locate gmp.h
🎜🎜🎜解決済み🎜🎜🎜[root@server6 php-5.6.20]# yum install gmp-devel-4.3.1-7.el6_2.2.x86_64 -y
🎜🎜🎜🎜コンパイル🎜🎜🎜🎜configure: error: mcrypt.h not found. Please reinstall libmcrypt.
🎜 🎜 🎜実行完了時に表示する必要があります🎜🎜🎜🎜🎜 の後に
make code> コマンドを実行します🎜🎜🎜<pre class='brush:php;toolbar:false;'>libmcrypt-2.5.8-9.el6.x86_64.rpmlibmcrypt-devel-2.5.8-9.el6.x86_64.rpm[root@server6 php-5.6.20]# yum install ~/libmcrypt-* -y</pre>🎜🎜🎜 必要に応じて結果が表示されることを確認してください🎜<img src="https://img.php.cn/%20Upload/article/000/054/025/6fa68aca5885122900772bc2364c5594-1.png?x-oss-process=image/resize,p_40" alt="LNMP のコンパイルと PHP のインストール、および LNMP の設定と検証サンプルの共有" title="">🎜🎜🎜🎜 そして、<code>make install
を実行してください🎜🎜🎜configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.
🎜🎜🎜 を表示する必要があります🎜🎜🎜🎜🎜設定ファイルを変更します🎜🎜🎜
[root@server6 php-5.6.20]# yum install net-snmp-devel -y
🎜🎜🎜変更、前 値は行番号を表します🎜🎜🎜[root@server6 php-5.6.20]# ./configure --prefix=/usr/local/lnmp/php/ \> --with-config-file-path=/usr/local/lnmp/php/etc \> --with-openssl \> --with-snmp \> --with-gd \> --with-zlib \> --with-curl \> --with-libxml-dir \> --with-png-dir \> --with-jpeg-dir \> --with-freetype-dir \> --with-gettext \> --without-pear \> --with-gmp \> --enable-inline-optimization \> --enable-soap \> --enable-ftp \> --enable-sockets> --enable-mbstring> --with-mysql> --with-mysqli> --with-pdo-mysql> --enable-mysqlnd> --enable-fpm> --with-fpm-user=nginx> --with-fpm-group=nginx> --with-mcrypt > --with-mhash
🎜🎜🎜起動スクリプトをコピーします🎜🎜🎜[root@server6 php-5.6.20]# make No log handling enabled - turning on stderr logging Created directory: /var/lib/net-snmp/mib_indexes Generating phar.phar PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled. clicommand.inc directorytreeiterator.inc invertedregexiterator.inc directorygraphiterator.inc pharcommand.inc phar.inc
🎜🎜🎜サービスをチェックしてくださいステータス🎜🎜🎜[root@server6 php-5.6.20]# make installInstalling shared extensions: /usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20131226/Installing PHP CLI binary: /usr/local/lnmp/php/bin/Installing PHP CLI man page: /usr/local/lnmp/php/php/man/man1/Installing PHP FPM binary: /usr/local/lnmp/php/sbin/
🎜🎜🎜🎜🎜
Nginx
の設定ファイルを変更します🎜🎜🎜[root@server6 php-5.6.20]# cd /usr/local/lnmp/php/[root@server6 php]# cd etc/[root@server6 etc]# cp php-fpm.conf.default php-fpm.conf[[root@server6 etc]# cp ~/php-5.6.20/php.ini-production /usr/local/lnmp/php/etc/php.ini
🎜🎜🎜 変更した設定ファイルの正確性をテストします🎜🎜🎜[root@server6 etc]# vim php.ini925 date.timezone = Asia/Shanghai1001 pdo_mysql.default_socket= /usr/local/lnmp/mysql/data/mysql.sock1150 mysql.default_socket = /usr/local/lnmp/mysql/data/mysql.sock1209 mysqli.default_socket = /usr/local/lnmp/mysql/data/mysql.sock [root@server6 etc]# vim php-fpm.conf25 pid = run/php-fpm.pid
🎜🎜* サービスが正常に起動するか確認してください🎜
🎜*
php🎜<pre class='brush:php;toolbar:false;'>[root@server6 php-5.6.20]# cd sapi/fpm/[root@server6 fpm]# pwd/root/php-5.6.20/sapi/fpm [root@server6 fpm]# cp init.d.php-fpm /etc/init.d/php-fpm[root@server6 fpm]# chmod +x /etc/init.d/php-fpm</pre>🎜🎜🎜ブラウザからテストにアクセスします🎜🎜🎜🎜<img src="https:/%20/img.php.cn/upload/article/000/054/025/c039c15a4874dd7fd1f503fa42fcca35-6.png" alt="LNMP のコンパイルと PHP のインストール、および LNMP の設定と検証サンプルの共有" title="">🎜🎜🎜🎜 <code>Discuz
をインストールします フォーラム プログラム 🎜🎜🎜[root@server6 fpm]# /etc/init.d/php-fpm startStarting php-fpm done
🎜🎜🎜🎜 はブラウザを通して設定されます🎜🎜🎜🎜🎜Discuz
のウェルカム ページ🎜🎜🎜🎜🎜このページに赤い
x
がないことを確認する必要があります🎜🎜🎜 データベース接続が成功したインストールページ
次の接続を通じて
にアクセスして、データベース内の追加情報を表示します
-
ultrax
为Discuz
データベースが作成されました。 - データベース内のテーブル情報
CentOS7上でPHP7をコンパイルしてインストールするサンプルコードを詳しく紹介(写真)
Linux+php+apache+oracle環境構築CentOS での PHP のソース コードのコンパイルとインストール
以上がLNMP のコンパイルと PHP のインストール、および LNMP の設定と検証サンプルの共有の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

PHPSESSIONの障害の理由には、構成エラー、Cookieの問題、セッションの有効期限が含まれます。 1。構成エラー:正しいセッションをチェックして設定します。save_path。 2.Cookieの問題:Cookieが正しく設定されていることを確認してください。 3.セッションの有効期限:セッションを調整してください。GC_MAXLIFETIME値はセッション時間を延長します。

PHPでセッションの問題をデバッグする方法は次のとおりです。1。セッションが正しく開始されるかどうかを確認します。 2.セッションIDの配信を確認します。 3.セッションデータのストレージと読み取りを確認します。 4.サーバーの構成を確認します。セッションIDとデータを出力し、セッションファイルのコンテンツを表示するなど、セッション関連の問題を効果的に診断して解決できます。

session_start()への複数の呼び出しにより、警告メッセージと可能なデータ上書きが行われます。 1)PHPは警告を発し、セッションが開始されたことを促します。 2)セッションデータの予期しない上書きを引き起こす可能性があります。 3)session_status()を使用してセッションステータスを確認して、繰り返しの呼び出しを避けます。

PHPでのセッションライフサイクルの構成は、session.gc_maxlifetimeとsession.cookie_lifetimeを設定することで達成できます。 1)session.gc_maxlifetimeサーバー側のセッションデータのサバイバル時間を制御します。 0に設定すると、ブラウザが閉じているとCookieが期限切れになります。

データベースストレージセッションを使用することの主な利点には、持続性、スケーラビリティ、セキュリティが含まれます。 1。永続性:サーバーが再起動しても、セッションデータは変更されないままになります。 2。スケーラビリティ:分散システムに適用され、セッションデータが複数のサーバー間で同期されるようにします。 3。セキュリティ:データベースは、機密情報を保護するための暗号化されたストレージを提供します。

PHPでのカスタムセッション処理の実装は、SessionHandlerInterfaceインターフェイスを実装することで実行できます。具体的な手順には、次のものが含まれます。1)CussentsessionHandlerなどのSessionHandlerInterfaceを実装するクラスの作成。 2)セッションデータのライフサイクルとストレージ方法を定義するためのインターフェイス(オープン、クローズ、読み取り、書き込み、破壊、GCなど)の書き換え方法。 3)PHPスクリプトでカスタムセッションプロセッサを登録し、セッションを開始します。これにより、データをMySQLやRedisなどのメディアに保存して、パフォーマンス、セキュリティ、スケーラビリティを改善できます。

SessionIDは、ユーザーセッションのステータスを追跡するためにWebアプリケーションで使用されるメカニズムです。 1.ユーザーとサーバー間の複数のインタラクション中にユーザーのID情報を維持するために使用されるランダムに生成された文字列です。 2。サーバーは、ユーザーの複数のリクエストでこれらの要求を識別および関連付けるのに役立つCookieまたはURLパラメーターを介してクライアントに生成および送信します。 3.生成は通常、ランダムアルゴリズムを使用して、一意性と予測不可能性を確保します。 4.実際の開発では、Redisなどのメモリ内データベースを使用してセッションデータを保存してパフォーマンスとセキュリティを改善できます。

APIなどのステートレス環境でのセッションの管理は、JWTまたはCookieを使用して達成できます。 1。JWTは、無国籍とスケーラビリティに適していますが、ビッグデータに関してはサイズが大きいです。 2.cookiesはより伝統的で実装が簡単ですが、セキュリティを確保するために慎重に構成する必要があります。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

mPDF
mPDF は、UTF-8 でエンコードされた HTML から PDF ファイルを生成できる PHP ライブラリです。オリジナルの作者である Ian Back は、Web サイトから「オンザフライ」で PDF ファイルを出力し、さまざまな言語を処理するために mPDF を作成しました。 HTML2FPDF などのオリジナルのスクリプトよりも遅く、Unicode フォントを使用すると生成されるファイルが大きくなりますが、CSS スタイルなどをサポートし、多くの機能強化が施されています。 RTL (アラビア語とヘブライ語) や CJK (中国語、日本語、韓国語) を含むほぼすべての言語をサポートします。ネストされたブロックレベル要素 (P、DIV など) をサポートします。

VSCode Windows 64 ビットのダウンロード
Microsoft によって発売された無料で強力な IDE エディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ZendStudio 13.5.1 Mac
強力な PHP 統合開発環境

ホットトピック









