cd /usr/local/src
wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/mod_fcgid/mod_fcgid-2.3.9.tar.gz
tar -zxvf mod_fcgid-2.3.9.tar.gz
cd mod_fcgid-2.3.9
全局查找
find / -name apxs
如果找不到则,安装运行
yum install httpd-devel
然后再查找apxs,会显示出所在路径,则再运行(以下命令要根据搜索出来的路径)
APXS=/usr/bin/apxs ./configure.apxs
运行
make
make install
安装完成后 在apache配置文件里 Include conf.modules.d/*.conf下 增加这行 如果已经有了 就不用加了 LoadModule fcgid_module /usr/lib64/httpd/modules/mod_fcgid.so
如果不行 则先去安装php 再回来安装
php安装7.2
cd /usr/local/php
下载
wget https://www.php.net/distributions/php-7.2.31.tar.gz
解压
tar -zxvf php-7.2.31.tar.gz
cd php-7.2.31
yum -y install gcc
yum install openssl-devel
./configure --prefix=/usr/local/php/php-7.2.31/ --with-config-file-path=/usr/local/php/php-7.2.31/etc --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gd --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl=/usr/local/curl --with-jpeg-dir --with-freetype-dir --enable-opcache
yum install libxml2-devel
yum install curl curl-devel
yum install libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y
yum install libjpeg libjpeg-devel -y
(如果安装完后发现没有bin文件夹 请重新安装下)
make && make install
cp /usr/local/php/php-7.2.31/php.ini-production /usr/local/php/php-7.2.31/php.ini
修改站点配置
vim /etc/httpd/conf/httpd.conf
指定php版本
<VirtualHost *:80>
DocumentRoot "/var/www/html/xxx.fsdzc.com/public"
ServerName xxx.fsdzc.com
AddHandler fcgid-script .fcgi .php
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
FcgidMaxRequestsPerProcess 1000
FcgidIOTimeout 300
FcgidIdleTimeout 300
FcgidMaxRequestLen 2097152
MaxRequestLen 52428800
FcgidInitialEnv PHPRC "/usr/local/php/php-7.2.31/"
FcgidWrapper "/usr/local/php/php-7.2.31/bin/php-cgi".php
<Directory "/var/www/html/xxx.fsdzc.com/public">
Options +Indexes +FollowSymLinks +ExecCGI
Order Allow,Deny
Allow from all
DirectoryIndex index.php index.html
AllowOverride all
</Directory>
</VirtualHost>
|