4.26-alias別名php
Alias別名:
一條命令的另一個名字,你能夠理解爲外號。
舉例:
alias ls='/usr/bin/ls --color=auto'
網卡配置文件路徑很長,每次敲這個命令都要花很長時間,能夠作一個別名:
alias viens33='vi /etc/sysconfig/network-scripts/ifcfg-ens33'
配置文件做用域:
vi ~/.bashrc //針對當前用戶的,換一個用戶就很差使了
vi /etc/bashrc //針對全部用戶,不單單是當前用戶。
在這個文件最後面增長:alias viens33='vi /etc/sysconfig/network-scripts/ifcfg-ens33'html
4.27--29 php編譯安裝
下載PHP
cd /usr/local/src
wget http://cn2.php.net/distributions/php-7.3.0.tar.bz2
解壓
tar jxvf php-7.3.0.tar.bz2
編譯
cd php-7.3.0
編譯參數:
./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl
make
make install
配置文件:
cd /usr/local/php-fpm/
cp php-fpm.conf.default php-fpm.conf
cd /usr/local/src/php-7.3.0
cp php.ini-development /usr/local/php-fpm/etc/php.ini
cd /usr/local/php-fpm/etc/php-fpm.d/
cp www.conf.default www.conf
啓動腳本:
cd /usr/local/src/php-7.3.0
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
chmod 755 /etc/init.d/php-fpm
補充:
vi 裏面在通常模式下,按dd能夠刪除行(剪切),5dd(剪切5行),光標挪到要粘貼的位置,按p。
操做錯誤以後,想要撤銷,能夠按u,反着撤銷按 ctrl r;
通常模式下按gg能夠把光標定位到首行,按G能夠定位到末行;
按yy複製,5yy複製5行;
顯示行號,在通常模式裏輸入:set nu;
定位到指定的行:通常模式下直接按數字G,如10G
編譯安裝一個軟件包的步驟:
./configure ; make; make install
grep -i 忽略大小寫
錯誤1:
checking for cc... no
checking for gcc... no
解決: yum install -y gcc
錯誤2:
error: libxml2 not found
解決:yum install -y libxml2-devel
錯誤3:
error: Cannot find OpenSSL's
解決:yum install -y openssl-devel
錯誤4:
error: cURL version 7.15.5 or later is required
解決:yum install -y libcurl-devel
錯誤5:
configure: error: jpeglib.h not found
解決:yum install -y libjpeg-turbo-devel
錯誤6:
configure: error: png.h not found
解決:yum install -y libpng-devel
錯誤7:
configure: error: freetype-config not found.
解決: yum install -y freetype-devel
錯誤8:
configure: error: wrong mysql library version or lib not found
解決:下載一個低版本的MySQL/Mariadb
wget http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
tar jxvf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.6.39-linux-glibc2.12-x86_64 /usr/local/mysql5.6
改編譯參數
./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql5.6 --with-mysqli=/usr/local/mysql5.6/bin/mysql_config --with-pdo-mysql=/usr/local/mysql5.6 --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl
錯誤9:
ERROR: [pool www] cannot get uid for user 'php-fpm'
解決:useradd php-fpm
補充:
diff 查看兩個文件的差別的,如 diff 1.txt 2.txtmysql
4.28-php編譯安裝2
4.29-php編譯安裝3linux
4.30-編譯安裝Nginx
官網:http://nginx.org/
官方文檔:http://nginx.org/en/docs/install.html
下載:
wget http://nginx.org/download/nginx-1.14.2.tar.gz
解壓:
tar zxvf nginx-1.14.2.tar.gz
cd nginx-1.14.2
編譯:
./configure --prefix=/usr/local/nginx --with-http_ssl_module
make && make install
啓動:
/usr/local/nginx/sbin/nginxnginx