2021-07-30 2 分钟 0.3 k0次访问
安装apache和php
安装apache和php的过程
环境配置
安装apr和apr-util
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
alias m4='make -j4&&make install -j4'
cd /apps/SourceCode
tar zxvf apr-1.7.0.tar.gz tar zxvf apr-util-1.6.1.tar.gz tar zxvf pcre-8.45.tar.gz cd apr-1.7.0 ./configure --prefix=/apps/Prefix/apr-1.7.0
m4 ln -s /apps/Prefix/apr-1.7.0 /apps/apr cd ../apr-util-1.6.1 ./configure --prefix=/apps/Prefix/apr-util-1.6.1 --with-apr=/apps/apr
m4 ln -s /apps/Prefix/apr-util-1.6.1 /apps/apr-util cd ../pcre-8.45 ./configure --prefix=/apps/Prefix/pcre-8.45 --with-apr=/apps/apr
m4 ln -s /apps/Prefix/pcre-8.45 /apps/pcre
|
apache2.4
1 2 3 4 5 6 7 8 9 10
| cd /apps/SourceCode
tar zxvf httpd-2.4.48.tar.gz cd httpd-2.4.48 ./configure --prefix=/apps/Prefix/httpd-2.4.48 --sysconfdir=/etc/httpd --with-apr=/apps/apr --with-apr-util=/apps/apr-util --with-pcre=/apps/pcre --enable-so
m4 ln -s /apps/Prefix/httpd-2.4.48 /apps/apache
|
php
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| yum install libxml2-devel sqlite-devel libwebp-devel libjpeg-devel libXpm-devel oniguruma-devel
cd /apps/SourceCode
tar zxvf php-7.4.20.tar.gz cd php-7.4.20 ./configure --prefix=/apps/Prefix/php-7.4.20 --with-config-file-path=/apps/php/etc/php. --enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --enable-fpm --with-mysql-sock=/tmp/mysql.sock --enable-mbstring --with-curl --enable-gd --with-webp --with-jpeg --with-xpm --with-zlib make -j4 make install -j4
ln -s /apps/Prefix/php-7.4.20 /apps/php
cp php.ini-development /apps/php/etc/php.ini
|
php在httpd.conf中的一些配置
1 2 3 4 5
| LoadModule php7_module modules/libphp7.so
<FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch>
|
fpm 常用
1 2 3 4 5 6 7 8 9 10 11
| kill -USR2 16550
php-fpm
php-fpm 关闭: kill -INT `cat /apps/php/logs/php.pid`
php-fpm 重启: kill -USR2 `cat /apps/php/logs/php.pid`
|
)