CentOS 7.7上安装Nginx+PHP 8.1+MariaDB 10.4

By admin, 12 五月, 2022

1. 添加软件源

见参考1。

2. 安装Nginx

yum install nginx

service nginx start

systemctl enable nginx.service

修改/etc/nginx/nginx.conf

3. 安装PHP

yum install php81 php81-php-fpm php81-php-pdo php81-php-mysqlnd php81-php-xml php81-php-gd php81-php-mbstring php81-php-pecl-zip

service php81-php-fpm start

systemctl enable php81-php-fpm.service

配置/etc/nginx/nginx.conf

location ~ \.php[?]* {

fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_pass 127.0.0.1:9000;

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

fastcgi_index index.php;

include fastcgi_params;

fastcgi_read_timeout 3600;

}

location ~ ^/v4/ {

try_files $uri $uri/ /v4/index.php?$query_string;

}

4. 安装MariaDb Server

yum install mariadb104-server

service mariadb start

systemctl enable mariadb.service

 

参考:

  1. https://www.howtoforge.com/tutorial/centos-lamp-server-apache-mysql-php/

评论

Restricted HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。
验证码
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
请输入"Drupal10"

最新评论