“Lnmp”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
(Evan移动页面Lnmp安装脚本Lnmp,不留重定向)

2021年6月16日 (三) 12:25的版本

start

How To Install Linux, Nginx, MariaDB, PHP (LEMP stack) on Debian 10 debinalnmp

# for zabbix 
apt install php7.3-bcmath  php7.3-mbstring php7.3-gd  php7.3-xml   libxml++2.6-dev

sudo apt update
sudo apt install nginx


sudo apt install mariadb-server
sudo mysql_secure_installation

sudo apt install php-fpm php-mysql

sudo mkdir /var/www/your_domain

sudo chown -R $USER:$USER /var/www/your_domain

sudo vi /etc/nginx/sites-available/your_domain

/etc/nginx/sites-available/your_domain
server {
    listen 80;
    listen [::]:80;

    root /var/www/your_domain;
    index index.php index.html index.htm;

    server_name your_domain;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    }
}

sudo ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled/

nginx -t && systemctl reload nginx


vi /var/www/your_domain/info.php
 

/var/www/your_domain/info.php
<?php
phpinfo();
?>

http://your_domain/info.php




How To Install Linux, Nginx, MariaDB, PHP (LEMP stack) on Debian 10

参考

wdlinux phps.sh