4.26 Alias
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'
4.27-29 php编译安装
1、登陆php官方网站,下载源码包;
使用 wget http://101.96.10.63/cn.php.net/distributions/php-7.3.1.tar.bz2 将源码包下载到: /usr/local/src;
2、解压缩下载的源码包;
tar -jxvf php-7.3.1.tar.bz2
tar (child): php-7.3.1.tar.bz2: Cannot open: 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
出现报错,未安装 bzip2 解压缩包;
安装 bzip2 压缩包 yum -y install bzip2
3、编译安装一个软件包的三个步骤;
./configure ; make ; make install;
./configure --prefix=/usr/local/php-from --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-usr=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
错误1:
checking fo cc ...no
checking fo gcc ... no
解决 安装gcc yum install -y gcc
错误2:
configure: error: libxml2 not found. Please check your libxml2 installation.
解决 安装libxml2 yum install -y libxml2-devel.x86_64
错误3:
configure: error: Cannot find OpenSSL's <evp.h>
解决 安装openssl yum install -y openssl-devel.x86_64
错误4:
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
解决 安装 curl yum install -y libcurl-devel.x86_64
错误5:
configure: error: jpeglib.h not found.
解决 安装 jpeglib yum install -y libjpeg-turbo-devel.x86_64
错误6:
configure: error: png.h not found.
解决 安装 ping libpng-devel.x86_64
错误7:
configure: error: freetype-config not found.
解决安装 freetype yum install -y freetype-devel.x86_64
错误8:
configure: error: wrong mysql library version or lib not found. Check config.log for more information.
错误 mysql 版本过高,使用旧版本mysql 5.6源码包解压缩 制定该文件包路径安装php --with-mysqli=/usr/local/mysql5.6/bin/mysql_config
使用make; 开始安装 执行完成用echo $? 若返回值为0则编译无问题;
使用make install 开始安装;
编译安装完成后 进入目录:/usr/local/php-from/etc
php本身有两个配置文件,一个是php服务本身的配置文件,一个是php的配置文件;
手动生成php配置文件 :cp php-fpm.conf.default php-fpm.conf
cp /usr/local/src/php-7.3.1/php.ini-development /usr/local/php-from/etc/php.ini
cp /usr/local/php-from/etc/php-fpm.d/www.conf.default www.conf
将www.conf
user = nobody 改为 php-fpm
group = php-fpm
配置php启动脚本:
cp /usr/local/src/php-7.3.1/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/php-fpm 给文件执行权限
chkconfig --add php-fpm
chkconfig php-fpm on
chkconfig --list
4.30 编译安装Nginx
本文介绍了Linux中设置Alias别名的方法,以简化命令操作,并详细阐述了如何编译安装PHP的过程,包括下载源码、解决编译过程中遇到的各种依赖问题,以及配置和启动php-fpm。
3761

被折叠的 条评论
为什么被折叠?



