博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
传统IDC部署网站(六)
阅读量:6258 次
发布时间:2019-06-22

本文共 7505 字,大约阅读时间需要 25 分钟。

hot3.png

26. alias 别名

一条命令的另外一个名字,你可以理解为外号。

[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.bz2tar (child): bzip2: Cannot exec: No such file or directorytar (child): Error is not recoverable: exiting nowtar: Child returned status 2tar: Error is not recoverable: exiting now[root@localhost src]# yum install bzip2Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * updates: mirrors.aliyun.combase                                                     | 3.6 kB     00:00extras                                                   | 3.4 kB     00:00updates                                                  | 3.4 kB     00:00extras/7/x86_64/primary_db                                 | 156 kB   00:01Resolving Dependencies--> Running transaction check---> Package bzip2.x86_64 0:1.0.6-13.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved================================================================================ Package         Arch             Version                  Repository      Size================================================================================Installing: bzip2           x86_64           1.0.6-13.el7             base            52 kTransaction Summary================================================================================Install  1 PackageTotal download size: 52 kInstalled size: 82 kIs this ok [y/d/N]: yDownloading packages:bzip2-1.0.6-13.el7.x86_64.rpm                              |  52 kB   00:00Running transaction checkRunning transaction testTransaction test succeededRunning transaction  Installing : bzip2-1.0.6-13.el7.x86_64                                    1/1  Verifying  : bzip2-1.0.6-13.el7.x86_64                                    1/1Installed:  bzip2.x86_64 0:1.0.6-13.el7Complete![root@localhost src]# tar jxvf php-7.3.0.tar.bz2
  • vi 剪切粘贴用法

vi 里面在一般模式下,按DD可以删除行(剪切),5dd(剪切五行),光标挪到要粘贴的位置,按p,操作错误后,想要撤销,可以按u,反撤销可以按ctrl r

  • 编译

编译安装一个软件包的三步骤:

./configuremakemake 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-opensslconfigure: WARNING: unrecognized options: --with-mysql, --with-mcrypt, --enable-gd-native-ttfchecking for grep that handles long lines and -e... /usr/bin/grepchecking for egrep... /usr/bin/grep -Echecking for a sed that does not truncate output... /usr/bin/sedchecking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking target system type... x86_64-pc-linux-gnuchecking for cc... nochecking for gcc... noconfigure: error: in `/usr/src/php-7.3.0':configure: error: no acceptable C compiler found in $PATHSee `config.log' for more details
  • 解决缺少GCC的错误
[root@localhost php-7.3.0]# yum install -y gcc
  • 解决缺少某个软件包

查找对应的包后,一般都是安装devel的安装包

configure: error: libxml2 not found. Please check your libxml2 installation.
[root@localhost php-7.3.0]# yum list |grep libxml2libxml2.x86_64                              2.9.1-6.el7_2.3            @anacondalibxml2-python.x86_64                       2.9.1-6.el7_2.3            @baselibxml2.i686                                2.9.1-6.el7_2.3            baselibxml2-devel.i686                          2.9.1-6.el7_2.3            baselibxml2-devel.x86_64                        2.9.1-6.el7_2.3            baselibxml2-static.i686                         2.9.1-6.el7_2.3            baselibxml2-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 supportyum 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 以后的版本

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.gzmv 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

: 补充:

diff 查看两个文件的差异的,如 diff 1.txt 2.txt 4.28-php编译安装2 4.29-php编译安装3 4.30-编译安装Nginx

28. php编译安装(中)

29. php编译安装(下)

30. 编译安装Nginx

官网:

官方文档:

  • 下载:
wget http://nginx.org/download/nginx-1.14.2.tar.gz
  • 解压:
tar zxvf nginx-1.14.2.tar.gzcd nginx-1.14.2
  • 编译:
./configure --prefix=/usr/local/nginx --with-http_ssl_modulemake && make install

启动:

/usr/local/nginx/sbin/nginx

转载于:https://my.oschina.net/u/4066680/blog/3006116

你可能感兴趣的文章
2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest A Email Aliases(模拟STL vector+map)
查看>>
Mr. Frog’s Game
查看>>
3.4可靠数据传输的原理
查看>>
多媒体通信-3-30-2018
查看>>
【Spring Boot&&Spring Cloud系列】Spring Boot中使用数据库之MySql
查看>>
【Spring Boot && Spring Cloud系列】那些Spring Boot中踩过的坑
查看>>
对XX系统的可用性和易用性改良
查看>>
大数据如何解决人工智能对文本挖掘的挑战
查看>>
updatepanel的属性
查看>>
.net 客户端调用java或.net webservice进行soapheader验证
查看>>
RadViz可视化方法--javascript实现
查看>>
软件工程综合实践的第二次实验报告
查看>>
Git储藏与恢复
查看>>
Lua 打印Table
查看>>
性能分析
查看>>
自定义php-mysqli工具增强类,支持链式调用
查看>>
SAS学习笔记之《SAS编程与数据挖掘商业案例》(1)系统简介和编程基础
查看>>
linux常用命令总结-updating
查看>>
SQL事务回滚样例
查看>>
AndFix注意事项
查看>>