WSL下安装nextcloud

梦想游戏人
目录:
未分类

WSL 全称是  Windows Subsystem for Linux  。在windows上原生运行linux ELF程序。

安装php和apache2

sudo add-apt-repository ppa:ondrej/php

sudo apt update

sudo apt install openssl php7.2-common php7.2-mcrypt php7.2-cli php7.2-xml php7.2-mysql php7.2-gd php7.2-imap php7.2-intl php7.2-json php7.2-ldap php7.2-imagick php-ssh2 php7.2-recode php7.2-tidy php7.2-xmlrpc php7.2-mbstring php7.2-curl php7.2-redis php7.2-zip

sudo apt install apache2 libapache2-mod-php7.2

cd /var/www/html/

sudo mkdir nextcloud

sudo chown -R www-data:www-data /var/www/html/nextcloud

sudo service apache2 restart

获取自动安装脚本

sudo wget  https://download.nextcloud.com/server/installer/setup-nextcloud.php

sudo wget https://download.nextcloud.com/server/releases/nextcloud-19.0.0.zip

sudo cp nextcloud-19.0.0.zip nc.zip

通过浏览器访问该php脚本,进行初始化工作,然后提示缺少这些php扩展

安装php扩展,这些扩展是nextcloud所依赖的 上面安装php时会漏掉,这里要手动安装

sudo apt install openssl php7.2-zip

sudo apt install openssl php7.2-dom 

sudo apt install openssl php7.2-XMLWriter

sudo apt install openssl php7.2-libxml

sudo apt install openssl php7.2-mb

sudo apt install openssl php7.2-GD

sudo apt install openssl php7.2-curl

sudo apt install openssl php7.2-mysql

sudo apt install openssl php7.2-intl

sudo apt install openssl php7.2- bcmath

sudo apt install openssl php7.2- gmp

sudo apt install openssl php7.2- imagick

在windows安装mysql,以供WSL使用,网页端进行设置的时候 mysql 信息设置为 127.0.0.1:3306 而非localhost:3306来避免 SQLSTATE[HY000] [2002] No such file or directory 报错

WSL下的 nextcloud应用安装完毕。

Scroll Up