标签:Linux学习
1.10-11-12 安装PHP5PHP 官网 www.php.net
当前主流版本为 5.6 / 7.2
cd /usr/local/src
wget http://cn2.php.net/distributions/php-5.6.34.tar.gz
tar zxvf php-5.6.34.tar.gz
cd php-5.6.34
./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
yum install -y openssl-devel
yum install -y libxml2-devel
yum install -y bzip2-devel
yum install -y libjpeg-devel
yum install -y libpng-devel
yum install -y freetype-devel
yum install -y libmcrypt-devel
make
make install
cp php.ini-production /usr/local/php/etc/php.ini
du -sh /usr/local/php/bin/php
du -sh /usr/local/apache2.4/modules/libphp5.so
/usr/local/php/bin/php -m //查看php加载的模块
[root@aming-01 php-5.6.34]# /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]
/usr/local/php/bin/php -i |less // 查看PHP相关信息
11.13 安装 PHP7
cd /usr/local/src
wget http://cn2.php.net/distributions/php-7.2.3.tar.gz
cd php-7.2.3/
./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php7/etc --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
make
make install
ls /usr/local/apache2.4/modules/libphp7.so
cp php.ini-production /usr/local/php7/etc/php.ini
/usr/local/php7/bin/php -m //查看php加载的模块
[root@aming-01 php-7.2.3]# /usr/local/apache2.4/bin/httpd -M
AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using fe80::b869:44fc:d655:60b1. Set the ‘ServerName‘ directive globally to suppress this message
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_event_module (static)
authn_file_module (shared)
authn_core_module (shared)
authz_host_module (shared)
authz_groupfile_module (shared)
authz_user_module (shared)
authz_core_module (shared)
access_compat_module (shared)
auth_basic_module (shared)
reqtimeout_module (shared)
filter_module (shared)
mime_module (shared)
log_config_module (shared)
env_module (shared)
headers_module (shared)
setenvif_module (shared)
version_module (shared)
unixd_module (shared)
status_module (shared)
autoindex_module (shared)
dir_module (shared)
alias_module (shared)
php5_module (shared)
php7_module (shared)
标签:Linux学习
原文地址:http://blog.51cto.com/9298822/2097119