unable to bind listening socket for address '/run/php/php7.1-fpm.sock' no such file or directory
啟動命令:sudo /etc/init.d/php7-fpm start
php啟動的時候報這個錯誤!
手動創(chuàng)建 目錄 mkdir -pv /run/php/
1. 下載安裝php7.0、php7.0-fpm及其他常用模塊
sudo apt-get install -y php7.0
sudo apt-get install -y php7.0-fpm
sudo apt-get install -y php-zip
sudo apt-get install -y php-dompdf
sudo apt-get install -y php-xml
sudo apt-get install -y php-mbstring
sudo apt-get install -y php-curl
sudo apt-get install -y php-mysql
2. 下載安裝Nginx(1.10.3)
sudo apt-get install -y nginx
1
3. 配置Nginx
修改/etc/nginx/sites-available下的default文件
# Add index.php to the list if you are using PHP
index.php index index.html index.htm index.nginx-debian.html;
1
2
在server項中找到關(guān)于php的配置并啟用
location ~ \\.php$ {
include snippets/fastcgi-php.conf;
#With php7.0-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
#With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
4. 測試服務(wù)器
重啟Nginx:
重啟php7.0-fpm
sudo /etc/init.d/nginx restart
sudo /etc/init.d/php7.0-fpm restart
1
2
在/var/www/html目錄下新建一個php文件
<?php
phpinfo();
?>
$ sudo apt-get install mysql-server-5.6 mysql-client-5.6
途中會提示設(shè)置MySQL的密碼,安裝好后:
$ mysql -uroot -p
unable to bind listening socket for address '/run/php/php7.1-fpm.sock' no such file or directory
啟動命令:sudo /etc/init.d/php7-fpm start
php啟動的時候報這個錯誤!
手動創(chuàng)建 目錄 mkdir -pv /run/php/
Ubuntu 16.04下載軟件速度有點慢,因為默認的是從國外下載軟件,那就更換到國內(nèi)比較好的快速更新源(就是這些軟件所在的服務(wù)器),一般直接百度Ubuntu更新源就能出來一大堆,這時候最好是找和自己Ubuntu版本一致的更新源,我的Ubuntu版本是16.04,下面是我找到的一個比較好的更新源。
1.尋找國內(nèi)鏡像源
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
2.配置source list源
sources.list系統(tǒng)自帶的,源是來Ubuntu的官網(wǎng)!安裝包比較慢,所以最好切換成國內(nèi)的
linuxidc.com@ubuntu:~$ cd /etc/apt
linuxidc.com@ubuntu:/etc/apt$ sudo cp sources.list sources.list.bak
linuxidc.com@ubuntu:/etc/apt$ vim sources.list
# 默認注釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消注釋
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# 預(yù)發(fā)布軟件源,不建議啟用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
3. 更新源
linuxidc.com@ubuntu:/etc/apt$ sudo apt-get update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
正在讀取軟件包列表... 完成
測試:安裝sl包
linuxidc.com@ubuntu:/etc/apt$ sudo apt-get install sl
linuxidc.com@ubuntu:/etc/apt$ sl
4.其他一些命令
sudo apt-get update 更新源
sudo apt-get install package 安裝包
sudo apt-get remove package 刪除包
sudo apt-cache search package 搜索軟件包
sudo apt-cache show package 獲取包的相關(guān)信息,如說明、大小、版本等
sudo apt-get install package --reinstall 重新安裝包
sudo apt-get -f install 修復(fù)安裝
sudo apt-get remove package --purge 刪除包,包括配置文件等
sudo apt-get build-dep package 安裝相關(guān)的編譯環(huán)境
sudo apt-get upgrade 更新已安裝的包
sudo apt-get dist-upgrade 升級系統(tǒng)
sudo apt-cache depends package 了解使用該包依賴那些包
sudo apt-cache rdepends package 查看該包被哪些包依賴
sudo apt-get source package 下載該包的源代碼
sudo apt-get clean && sudo apt-get autoclean 清理無用的包
sudo apt-get check 檢查是否有損壞的依賴
deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse
sudo apt-get update && sudo apt-get -y upgrade//更新一下列表
docker run -it -d --name webln -p 80:80 -v /d/dockerwww:/mmt/www lnweb /bin/bash