标签:php安装
安装PHP5./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --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
apxs2这个工具可以自动加载apache的扩展模块,指定mysql的驱动,后面的参数是指定php所需要的模块
configure: error: xml2-config not found. Please check your libxml2 installation. [root@aminglinux-02 php-5.6.30]# yum install -y libxml2-devel configure: error: Cannot find OpenSSL‘s <evp.h> [root@aminglinux-02 php-5.6.30]# yum install -y openssl-devel configure: error: Please reinstall the BZip2 distribution [root@aminglinux-02 php-5.6.30]# yum install -y bzip2-devel configure: error: jpeglib.h not found. [root@aminglinux-02 php-5.6.30]# yum install -y libjpeg-devel configure: error: png.h not found. [root@aminglinux-02 php-5.6.30]# yum install -y libpng-devel configure: error: freetype-config not found. [root@aminglinux-02 php-5.6.30]# yum install -y freetype-devel configure: error: mcrypt.h not found. Please reinstall libmcrypt. [root@aminglinux-02 php-5.6.30]# yum install -y libmcrypt-devel
[root@akuilinux01 php-5.6.30]# ls /usr/local/php/
bin etc include lib php
[root@akuilinux01 php-5.6.30]# du -sh /usr/local/php/bin/php
36M /usr/local/php/bin/php //主文件
[root@akuilinux01 php-5.6.30]# du -sh /usr/local/apache2.4/modules/libphp5.so
37M /usr/local/apache2.4/modules/libphp5.so //php主模块
[root@akuilinux01 php-5.6.30]# /usr/local/php/bin/php -m //加载的模块,静态的
[PHP Modules]
bz2
Core
ctype
date
dom
ereg
exif
fileinfo
filter
gd
hash
iconv
json
libxml
mbstring
mcrypt
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib
[Zend Modules]
[root@akuilinux01 php-5.6.30]# /usr/local/php/bin/php -i |less
[root@akuilinux01 ~]# vim /usr/local/apache2.4/conf/httpd.conf
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module modules/libphp5.so
#LoadModule php7_module modules/libphp7.so
标签:php安装
原文地址:http://blog.51cto.com/akui2521/2120442