win10 wsl 子系统ubuntu18.4 nginx+php+mysql安装

nginx编译安装

1、下载nginx

http://nginx.org/download/nginx-1.14.2.tar.gz

2、依赖安装

sudo apt-get install build-essential libtool openssl libpcre3 libpcre3-dev zlib1g-dev

3、配置和编译安装

./configure

make && make install

4、安装目录

/usr/local/nginx

php编译安装

1、下载php

wget http://cn2.php.net/get/php-7.3.0.tar.gz/from/this/mirror

2、依赖安装

sudo apt-get install libxml2-dev

sudo apt-get install libssl-dev

sudo apt-get install libbz2-dev

sudo apt-get install curl

sudo apt-get install libcurl4-gnutls-dev

sudo apt-get install libjpeg-dev

sudo apt-get install libpng-dev

sudo apt-get install libmcrypt-dev

sudo apt-get install libfreetype6-dev

sudo apt-get install libgmp-dev libgmp3-dev

sudo apt-get install libreadline6-dev

sudo apt-get install libxslt1-dev

sudo apt-get install libzip-dev

3、配置和编译安装

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts

make && make install

4、安装目录

/usr/local/php

mysql8.0安装

去https://dev.mysql.com/downloads/repo/apt/下载deb包

sudo dpkg -i  下载的deb包

apt update 

删除原有mysql相关

sudo apt-get remove --purge 'mysql*'

sudo rm -rf /etc/mysql /var/lib/mysql

sudo apt-get autoremove

sudo apt-get autoclean

安装

sudo apt-get install mysql-server

启动mysqld_safe

sudo mysqld_safe --skip-grant-tables  --skip-networking &

进入mysql

sudo mysql -S /var/run/mysqld/mysqld.sock

重置密码为空

UPDATE user SET authentication_string='' WHERE user='root';

重启mysql服务

sudo service mysql start

你可能感兴趣的:(win10 wsl 子系统ubuntu18.4 nginx+php+mysql安装)