11月13日任務php
11.10/11.11/11.12 安裝PHP5mysql
11.13 安裝PHP7linux
#安裝過程sql
[root@zgxlinux-01 ~]# cd /usr/local/src/
[root@zgxlinux-01 src]# wget http://cn2.php.net/distributions/php-5.6.32.tar.bz2
[root@zgxlinux-01 src]# tar -jxvf php-5.6.32.tar.bz2apache
[root@zgxlinux-01 src]# ls
php-5.6.32 php-5.6.32.tar.bz2
[root@zgxlinux-aliyun php-5.6.32]# cd php-5.6.32json
[root@zgxlinux-aliyun php-5.6.32]#[root@zgxlinux-01 php-5.6.32]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4.37/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-exifvim
#根據報錯信息,來安裝缺乏的包,安裝完後從新執行。
session
[root@zgxlinux-01 php-5.6.32]# yum install -y libxml2-develphp7
[root@zgxlinux-01 php-5.6.32]# yum install -y openssl-develdom
[root@zgxlinux-01 php-5.6.32]# yum install -y bzip2-devel
[root@zgxlinux-01 php-5.6.32]# yum install -y libjpeg-devel
[root@zgxlinux-01 php-5.6.32]# yum install libpng-devel
[root@zgxlinux-01 php-5.6.32]# yum install -y freetype-devel
[root@zgxlinux-01 php-5.6.32]# yum install -y libmcrypt-devel
#通過一番折騰,終於看到這個界面表示已經安裝完了。接下來執行make && make install ,這個過程比較漫長。
[root@zgxlinux-01 php-5.6.32]# make && make install
[root@zgxlinux-01 php-5.6.32]# echo $?
0
#通過漫長的等待終於大功告成。接下來看看php目錄。
[root@zgxlinux-01 php-5.6.32]# ls /usr/local/php/
bin etc include lib php
[root@zgxlinux-01 php-5.6.32]# ls /usr/local/php/bin/
pear pecl phar.phar php-cgi phpize
peardev phar php php-config
[root@zgxlinux-01 php-5.6.32]# du -sh /usr/local/php/bin/php
36M /usr/local/php/bin/php
[root@zgxlinux-01 php-5.6.32]# du -sh /usr/local/apache2.4.37/modules/libphp5.so
36M /usr/local/apache2.4.37/modules/libphp5.so
#查看php加載了那些模塊
[root@zgxlinux-01 php-5.6.32]# /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@zgxlinux-01 php-5.6.32]# /usr/local/apache2.4.37/bin/httpd -
M
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::8309:40e5:5360:fcbd. 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) #這說明php是做爲apache的一個模塊存在的。
[root@zgxlinux-01 php-5.6.32]# ls -l /usr/local/apache2.4.37/modules/libphp5.so
-rwxr-xr-x 1 root root 37735552 11月 14 22:08 /usr/local/apache2.4.37/modules/libphp5.so
[root@zgxlinux-01 php-5.6.32]# vim /usr/local/apache2.4.37/conf/httpd.conf
11.13 安裝PHP7