Raspberry Pi Install Laravel php Nginx

安裝樹苺派的PHP+LARAVEL+NGINX

Install PHP 7.0

sudo apt install php7.0 php7.0-curl php7.0-gd php7.0-imap php7.0-json php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-xmlrpc php7.0-xml php7.0-fpm php7.0-zip php7.0-mbstring php7.0-sqlite3 php7.0-cli php7.0-readline -y


START php7.0-fpm

sudo systemctl enable php7.0-fpm
sudo service php7.0-fpm start


Install Composer

sudo apt-get install composer



Install NODEJS

sudo apt-get install npm


INSTALL NGINX

sudo apt-get install nginx


Create laravel

composer create-project laravel/laravel laravel –prefer-dist

sudo vi /etc/nginx/sites-enabled/default

################################
#root /var/www/html;
root /home/pi/laravel/public;

#Add index.php to the list if you are using PHP#index index.html index.htm index.nginx-debian.html;
index index.php index.html index.htm index.nginx-debian.html;
 
location ~ .php$ {
     include snippets/fastcgi-php.conf; 
     fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 
}
location ~ /\.ht {             
    deny all;     
}

SETUP SERVICE

sudo service nginx restart
sudo systemctl enable nginx

打完收功

LINUX UBUNTU 19.04上FORMAT 64G SD卡變成ExFat

最近購買了新的64G SD不能使用在LINUX UBUNTU上

後來才發現較大的SDCARD都格式化成了EXFAT的格式.

需要安裝exfat工具才能夠讀居這個fat格式:

sudo apt-get install exfat-utils exfat-fuse

 

 

exFAT(Extended File Allocation Table),又名FAT64,是一種微軟公司(Microsoft)開發的檔案系統,最先從該公司的Windows Embedded CE 6.0作業系統引入這種檔案系統,後又延伸到Windows Vista Service Pack 1作業系統中。

關於exfat:
https://zh.wikipedia.org/wiki/ExFAT

Ubuntu server 18.04 install laravel+nginx

deb http://tw.archive.ubuntu.com/ubuntu/ bionic main restricted
deb http://tw.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb http://tw.archive.ubuntu.com/ubuntu/ bionic universe
deb http://tw.archive.ubuntu.com/ubuntu/ bionic-updates universe
deb http://tw.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse

 

sudo apt install composer php-mysql php-fpm php-mbstring php-tokenizer php-xml php-json php-common nginx

 

MAIL SERVER寄送信件一直出現MX錯誤! 原來是: /etc/resolv.conf

設定 /etc/resolv.conf 檔案

之前的舊伺服器重新開機後一直出現MX not found總覺得那裡怪怪的.

後來原來是因為在伺服器重開之後name server 查詢伺服器異常.

更改了/etc/resolv.conf 才能夠發信件.

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND — YOUR CHANGES WILL BE OVERWRITTEN
nameserver 168.95.1.1
nameserver 168.95.2.1

ubuntu 18.04 youtube-dl not work

最近想要把自己家裡的音樂機器人升級一下,發現了居然已經不會自動下載Youtube的音樂檔了,測試了一下才發現youtube-dl好像已經失效了,果然Google Youtube 不是省油的GOOGLE,只好再把 Youtube-DL 下載最近的版本.

 

要將youtube升級到最新版本:

sudo pip3 install –upgrade youtube-dl