centos上php+nginx安装
yum update -y &&
yum -y install libjpeg-devel libpng-devel libmcrypt-devel pcre-devel gcc autoconf libtool automake make \
libxslt-devel gd-devel perl-ExtUtils-Embed bzip2-devel libcurl-devel openssl bzip2 openssl-devel bzip2 \
sqlite-devel oniguruma-devel freetype-devel libjpeg-turbo-devel libwebp-devel -y &&
wget http://am1.php.net/distributions/php-7.2.15.tar.bz2 &&
tar xjvf php-7.2.15.tar.bz2 &&
pushd php-7.2.15 &&
export PHP_OPENSSL_DIR=yes &&
./configure --prefix=/usr/local/fastphp --with-pdo-mysql --disable-fileinfo --with-freetype-dir --with-mysqli \
--with-zlib --with-libxml-dir --enable-inline-optimization --enable-mbstring --with-mhash --with-gd \
--enable-sockets --enable-zip --enable-ftp --with-bz2 --with-pear --enable-calendar --with-openssl= \
--with-curl --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-pcre-regex \
--with-jpeg-dir --enable-fpm --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype --enable-bcmath &&
make && make install &&
cp php.ini-production /usr/local/fastphp/lib/php.ini &&
popd &&
wget http://nginx.org/download/nginx-1.15.8.tar.gz &&
tar xzvf nginx-1.15.8.tar.gz &&
pushd nginx-1.15.8 &&
#CFLAGS="-fPIC"
./configure --prefix=/usr/local/nginx --with-stream --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_perl_module --with-http_realip_module --with-http_ssl_module --with-http_v2_module --with-http_xslt_module --with-http_flv_module --with-openssl= --with-stream_ssl_preread_module --with-stream_ssl_module --with-stream_realip_module &&
make && make install &&
popd &&
cp /usr/local/fastphp/etc/php-fpm.conf.default /usr/local/fastphp/etc/php-fpm.conf &&
cp /usr/local/fastphp/etc/php-fpm.d/www.conf.default /usr/local/fastphp/etc/php-fpm.d/www.conf &&
wget https://github.com/phpredis/phpredis/archive/4.2.0.tar.gz &&
tar xzvf 4.2.0.tar.gz &&
pushd phpredis-4.2.0 &&
/usr/local/fastphp/bin/phpize &&
./configure --with-php-config=/usr/local/fastphp/bin/php-config &&
make && make install &&
popd &&
firewall-cmd --zone=public --add-port=80/tcp --permanent &&
firewall-cmd --zone=public --add-port=443/tcp --permanent &&
firewall-cmd --reload
https://www.php.net/manual/zh/install.unix.nginx.php
debian 11
apt-get install -y zip unzip zlib1g-dev libpng-dev libjpeg62-turbo-dev libicu-dev libpng-dev libjpeg-dev libcurl4-gnutls-dev libbz2-dev libssl-dev libxml2-dev
ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib
ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
wget http://download-mirror.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz
tar xzvf freetype-2.7.1.tar.gz
./configure --prefix=/usr/local/freetype
make
make install
export PHP_OPENSSL_DIR=yes
./configure --prefix=/usr/local/fastphp --with-pdo-mysql --disable-fileinfo --with-freetype-dir=/usr/local/freetype --with-mysqli --with-zlib --with-libxml-dir --enable-inline-optimization --enable-mbstring --with-mhash --with-gd --enable-sockets --enable-zip --enable-ftp --with-bz2 --with-pear --enable-calendar --with-openssl= --with-curl --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-pcre-regex --with-jpeg-dir --enable-fpm --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype --enable-bcmath
make
make install
apt install libpcre3-dev libxslt-dev libgd-dev
ln -s /usr/lib/x86_64-linux-gnu/libperl.so.5.32 /usr/lib/libperl.so
wget http://nginx.org/download/nginx-1.15.8.tar.gz
tar xzvf nginx-1.15.8.tar.gz
cd nginx-1.15.8
./configure --prefix=/usr/local/nginx --with-stream --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_perl_module --with-http_realip_module --with-http_ssl_module --with-http_v2_module --with-http_xslt_module --with-http_flv_module --with-openssl= --with-stream_ssl_preread_module --with-stream_ssl_module --with-stream_realip_module
make
make install
cp /usr/local/fastphp/etc/php-fpm.conf.default /usr/local/fastphp/etc/php-fpm.conf
cp /usr/local/fastphp/etc/php-fpm.d/www.conf.default /usr/local/fastphp/etc/php-fpm.d/www.conf
groupadd nobody