标签:row 安装 移动 document HERE 开发环境 send 访问 cte
说明:用apt方式安装适用于本地开发环境,如果是线上生产环境,建议下载软件后编译安装
root@lhdpc:~# apt-get install php
root@lhdpc:~# php -v PHP 7.4.16 (cli) (built: Mar 23 2021 16:15:03) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.16, Copyright (c), by Zend Technologies
安装php-fpm
root@lhdpc:~# apt-get install php-fpm
root@lhdpc:~# whereis php-fpm php-fpm: /usr/sbin/php-fpm7.4
root@lhdpc:~# service php7.4-fpm start
说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest
对应的源码可以访问这里获取: https://github.com/liuhongdi/
说明:作者:刘宏缔 邮箱: 371125307@qq.com
root@lhdpc:~# apt-get install nginx
root@lhdpc:~# whereis nginx nginx: /usr/sbin/nginx /usr/lib/nginx /etc/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz
root@lhdpc:~# systemctl start nginx
root@lhdpc:~# ss -lntp State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=621,fd=13)) LISTEN 0 128 127.0.0.1:631 0.0.0.0:* users:(("cupsd",pid=1416,fd=7)) LISTEN 0 511 0.0.0.0:80 0.0.0.0:* users:(("nginx",pid=11583,fd=6),("nginx",pid=11582,fd=6),("nginx",pid=11581,fd=6)) LISTEN 0 128 [::1]:631 [::]:* users:(("cupsd",pid=1416,fd=6)) LISTEN 0 511 [::]:80 [::]:* users:(("nginx",pid=11583,fd=7),("nginx",pid=11582,fd=7),("nginx",pid=11581,fd=7)) LISTEN 0 50 *:1716 *:* users:(("kdeconnectd",pid=1254,fd=16))
root@lhdpc:~# cd /etc/nginx/sites-enabled/ root@lhdpc:/etc/nginx/sites-enabled# ls default root@lhdpc:/etc/nginx/sites-enabled# vi default
location ~ \.php$ { include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): fastcgi_pass unix:/run/php/php7.4-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; }
root@lhdpc:/etc/nginx/sites-enabled# systemctl stop nginx
root@lhdpc:/etc/nginx/sites-enabled# systemctl start nginx
root@lhdpc:/etc/nginx/sites-enabled# apt-get install php-mysql
root@lhdpc:~# apt-get update
root@lhdpc:~# apt-get install mysql-server
root@lhdpc:~# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.25-0ubuntu0.21.04.1 (Ubuntu) Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec)
说明:此时使用my.ini中的默认密码连接
mysql> create user ‘root‘@‘127.0.0.1‘ identified by ‘rootpassword‘; Query OK, 0 rows affected (0.01 sec) mysql> grant all on *.* to root@127.0.0.1; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
root@lhdpc:~# systemctl stop mysql
root@lhdpc:~# systemctl start mysql
root@lhdpc:/usr/local/source# wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.zip
root@lhdpc:/usr/local/source# unzip phpMyAdmin-5.0.1-all-languages.zip
root@lhdpc:/usr/local/source# mv phpMyAdmin-5.0.1-all-languages /var/www/html/phpmyadmin
root@lhdpc:/var/www/html/phpmyadmin# cp config.sample.inc.php config.inc.php
root@lhdpc:/var/www/html/phpmyadmin# vi config.inc.php
//$cfg[‘Servers‘][$i][‘host‘] = ‘localhost‘; $cfg[‘Servers‘][$i][‘host‘] = ‘127.0.0.1‘;
liuhongdi@lhdpc:/usr/local/source$ cat /etc/os-release NAME="Ubuntu" VERSION="21.04 (Hirsute Hippo)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 21.04" VERSION_ID="21.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=hirsute UBUNTU_CODENAME=hirsute
ubuntu21.04(linux):用apt安装nginx/php/mysql/phpmyadmin(开发环境)
标签:row 安装 移动 document HERE 开发环境 send 访问 cte
原文地址:https://www.cnblogs.com/architectforest/p/14905031.html