手记

PHP安装

下载php:

[rot@localhost httpd-2.2.16]# cd /usr/local/src[root@localhost src]# wget http://am1.php.net/distributions/php-5.3.27.tar.gz

解压:

[root@localhost src]# tar zxf php-5.3.27.tar.gz

配置编译参数:

[root@localhost src]# cd php-5.3.27
[root@localhost php-5.3.27]# ./configure \

--prefix=/usr/local/php \

--with-apxs2=/usr/local/apache/bin/apxs \

--with-config-file-path=/usr/local/php/etc  \
--with-mysql=/usr/local/mysql \
--with-libxml-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv-dir \
--with-zlib-dir \
--with-bz2 \
--with-openssl \
--with-mcrypt \
--enable-soap \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-sockets \
--enable-exif \
--disable-ipv6



error: jpeglib.h not found.

解决办法: yum install libjpeg-devel


error: mcrypt.h not found. Please reinstall libmcrypt.

解决办法: wget -P /etc/yum.repos.d/  http://mirrors.aliyun.com/repo/epel-6.repo

               yum install -y  libmcrypt-devel 

error: Please reinstall the BZip2 distribution

解决办法: yum install bzip2-devel.x86_64 -y

error: Cannot find OpenSSL's <evp.h>

解决办法: yum install openssl openssl-devel

               ln -s /usr/lib64/libssl.so /usr/lib/

error: xml2-config not found. Please check your libxml2 installation.

解决办法:yum install libxml2-devel


error: mcrypt.h not found. Please reinstall libmcrypt”

解决方法:

解决办法一
1、安装第三方yum源
wget http://www.atomicorp.com/installers/atomic
sh ./atomic
2、使用yum命令安装

yum  install  php-mcrypt  libmcrypt  libmcrypt-devel

解决办法二、

使用php mcrypt 前必须先安装Libmcrypt

libmcrypt源码安装方法:


cd /usr/local/src

wget http://softlayer.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz

tar -zxvf libmcrypt-2.5.8.tar.gz

cd /usr/local/src/libmcrypt-2.5.8

./configure --prefix=/usr/local

make

make install



configure: error: png.h not found.
复制代码 代码如下:
yum -y install libpng-devel

configure: error: freetype.h not found.
复制代码 代码如下:
yum -y install freetype-devel

0人推荐
随时随地看视频
慕课网APP