centos 6.4 x64 server 安装php

http://blog.chinaunix.net/uid-21374062-id-2951960.html

引用


#yum 安装系统环境所需要的软件包

yum -y install yum-fastestmirror ntp
yum -y install patch make flex bison tar
yum -y install libtool libtool-libs kernel-devel
yum -y install libjpeg libjpeg-devel libpng libpng-devel
yum -y install libtiff libtiff-devel gettext gettext-devel
yum -y install libxml2 libxml2-devel zlib-devel  net-snmp
yum -y install file glib2 glib2-devel bzip2 diff* openldap-devel
yum -y install bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel
yum -y install openssl openssl-devel vim-minimal unzip
# 安装PHP支持GD库模块
yum -y install freetype freetype-devel png jpeg zlib gd php-gd*
# 安装PHP 5.* 组件
yum -y install libiconv libevent mhash mcrypt
# 安装MYDSQL所需要系统库相关库文件
yum install -y gcc gcc-c++ gcc-g77 autoconf automake  fiex* ncurses-devel libmcrypt* libtool-ltdl-devel*



安装报错及处理
http://blog.csdn.net/lwei_998/article/details/44177867
引用

#yum install libmcrypt libmcrypt-devel mcrypt mhash

Setting up Install Process
No package php-mcrypt available.
Error: Nothing to do

我们会看到centos yum从仓库中根本找不到这几个包。


yum  install epel-release  //扩展包更新包

# yum install libmcrypt libmcrypt-devel mcrypt mhash
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again



编辑/etc/yum.repos.d/epel.repo,把基础的恢复,镜像的地址注释掉
#baseurl
mirrorlist
改成
baseurl
#mirrorlist


#yum install libmcrypt libmcrypt-devel mcrypt mhash



如果还不行,直接安装
yum install php-mcrypt
这个命令会把php也装好
[root@localhost ]# yum install php-mcrypt
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.i386 0:5.1.6-15.el5.centos.1 set to be updated
--> Processing Dependency: php >= 5.1.6 for package: php-mcrypt
--> Running transaction check
---> Package php.i386 0:5.1.6-45.el5_11 set to be updated
--> Processing Dependency: php-cli = 5.1.6-45.el5_11 for package: php
--> Processing Dependency: httpd-mmn = 20051115 for package: php
--> Running transaction check
---> Package httpd.i386 0:2.2.3-91.el5.centos set to be updated
updates/filelists_db                                                                                                                             | 2.3 MB     00:48
---> Package php-cli.i386 0:5.1.6-45.el5_11 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                Arch                             Version                                              Repository                           Size
========================================================================================================================================================================
Installing:
 php-mcrypt                             i386                             5.1.6-15.el5.centos.1                                extras                               16 k
Installing for dependencies:
 httpd                                  i386                             2.2.3-91.el5.centos                                  base                                1.2 M
 php                                    i386                             5.1.6-45.el5_11                                      updates                             2.3 M
 php-cli                                i386                             5.1.6-45.el5_11                                      updates                             2.1 M

Transaction Summary
========================================================================================================================================================================
Install       4 Package(s)
Upgrade       0 Package(s)

Total download size: 5.7 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): php-mcrypt-5.1.6-15.el5.centos.1.i386.rpm                                                                                                 |  16 kB     00:00
(2/4): httpd-2.2.3-91.el5.centos.i386.rpm                                                                                                        | 1.2 MB     00:24
(3/4): php-cli-5.1.6-45.el5_11.i386.rpm                                                                                                          | 2.1 MB     00:58
(4/4): php-5.1.6-45.el5_11.i386.rpm                                                                                                              | 2.3 MB     01:14
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                    37 kB/s | 5.7 MB     02:38
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : httpd                                                                                                                                            1/4
  Installing     : php-cli                                                                                                                                          2/4
  Installing     : php                                                                                                                                              3/4
  Installing     : php-mcrypt                                                                                                                                       4/4

Installed:
  php-mcrypt.i386 0:5.1.6-15.el5.centos.1

Dependency Installed:
  httpd.i386 0:2.2.3-91.el5.centos                          php.i386 0:5.1.6-45.el5_11                          php-cli.i386 0:5.1.6-45.el5_11

Complete!


./configure --prefix=/opt/php5 --with-config-file-path=/opt/php5/lib --with-mysql=mysqlnd --with-pdo-mysql --with-mysql-sock=/var/lib/mysql/mysql.sock --with-libxml-dir --enable-ftp --enable-sockets --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-zlib-dir --enable-gd-native-ttf --enable-magic-quotes --with-iconv --enable-mbstring=all --disable-cgi --with-openssl --with-mcrypt --enable-bcmath --enable-calendar --enable-exif --enable-libxml --with-bz2 --with-curl --with-xmlrpc --with-gettext --disable-cli --disable-debug --enable-zend-multibyte --with-mhash --enable-pcntl --enable-sysvsem --enable-inline-optimization --enable-soap --disable-ipv6 --enable-fpm

你可能感兴趣的:(centos 6.4 x64 server 安装php)