centos7php升級
㈠ linux CentOS7系統如何升級boost庫
直接重新下載安裝即可
1.下載 boost
2. 將文件解壓在/usr/local/目錄下
3. 進入/usr/local/boost/ 目錄, 在terminal中輸入
./bootstrap.sh
4.進入/usr/local/boost/ 目錄,在terminal中輸入
sudo ./bjam --layout=versioned --build-type=complete --toolset=gcc install
5.添加環境變數(剛改完要重啟或者注銷一下來更新剛修改過的環境變數)
兩種方法:
(1)修改/etc/profie文件 末尾添加
export BOOST_INCLUDE=/usr/local/include/boost
export BOOST_LIB=/usr/local/lib
(2)在/etc/profile.d/ 中新建一個shell文件boost.sh
#!/bin/sh
export BOOST_INCLUDE=/usr/local/include/boost
export BOOST_LIB=/usr/local/lib
㈡ CentOS7 安裝php提示如下錯誤
你可以使用下面的方法
首先配置yum源
#yuminstallepel-release
#rpm-ivhhttp://rpms.famillecollet.com/enterprise/remi-release-7.rpm
使用yum list命令查看可安裝的包(Packege)。
#yumlist--enablerepo=remi--enablerepo=remi-php56|grepphp
安裝PHP5.6
yum源配置好了,下一步就安裝PHP5.6。
#yuminstall--enablerepo=remi--enablerepo=remi-php56phpphp-opcachephp-develphp-mbstringphp-mcryptphp-mysqlndphp-phpunit-PHPUnitphp-pecl-xdebugphp-pecl-xhprof
用PHP命令查看版本。
#php--version
新增系統用戶組和用戶:
下載 PHP7.3.5
[root@localhost ~]# mkdir devdir
[root@localhost ~]# cd devdir/
[root@localhost devdir]# wget https://www.php.net/distributions/php-7.3.5.tar.gz
-bash: wget: 未找到命令
[root@localhost devdir]# rpm -qa|grep wget
[root@localhost devdir]# yum -y install wget
[root@localhost devdir]# rpm -qa|grep wget
wget-1.14-18.el7.x86_64
下載PHP7 解壓 編譯
wget -c https://downloads.php.net/~cmb/php-7.3.4.tar.gz
編譯參數解釋
--with-fpm-user=webu --with-fpm-group=webg 添加PHP運行用戶和用戶組
配置信息出錯:
下載gcc軟體編譯器 yum install -y gcc
configure: error: libxml2 not found. Please check your libxml2 installation.
下載libzip-1.5.2.tar.gz
https://libzip.org/download/libzip-1.5.2.tar.gz
解決libzip 和cmake版本問題
重新配置PHP7編譯環境參數
libzip-1.5.2 無法安裝,已經取消了。
提示off_t類型沒有定義 undefind,解決方法:
編譯安裝
測試PHP是否安裝成功
轉載自:https://my.oschina.net/u/4127346/blog/3047778
㈣ 如何升級centos7內核並且編譯
、使用 elrepo rpm包升級
查看前系統內核版本 uname -r
1. 導入key
rpm --import
2. 安裝 elrepo yum源
rpm -Uvh
3. 安裝內核
yumelrepo源新版本內核直接yum安裝即
yum --enablerepo=elrepo-kernel install kernel-ml-devel kernel-ml -y
5. 設置系統啟順序
查看系統啟項:
cat /boot/grub2/grub.cfg |grep menuentry
發現新版本內核設置新版本內核默認啟:
grub2-set-default 'CentOS Linux (4.8.5-1.el7.elrepo.x86_64) 7 (Core)'
查看默認啟系統版本grub2-editenv list:
顯示'CentOS Linux (4.8.5-1.el7.elrepo.x86_64) 7 (Core)'
6. reboot重啟再查看 uname -r
二、使用源碼編譯安裝升級
1 載內核源碼
載網址
wget xxx
2 解壓並進入源碼目錄
3 更新系統並安裝依賴軟體
#yum update
#yum upgrade
#yum groups install Development Tools
#yum install ncurses-devel qt-devel hmaccalc zlib-devel binutils-devel elfutils-libelf-devel
4 前內核配置文件拷貝前目錄
本應該執行make menuconfig自定義內核配置配置文件.config; 直接使用原系統內核配置拷貝/boot目錄配置文件前目錄
cp /boot/config-2.6.32-431.11.2.el6.x86_64 .config
5 使用前內核配置
#sh -c 'yes "" | make oldconfig' #centos 6
#sh -c 'y "" | make oldconfig' #centos 7
6 編譯安裝
#make bzImage
#make moles
#make moles_install
#make install
7 設置系統啟順序
查看系統啟項:
cat /boot/grub2/grub.cfg |grep menuentry
發現新版本內核設置新版本內核默認啟:
grub2-set-default 'CentOS Linux (4.8.5-1.el7.elrepo.x86_64) 7 (Core)'
查看默認啟系統版本grub2-editenv list:
顯示'CentOS Linux (4.8.5-1.el7.elrepo.x86_64) 7 (Core)'
8 reboot重啟再查看 uname -r
-
㈤ Centos如何通過yum安裝php7
隨著PHP的升級迭代,老的php版本陵擾在一些高並發,情況下越來越吃力,PHP7+順勢而生,隨著swoole的擴展協程在php中也變得得以實現,下面看下怎麼在centos下升級對應的php吧。
首先確定centos版本
1.通過cat/etc/redhat-release本機用到的是Centos6.2版本
2.由於是升級php,為了防止沖突我們使用rpm_qa|grepphp看看洞汪蠢系統中是否有PHP,然後我們remove掉他yumremove_yphp*,以免影響沖突。
3.接下來我們來安裝php7.2,我的安裝過程可謂一波三折啊,跟著我看看踩了的那些坑吧。
因為默認的yum源沒有php7.2,因此我們必須額外安裝yum源
配置安裝yum源EPELandRemirepository
Centos7系列:
Centos6系列:
然而悲催的是第一步都出錯了,竟然提示打不開納陪rpm,此處不要慌張,只需要yumupdate_ynss即可nss(Linux名稱解析服務)
2)接下來安裝yum-utils
yuminstall-yyum-utils
執行完後我們通過以下命令
yum-config-manager--enableremi-php72
啟用php72這里注意只是啟用了,但是具體的還得通過以下命令來安裝
yuminstall-yphpphp-mcryptphp-cliphp-gdphp-curlphp-mysqlphp-ldapphp-zipphp-fileinfophp-fpmphp-develphp-mbstring
What?又報錯這又是什麼原因呢看著提示是yum找不到。不要怕此時應該是python版本問題導致的。我們只需要將python重新軟鏈下即可
rm-rf/usr/bin/python&&ln-s/usr/bin/python2.6/usr/bin/python
至此php7.2安裝完成。
㈥ 在centos7安裝zlib庫,部署php環境用的,可能沒裝成功,後續安裝提示它安
1、典型的LNMP安裝問題
2、首先你得准備編譯環境
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers bison lynx
3、下載所需MySQL/nginx/php等安裝包
4、安裝nginx和mysql沒有先後順序
5、安裝php依賴包,安裝php,安裝php擴展及優化包
6、詳細的安裝步驟可以網上查LNMP安裝步驟
㈦ centos7系統Apache+php+mysql環境,怎麼升級PHP版本
yum install php php-devel
重啟apache使php生效
systemctl restart httpd.service
此時可以在目錄:/var/www/html/下建立一個PHP文件
代碼:
<?php phpinfo(); ?>
然後訪問這個文件,就能看到PHP的一些信息,php.ini配置文件的路徑可以在這個頁面上看到
安裝php的擴展
yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
安裝完擴展之後需要再次重啟apache
systemctl restart httpd.service
㈧ 怎樣激活centos7中的php
安裝apache:
yum install httpd httpd-devel
啟動apache:
/etc/init.d/httpd start
此時輸入伺服器的IP地址,應該看到apache的服務頁面,埠不用輸,apache默認就是使用80埠
安裝mysql:
yum install mysql mysql-server
啟動mysql:
/etc/init.d/mysqld start
安裝php
yum install php php-devel
重啟apache使php生效
/etc/init.d/httpd restart
此時可以在目錄:/var/www/html/下建立一個PHP文件
代碼:
<?php phpinfo(); ?>
然後訪問這個文件,就能看到PHP的一些信息,php.ini配置文件的路徑可以在這個頁面上看到
安裝php的擴展
yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
安裝完擴展之後需要再次重啟apache
/etc/init.d/httpd restart
測試mysql是否鏈接成功的php代碼
<?php
$con = mysql_connect("10.0.@.@@","@@","@@");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mydb", $con);
$result = mysql_query("SELECT * FROM sys_user");
while($row = mysql_fetch_array($result))
{
echo $row['UserName'] . " " . $row['PassWord'] . " " . $row['id'];
echo "<br />";
}
mysql_close($con);
?>