本次部署是在Debian9x64的虚拟机下完成的,WEB服务器使用的是Apache service。
apt install apache2
apt install mysql-server mysql-common mysql-client
安装php7.3
apt -y install lsb-release apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.3.list
apt update
apt -y install php7.3
php -v //检查php版本
//安装php模块
apt install php7.3-cli php7.3-fpm php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json
//安装Apache依赖包
apt install libapache2-mod-php7.3
确认安装成功
图片.png
安装Composer(全局模式)
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
安装Laravel
composer global require "laravel/installer"
如果出现数据传输的报错
[Composer\Downloader\TransportException]
Content-Length mismatch, received 84697 bytes out of the expected 355473
则需要改国内源
composer config repo.packagist composer https://packagist.phpcomposer.com
至此,Laravel的基本环境配置完毕,可以通过阅读官方手册撸代码了
网友评论