Apache安装
sudo apt install apache2
sudo service apache2 start
http://localhost
Mysql安装
sudo apt install mysql-server
sudo mysql_secure_installation
sudo service mysql start
sudo service mysql status
sudo mysql -uroot -p
GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY "123456";
GRANT ALL PRIVILEGES ON *.* TO phpmyadmin@"%" IDENTIFIED BY "123456";
PHP安装
sudo apt install php
sudo apt install libapache2-mod-php
sudo apt-get install php-mysql
sudo service apache2 restart
sudo service mysql restart
sudo vim /var/www/html/phpinfo.php
<?php echo phpinfo(); ?>
http://localhost/phpinfo.php
安装phpMyAdmin
sudo apt install phpmyadmin
sudo vim /etc/apache2/apache2.conf
末尾添加
include /etc/phpmyadmin/apache.conf
AddType application/x-httpd-php .php .html .htm
AddDefaultCharset UTF-8
测试
http://localhost/phpmyadmin
|