傳統IDC部署網站(六)

26. alias 別名

一條命令的另一個名字,你能夠理解爲外號。php

[root@localhost /]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 ^C
[root@localhost /]# alias viens0s3='vi /etc/sysconfig/network-scripts/ifcfg-enp0s3'
  • .bashrc 針對當前用戶的
[root@localhost ~]# vi .bashrc
插入alias viens0s3='vi /etc/sysconfig/network-scripts/ifcfg-enp0s3'
  • /etc/bashrc 針對所有用戶 在文件最後增長別名

27. php編譯安裝(上)

  • 下載 解壓
[root@localhost src]# wget http://cn2.php.net/distributions/php-7.3.0.tar.bz2
[root@localhost src]# tar jxvf php-7.3.0.tar.bz2
[root@localhost src]# tar jxvf php-7.3.0.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
[root@localhost src]# yum install bzip2
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.aliyun.com
base                                                     | 3.6 kB     00:00
extras                                                   | 3.4 kB     00:00
updates                                                  | 3.4 kB     00:00
extras/7/x86_64/primary_db                                 | 156 kB   00:01
Resolving Dependencies
--> Running transaction check
---> Package bzip2.x86_64 0:1.0.6-13.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch             Version                  Repository      Size
================================================================================
Installing:
 bzip2           x86_64           1.0.6-13.el7             base            52 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 52 k
Installed size: 82 k
Is this ok [y/d/N]: y
Downloading packages:
bzip2-1.0.6-13.el7.x86_64.rpm                              |  52 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : bzip2-1.0.6-13.el7.x86_64                                    1/1
  Verifying  : bzip2-1.0.6-13.el7.x86_64                                    1/1

Installed:
  bzip2.x86_64 0:1.0.6-13.el7

Complete!
[root@localhost src]# tar jxvf php-7.3.0.tar.bz2
  • vi 剪切粘貼用法

vi 裏面在通常模式下,按DD能夠刪除行(剪切),5dd(剪切五行),光標挪到要粘貼的位置,按p,操做錯誤後,想要撤銷,能夠按u,反撤銷能夠按ctrl rhtml

  • 編譯

編譯安裝一個軟件包的三步驟:python

./configure
make
make install
./configure --preefix=/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-/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
  • 文件安裝路徑
--prefix=/usr/local/php-fpm
  • 配置文件安裝路徑
--with-config-file-path=/usr/local/php-fpm/etc
  • 開啓fpm
--enable-fpm
  • 指定用戶
--with-fpm-user=php-fpm
  • 指定組
--with-fpm-group=php-fpm
  • 指定MYSQL路徑(老版本)
--with-mysql=/usr/local/mysql
  • 指定MYSQL路徑(新版本)
--with-mysqli=/usr/local/mysql/bin/mysql_config
  • pdomysql 也是一種mysql的鏈接方式
--with-pdo-mysql=/usr/local/mysql
  • 指定mysqlsock
--with-mysql-sock=/tmp/mysql.sock
  • PHP的模塊
--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

開始編譯

[root@localhost 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
configure: WARNING: unrecognized options: --with-mysql, --with-mcrypt, --enable-gd-native-ttf
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for cc... no
checking for gcc... no
configure: error: in `/usr/src/php-7.3.0':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
  • 解決缺乏GCC的錯誤
[root@localhost php-7.3.0]# yum install -y gcc
  • 解決缺乏某個軟件包

查找對應的包後,通常都是安裝devel的安裝包mysql

configure: error: libxml2 not found. Please check your libxml2 installation.
[root@localhost php-7.3.0]# yum list |grep libxml2
libxml2.x86_64                              2.9.1-6.el7_2.3            @anaconda
libxml2-python.x86_64                       2.9.1-6.el7_2.3            @base
libxml2.i686                                2.9.1-6.el7_2.3            base
libxml2-devel.i686                          2.9.1-6.el7_2.3            base
libxml2-devel.x86_64                        2.9.1-6.el7_2.3            base
libxml2-static.i686                         2.9.1-6.el7_2.3            base
libxml2-static.x86_64                       2.9.1-6.el7_2.3            base
[root@localhost php-7.3.0]# yum install -y libxml2-devel.i686 libxml2-devel.x86_64
  • CURL版本不匹配
checking for cURL 7.15.5 or greater... configure: error: cURL version 7.15.5 or later is required to compile php with cURL support

yum install libcurl-devel.i686 libcurl-devel.x86_64
  • 缺乏jpeglib
configure: error: jpeglib.h not found.

yum -y install libjpeg-devel
  • 缺乏png.sh
configure: error: png.h not found.

yum install -y libpng-devel
  • 找不到freetype-config
configure: error: freetype-config not found.

[root@localhost ~]# yum install -y freetype-devel.i686 freetype-devel.x86_64
  • 錯誤的mysql library

php 7.3不支持mysql 或者 mariadb 5.6 之後的版本linux

configure: error: wrong mysql library version or lib not found. Check config.log for more information

[root@localhost src]# wget http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.41-linux-glibc2.12-x86_64.tar.g
tar xzvf 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
  • 找不到用戶
ERROR: [pool www] cannot get uid for user ‘php-fpm’
useradd php-fpm

: 補充:nginx

diff 查看兩個文件的差別的,如 diff 1.txt 2.txt 4.28-php編譯安裝2 4.29-php編譯安裝3 4.30-編譯安裝Nginxsql

28. php編譯安裝(中)

29. php編譯安裝(下)

30. 編譯安裝Nginx

官網:http://nginx.org/bash

官方文檔:http://nginx.org/en/docs/install.htmldom

  • 下載:
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

啓動:curl

/usr/local/nginx/sbin/nginx

相關文章
相關標籤/搜索