【学习笔记】php的安装
2012-11-30 16:50
393 查看
安装环境:centos X64 6.0 已经编译完成 apache mysql
php版本:5.3.13
php安装依赖包:yum install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpef-devel freetype-devel libpng-devel gd-devel curl-devel libxslt libxslt-devel openssl-devel -y
还需要libiconv包
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz tar zxvf libiconv-1.14.tar.gz
./configutr --prefix=/usr/local/libiconvmake && make install
--------------------------------------------------------------
编译安装php:
./configure --prefix=/usr/local/php
--with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql
--with-xmlrpc
--with-openssl
--with-zlib
--with-freetype-dir
--with-gd
--with-jpeg-dir
--with-png-dir
--with-iconv=/usr/local/libiconv
--enable-short-tags
--enable-sockets
--enable-zend-multibyte
--enable-soap
--enable-mbstring
--enable-static
--enable-gd-native-ttf
--with-curl
--with-xsl
--enable-ftp
--with-libxml-dir
适合nagios的php环境 解决msn robot “Call to undefined function pdntl_fork()”报错而加
--enable-sigchild
--enable-pcntl
--enable-bcmath
(方便复制:./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-xmlrpc --with-openssl --with-zlib --with-freetype-dir --with-gd --with-jpeg-dir --with-png-dir --with-iconv=/usr/local/libiconv --enable-short-tags --enable-sockets --enable-zend-multibyte --enable-soap --enable-mbstring --enable-static --enable-gd-native-ttf --with-curl --with-xsl --with-libxml-dir --enable-ftp --enable-sigchild --enable-pcntl --enable-bcmath)
编译安装完成后 需要到 apache的配置文件里面指定php首页
再到配置文件的311行左右添加
AddType application/x-httpd-php .php .php3
AddType application/x-httpd-php-source .phps
~~~~~~~~~~~~~~~~编译php的时候报错和解决方法~~~~~~~~~~~~~~~~~
error 1
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
(看提示就明白 是一个lib库没装 先用 yum search 名字 看是否能搜到名字 ,找到名字后 把软件包 开发包装上)
解决办法
yum install libxml2-devel.x86_64
error 2
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
这是openssl没装
解决办法
yum install openssl.x86_64 openssl-devel.x86_64 -y
error 3
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution
这是bzip2软件包没有安装
解决办法
yum install bzip2-devel.x86_64 -y
error 4
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
curl和curl库文件没有安装
解决办法
yum install libcurl.x86_64 libcurl-devel.x86_64 -y
error 5
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
configure: error: jpeglib.h not found
GD库没有安装
解决办法
yum install libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y
error 6
checking for stdarg.h... (cached) yes
checking for mcrypt support... yes
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
libmcrypt库没有安装 ,要是不能用yun安装的话 就要去下载个gz包 自己编译安装
(编译安装 ./configure --piefix=/usr/local/libmcrypt make && make install)
要是错误里面含有mysql的 那是mysql-devel 没有安装
php版本:5.3.13
php安装依赖包:yum install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpef-devel freetype-devel libpng-devel gd-devel curl-devel libxslt libxslt-devel openssl-devel -y
还需要libiconv包
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz tar zxvf libiconv-1.14.tar.gz
./configutr --prefix=/usr/local/libiconvmake && make install
--------------------------------------------------------------
编译安装php:
./configure --prefix=/usr/local/php
--with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql
--with-xmlrpc
--with-openssl
--with-zlib
--with-freetype-dir
--with-gd
--with-jpeg-dir
--with-png-dir
--with-iconv=/usr/local/libiconv
--enable-short-tags
--enable-sockets
--enable-zend-multibyte
--enable-soap
--enable-mbstring
--enable-static
--enable-gd-native-ttf
--with-curl
--with-xsl
--enable-ftp
--with-libxml-dir
适合nagios的php环境 解决msn robot “Call to undefined function pdntl_fork()”报错而加
--enable-sigchild
--enable-pcntl
--enable-bcmath
(方便复制:./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-xmlrpc --with-openssl --with-zlib --with-freetype-dir --with-gd --with-jpeg-dir --with-png-dir --with-iconv=/usr/local/libiconv --enable-short-tags --enable-sockets --enable-zend-multibyte --enable-soap --enable-mbstring --enable-static --enable-gd-native-ttf --with-curl --with-xsl --with-libxml-dir --enable-ftp --enable-sigchild --enable-pcntl --enable-bcmath)
编译安装完成后 需要到 apache的配置文件里面指定php首页
再到配置文件的311行左右添加
AddType application/x-httpd-php .php .php3
AddType application/x-httpd-php-source .phps
~~~~~~~~~~~~~~~~编译php的时候报错和解决方法~~~~~~~~~~~~~~~~~
error 1
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
(看提示就明白 是一个lib库没装 先用 yum search 名字 看是否能搜到名字 ,找到名字后 把软件包 开发包装上)
解决办法
yum install libxml2-devel.x86_64
error 2
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
这是openssl没装
解决办法
yum install openssl.x86_64 openssl-devel.x86_64 -y
error 3
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution
这是bzip2软件包没有安装
解决办法
yum install bzip2-devel.x86_64 -y
error 4
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
curl和curl库文件没有安装
解决办法
yum install libcurl.x86_64 libcurl-devel.x86_64 -y
error 5
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
configure: error: jpeglib.h not found
GD库没有安装
解决办法
yum install libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y
error 6
checking for stdarg.h... (cached) yes
checking for mcrypt support... yes
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
libmcrypt库没有安装 ,要是不能用yun安装的话 就要去下载个gz包 自己编译安装
(编译安装 ./configure --piefix=/usr/local/libmcrypt make && make install)
要是错误里面含有mysql的 那是mysql-devel 没有安装
相关文章推荐
- Fedora :Snort+Apache+Php+Mysql+Acid+Webmin(安装学习笔记)
- 【学习笔记】云服务器安装nginx+mysql+php
- PHP学习笔记 IIS7下安装配置php环境
- Linux学习笔记之更新yum安装最新Nginx+Php
- PHP学习笔记【2】--web服务器和apache服务器的安装
- Linux学习笔记-安装Redis、MongoDB及PHP扩展
- PHP学习笔记——php运行坏境的下载安装,php运行坏境的介绍(上)
- 韩顺平PHP学习视频笔记整理025web服务器介绍 apache服务器安装
- FreeBSD学习笔记16-FreeBSD下安装PHP
- PHP学习笔记【2】--web服务器和apache服务器的安装
- 学习笔记 php mysql apache 的安装
- 马哥学习笔记八——LAMP编译安装之PHP及xcache
- PHP学习笔记(3)-Zend Studio安装和汉化
- Fedora8:Snort+Apache+Php+Mysql+Acid+Webmin(安装学习笔记)
- PHP学习笔记(3)-Zend Studio安装和汉化
- PHP学习笔记-安装与配置
- PHP7 学习笔记(三)关于PHP7如何安装调试工具Xdebug扩展以及Zephir的问题
- FreeBSD学习笔记23-安装PHP扩展
- php学习笔记2--安装apache遇到的问题
- PHP学习笔记(5)----phplib的简介及安装[原创]