centos7インストールphp7.3のmysql5.6のnginx1.6

centos7インストールphp7.3のmysql5.6のnginx1.6


nginxのをインストールするための最初のステップ

yumをlrzszのzip解凍wgetのツリーのgitのdpkg PCRE PCRE-のdevelのopensslのopenssl-develののGD-develのはzlib-develのgccのEPELリリースインストール-y

wgetの-O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo&>を/ dev / null

yumをrepolist

yumをすべてきれいに

SED -iさん/ ^ SELINUX =。* $ / SELINUX =無効/ G 'の/ etc / selinuxを/ configに 

wgetのhttp://nginx.org/download/nginx-1.16.0.tar.gz

nginxの-タール-xf 1.16.0.tar.gz 

CDのnginxの-1.16.0

useraddの-s / sbinに/ nologinに-M nginxの

./configure --prefix =は/ usr / local / nginxの--with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-PCRE --with-http_gzip_static_module --with-http_dav_module --with-http_addition_module - -http_sub_module --with-http_flv_module --with-http_mp4_module

作る&& make installを

LN -svは/ usr / local / nginxの/ sbinに/ nginxのは/ usr / sbinに/ nginxの

nginxの 

SS -ntl

nginxの起動スクリプト

Vimの/etc/init.d/nginx

#!/ binに/ bashの


#1のchkconfig: - 99 2


#説明:nginxのサービス制御スクリプト


PROG = "は/ usr / local / nginxの/ sbinに/ nginxの"


PIDF = "は/ usr / local / nginxの/ログ/ nginx.pid"


場合は「$ 1」


        開始)


        $ PROG


        ;;


        やめる)


        殺す-3 $(猫$ PIDF)


        ;;


        再起動)


        $ 0停止&>を/ dev / null


        [$場合は?-ne 0]。その後、引き続き、Fiの


        $スタート0


        ;;


        リロード)


        殺す-1 $(猫$ PIDF)


        ;;


        *)

":$ 0 {リロード|停止| |再起動を開始} Userage" エコー


        1番出口


ESAC


終了0


chmodの+ X /etc/init.d/nginx 

chkconfigを--add nginxの

chkconfigを--list

nginxの上のchkconfig




第二段階のインストールphp7.3

yumをbzip2のbzip2でのdevelのlibcurl-devのlibcurlの-devのカール-develのpostgresqlの-のdevel libxsltの-develのインストール

yumを削除libzip

CDは/ usr / local / srcに

wgetのhttps://nih.at/libzip/libzip-1.2.0.tar.gz

libzip-1.2.0.tar.gz -xfタール

libzip-1.2.0 CD

./configureを

作る&& make installを


#コンフィギュレーション・ファイルへの検索パスを追加します。


エコー「は/ usr / local / lib64に


/ usr / local / libに


/ usr / libに


/usr/lib64'>>/etc/ld.so.conf


 次に、構成#を更新


ldconfigを-v


wgetのhttps://www.php.net/distributions/php-7.3.8.tar.gz

タール-xfのphp-7.3.8.tar.gz 

CDのPHP-7.3.8

./configure --prefix =は/ usr / local / PHP --sysconfdir =は/ usr / local / PHPの/ etc --with-CONFIG-ファイルパス=は/ usr / local / PHPの/ etc / --with-fpm-ユーザー= PHP-FPM --with-FPM基= PHP-FPM --enable-FPM --with-PDO-pgsqlの--with-ZLIB-DIR --with-FreeTypeの-DIR --enable-MBSTRING --with -libxml-DIR = / USR --enable-石鹸--enableカレンダー--withカール--with-GD --disable-RPATH --enable-インライン最適化--with-BZ2 --with-ZLIB - -enable-ソケット--enable-SYSVSEM --enable-SYSVSHM --enable-PCNTL --enable-mbregex --enable-EXIF --enable-bcmath --with-はmhash --enable-ZIP --with-pcre-正規表現--with-PDO-MySQLの--with-mysqliの--with-JPEG-DIR = / USR --with-PNG-DIR = / USR --with-OpenSSLの--with-LIBDIR = / LIB / x86_64の-Linuxの-gnu / --enable-FTP --with-gettextの--with-XSL --enable-opcache --with-iconvの--with-XPM-DIR = / USR-XMLRPC --with

作る&& make installを

CP /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

作る&& make installを

cpはphp.iniの生産/usr/local/php/etc/php.ini

CP /usr/local/src/php-7.3.8/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

CP /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

CP /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf

chmodの755 /etc/init.d/php-fpm

chkconfigを--add PHP-FPM

上のchkconfigは、PHP-FPM

chkconfigを--list

LN -sは/ usr / local / PHP / binに/ PHPの/ usr / sbinに/ PHP

PHP -v

サービスPHP-FPM開始


PHPの最適化

コメント文字:新しいバージョンが完全に使用されています。注釈

#:ピュア注釈

;:コメントディレクティブを有効にするために使用することができます


vimの/usr/local/php/etc/php.ini

max_execution_timeに= 30の最大実行時間30秒

memory_limit 128M生産は大きな調整可能な、十分ではありません

display_errorsオフデバッグは、開いていない、または重要な情報にさらされる可能性が

提案閉鎖オフdisplay_startup_errors

post_max_sizeの8M最大アップロードデータのサイズは、生産は、以下の項目よりも大きい、一時的な転送大きくてもよいです

2M最大アップロードファイルをupload_max_filesizeで、あなたは大規模な生産を転送することもできます

max_file_uploads =同時アップロードファイルの最大数20

date.timezoneで=アジア/上海エリアが指定された場合

などのオープンショートタグにはshort_open_tag = <するphpinfo();?>



第3のステップはmysql5.6をインストールすることです

wgetのhttp://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

 RPM -ivh MySQLのコミュニティ・リリースel7-5.noarch.rpm

 YUMのMySQLサーバをインストールします

 ます。rpm -qa | grepのmysqlの

 mysqld.serviceを開始systemctl 

 SS -ntl

 mysqldを有効ystemctl

 

パスワードを設定します。


インストールが完了したらMysql5.6、それは我々は、タイムリーに必要とルートMySQLの(最初の直接、パスワードを入力しない)、および変更、パスワードでログインし、rootのパスワードは、デフォルトでは空になっています。


#mysqlの-uルート

MySQLの>使用mysqlの。

MySQLの>更新ユーザ設定パスワード= PASSWORD( "ここでrootのパスワードを入力してください")ユーザー= 'ルート';

MySQLの>フラッシュ権限; 


リモートログインの設定

MySQLの>上のすべての権限を付与* * 'ユーザー名' @ '%' 'をパスワードBY' IDENTIFIED TO。














おすすめ

転載: blog.51cto.com/13293070/2433215