20190110 php nginx編譯安裝

2021-09-10 06:03:34 字數 3927 閱讀 3218

編譯安裝nginx

vi裡面在一般模式,dd可以截切;p複製;u撤銷;ctrl+u反撤銷;顯示行號:":set nu";定位到某一行:「:100」;

diff 檢視兩個檔案的差異的,如 diff 1.txt 2.txt

grep -i 忽略大小寫

編譯安裝步驟:1. ./configure;

2. make

3. make install

編譯引數:

yum install -y bzip2 openssl-devel libxml2-devel gcc  libcurl-devel libjpeg-turbo-devel libpng-devel freetype-devel

useradd -m -s /sbin/nologin php-fpm

cd php-7.3.0

編譯引數

./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm  --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl

make

make

install

./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm  --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/data/mysql/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl
編譯引數解釋
–prefix 制定安裝路徑

–with-config-file-path 配置檔案路徑

–enable-fpm 開啟fpm

–with-fpm-user 指定使用者

–with-fpm-group 指定組

–with-mysql 老版本用關聯mysql的方式

–with-mysqli 新版本用來關聯mysql

–with-pdo-mysql 同上

–with-mysql-sock

–with-libxml-dir

–with-gd

–with-jpeg-dir

–with-png-dir

–with-freetype-dir

–with-iconv-dir

–with-zlib-dir

–with-mcrypt

–enable-soap

–enable-gd-native-ttf

–enable-ftp

–enable-mbstring

–enable-exif

–with-pear

–with-curl

–with-openssl

配置檔案:
cd /usr/local/php-fpm/

cp ./etc/php-fpm.conf.default php-fpm.conf

cd /usr/local/src/php-7.3.0

cp php.ini-development (測試) /usr/local/php-fpm/etc/php.ini

cd /usr/local/php-fpm/etc/php-fpm.d/

cp www.conf.default www.conf

php.ini.production 生產環境用的ini

啟動指令碼:
cd /usr/local/src/php-7.3.0

cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

chkconfig --add php-fpm

chkconfig php-fpm on

chkconfig --level 3 php-fpm on

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

cp ./php-fpm/etc/php.fpm.d/www.conf.default ./www.conf

報錯解析

rror: [pool www] cannot get uid for user 『php-fpm』

解決:useradd php-fpm

錯誤8

configure: error: wrong mysql library version or lib not found

wget

tar jxvf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz

mv mysql-5.6.39-linux-glibc2.12-x86_64 /usr/local/mysql5.6

改編譯引數

./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql5.6 --with-mysqli=/usr/local/mysql5.6/bin/mysql_config --with-pdo-mysql=/usr/local/mysql5.6 --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl

官方文件:

www.nginx.org

stable穩定版

make && make install

arm編譯PHP,nginx及問題

arm編譯php,nginx 1 環境 php 5.5.30 nginx 1.0.15 使用環境 ubuntu 編譯環境 linux 64 centos7 2 安裝包版本 gcc linaro arm linux gnueabihf 4.9 2014.07 linux.tar.xz php 5.5....

mysql devel 編譯 mysql編譯安裝

防火牆 selinux systemctl stop firewalld systemctl disable firewalld vim etc selinux config selinux disabled yum install wget y wget o mariadb 10.2.29.tar...

mysql devel 編譯 mysql編譯安裝

cd usr local wget wget wget 帶boost的mysql原始碼安裝 1 安裝依賴包 yum y install make gcc c cmake bison devel ncurses devel bison perl perl devel perl perl devel 2...