標籤

BAT (38) shell (34) Virtual Machine (33) Xubuntu (29) acfs (25) PHP (24) CentOS (21) Virtul Box (20) 編輯器 (17) 資料庫 (15) lubuntu (13) windows (13) CPP (12) ubuntu (12) chrome (11) laravel (10) Docker (9) Python (9) 5A88 (7) VMware (6) 資料結構 (6) Javascript (5) Node (5) Proxmox VE (5) 公告系統 (5) 程式積木 (5) Android Studio (4) ANN (3) OB2D2016x64 (3) Xoops (3) clonezilla (3) samba (3) 公文 (3) 其他 (3) 硬體 (3) API (2) Android (2) AppInvent2 (2) Html (2) Hyper-V (2) Nas (2) botnet (2) mbot (2) swift (2) wordpress (2) 樣板 (2) 防火牆 (2) AD的應用 (1) Ansible (1) Arduino (1) CSS (1) GitLab (1) HA Proxy (1) LegoEV3 (1) PowerShell (1) Scratch (1) VM (1) XenServer (1) kotlin (1) linuxmint (1) lxc (1)

2018年10月22日 星期一

在 xubuntu 16.04 安裝 laravel 5.7

1.安裝壓縮工具
$sudo apt-get install unzip zip

2.安裝PHP 7.2 與其拓展套件

//軟體源拓展工具
$sudo apt -y install software-properties-common apt-transport-https lsb-release ca-certificates

//軟體源
$sudo add-apt-repository ppa:ondrej/php

//更新
$sudo apt-get update

//安裝PHP 7.2 與其拓展套件
$sudo apt-get install php7.2 php7.2-cli php7.2-json php7.2-mbstring php7.2-gd php7.2-xml php7.2-ldap php7.2-mysql php7.2-zip

3.安裝composer:

//下載composer
$wget -c https://getcomposer.org/composer.phar

//將composer.phar設為可執行
$chmod +x composer.phar

//移到/usr/local/bin,並改名composer,隨時可呼叫
$sudo mv composer.phar /usr/local/bin/composer

//測試
$composer

4.安裝phpmyadmin

$sudo apt-get install phpmyadmin

5.於html下安裝laravel,放置在/home/webadmin/html/laravel/


$cd /home/webadmin/

$mkdir html

$cd /var/www/

$sudo mv html html2

$ln -s /home/webadmin/html /var/www/html    (此時 /var/www/ 有兩個目錄 html html2)

$cd /home/webadmin/html/

$mkdir laravel 

6.安裝最新版的laravel

$composer create-project laravel/laravel --prefer-dist /home/webadmin/html/laravel



7.加入apache虛擬主機

$sudo vi /etc/hosts
$sudo vim /etc/apache2/sites-available/laravel.conf 

寫入:
-------------------------------------------------------------------------------------
<VirtualHost *:80>
   ServerName localhost

   ServerAdmin webmaster@localhost
   DocumentRoot /home/webadmin/html/laravel/public


<Directory /home/webadmin/html/laravel>
         AllowOverride All
         Require all granted
   
</Directory>

   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

-------------------------------------------------------------------------------------

如果要取消原本80網頁

$sudo a2dissite 000-default.conf

啟用新網頁

$sudo a2ensite laravel.conf

$sudo a2enmod rewrite

$sudo service apache2 restart


8.更改特定目錄擁有者為www-data,及777

$cd /home/webadmin/html/laravel/

$sudo chown -R www-data storage/ bootstrap/cache/

$sudo chmod -R 777 storage/ bootstrap/cache/

9.設定預設php版本為 7.2 

$sudo update-alternatives --set php /usr/bin/php7.2

10.Apache2 啟用 php7.2

$ sudo a2dismod php7.0

$ sudo a2enmod php7.2

$ sudo systemctl restart apache2

資料來源:
1.lubuntu 16.04 x64 安裝 laravel 5 與安裝phpmyadmin

2.How to Install Different PHP (5.6, 7.0 and 7.1) Versions in Ubuntu
https://www.tecmint.com/install-different-php-versions-in-ubuntu/

3.ubuntu 16.04 安装PhpMyAdmin  https://blog.csdn.net/l6807718/article/details/51374915


4.Ubuntu – 安裝 PHP7 + Apache + Mysql/MariaDB + phpMyadmin http://jsnwork.kiiuo.com/archives/2505/ubuntu-%E5%AE%89%E8%A3%9D-php7-apache-mysqlmariadb-phpmyadmin/



沒有留言:

張貼留言

在 Windows 10 x64 1909版,使用BAT快速安裝公文系統與人事服務網(自然人憑證)版

相關內容移往 https://skjhcreator.blogspot.com/2021/02/windows-10-x64-1909bat.html