【CentOS 7LAMP架构4】,PHP5和PHP7的安装和配置#171219

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

hellopasswd


安装PHP5

  • PHP官网www.php.net
  • 当前主流版本为5.6/7.1
  • cd /usr/local/src
  • wget http://cn2.php.net/distributions/php-5.6.30.tar.bz2
  • bzip2 -d php-5.6.30.tar.bz2
  • tar xvf php-5.6.30.tar
  • cd php-5.6.30
  • ./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
  • make && make install
  • cp php.ini-production /usr/local/php/etc/php.ini
[root@localhost ~]# cd /usr/local/src
[root@localhost src]# wget http://cn2.php.net/distributions/php-5.6.30.tar.bz2
--2017-12-19 04:25:24--  http://cn2.php.net/distributions/php-5.6.30.tar.bz2
Resolving cn2.php.net (cn2.php.net)... 123.125.23.169, 123.125.23.172, 123.125.23.168, ...
Connecting to cn2.php.net (cn2.php.net)|123.125.23.169|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15011816 (14M) [application/octet-stream]
Saving to: ‘php-5.6.30.tar.bz2’100%[======================================================================================>] 15,011,816   367KB/s   in 47s    2017-12-19 04:26:11 (313 KB/s) - ‘php-5.6.30.tar.bz2’ saved [15011816/15011816][root@localhost src]# bzip2 -d php-5.6.30.tar.bz2
[root@localhost src]# tar -xf php-5.6.30.tar
[root@localhost src]# cd php-5.6.30/
[root@localhost php-5.6.30]# ./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#编译过程...
[root@localhost php-5.6.30]# echo $?
1

编译过程会存在错误,就需要添加对应库

安装依赖库

configure: error: xml2-config not found. Please check your libxml2 installation.‘
[root@localhost php-5.6.30]# yum install -y libxml2-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* epel: mirror.rise.ph
Resolving Dependencies
--> Running transaction check
---> Package libxml2-devel.x86_64 0:2.9.1-6.el7_2.3 will be installed
--> Processing Dependency: libxml2 = 2.9.1-6.el7_2.3 for package: libxml2-devel-2.9.1-6.el7_2.3.x86_64
--> Processing Dependency: xz-devel for package: libxml2-devel-2.9.1-6.el7_2.3.x86_64
--> Running transaction check
---> Package libxml2.x86_64 0:2.9.1-5.el7 will be updated
---> Package libxml2.x86_64 0:2.9.1-6.el7_2.3 will be an update
---> Package xz-devel.x86_64 0:5.2.2-1.el7 will be installed
--> Processing Dependency: xz-libs = 5.2.2-1.el7 for package: xz-devel-5.2.2-1.el7.x86_64
--> Running transaction check
---> Package xz-libs.x86_64 0:5.1.2-8alpha.el7 will be updated
--> Processing Dependency: xz-libs = 5.1.2-8alpha.el7 for package: xz-5.1.2-8alpha.el7.x86_64
---> Package xz-libs.x86_64 0:5.2.2-1.el7 will be an update
--> Running transaction check
---> Package xz.x86_64 0:5.1.2-8alpha.el7 will be updated
---> Package xz.x86_64 0:5.2.2-1.el7 will be an update
--> Finished Dependency ResolutionDependencies Resolved================================================================================================================================Package                          Arch                      Version                               Repository               Size
================================================================================================================================
Installing:libxml2-devel                    x86_64                    2.9.1-6.el7_2.3                       base                    1.0 M
Installing for dependencies:xz-devel                         x86_64                    5.2.2-1.el7                           base                     46 k
Updating for dependencies:libxml2                          x86_64                    2.9.1-6.el7_2.3                       base                    668 kxz                               x86_64                    5.2.2-1.el7                           base                    229 kxz-libs                          x86_64                    5.2.2-1.el7                           base                    103 kTransaction Summary
================================================================================================================================
Install  1 Package  (+1 Dependent package)
Upgrade             ( 3 Dependent packages)Total download size: 2.1 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/5): libxml2-2.9.1-6.el7_2.3.x86_64.rpm                                                                | 668 kB  00:00:02     
(2/5): xz-5.2.2-1.el7.x86_64.rpm                                                                         | 229 kB  00:00:01     
(3/5): libxml2-devel-2.9.1-6.el7_2.3.x86_64.rpm                                                          | 1.0 MB  00:00:03     
(4/5): xz-devel-5.2.2-1.el7.x86_64.rpm                                                                   |  46 kB  00:00:00     
(5/5): xz-libs-5.2.2-1.el7.x86_64.rpm                                                                    | 103 kB  00:00:00     
--------------------------------------------------------------------------------------------------------------------------------
Total                                                                                           470 kB/s | 2.1 MB  00:00:04     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionUpdating   : xz-libs-5.2.2-1.el7.x86_64                                                                                   1/8 Installing : xz-devel-5.2.2-1.el7.x86_64                                                                                  2/8 Updating   : libxml2-2.9.1-6.el7_2.3.x86_64                                                                               3/8 Installing : libxml2-devel-2.9.1-6.el7_2.3.x86_64                                                                         4/8 Updating   : xz-5.2.2-1.el7.x86_64                                                                                        5/8 Cleanup    : xz-5.1.2-8alpha.el7.x86_64                                                                                   6/8 Cleanup    : libxml2-2.9.1-5.el7.x86_64                                                                                   7/8 Cleanup    : xz-libs-5.1.2-8alpha.el7.x86_64                                                                              8/8 Verifying  : xz-devel-5.2.2-1.el7.x86_64                                                                                  1/8 Verifying  : libxml2-devel-2.9.1-6.el7_2.3.x86_64                                                                         2/8 Verifying  : libxml2-2.9.1-6.el7_2.3.x86_64                                                                               3/8 Verifying  : xz-5.2.2-1.el7.x86_64                                                                                        4/8 Verifying  : xz-libs-5.2.2-1.el7.x86_64                                                                                   5/8 Verifying  : libxml2-2.9.1-5.el7.x86_64                                                                                   6/8 Verifying  : xz-5.1.2-8alpha.el7.x86_64                                                                                   7/8 Verifying  : xz-libs-5.1.2-8alpha.el7.x86_64                                                                              8/8 Installed:libxml2-devel.x86_64 0:2.9.1-6.el7_2.3                                                                                        Dependency Installed:xz-devel.x86_64 0:5.2.2-1.el7                                                                                                 Dependency Updated:libxml2.x86_64 0:2.9.1-6.el7_2.3              xz.x86_64 0:5.2.2-1.el7              xz-libs.x86_64 0:5.2.2-1.el7             Complete!

然后再编译一次,直到成功

configure: error: Please reinstall the BZip2 distribution
[root@localhost php-5.6.30]# yum install -y bzip2-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* epel: mirror.vinahost.vn
Resolving Dependencies
--> Running transaction check
---> Package bzip2-devel.x86_64 0:1.0.6-13.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved================================================================================================================================Package                          Arch                        Version                           Repository                 Size
================================================================================================================================
Installing:bzip2-devel                      x86_64                      1.0.6-13.el7                      base                      218 kTransaction Summary
================================================================================================================================
Install  1 PackageTotal download size: 218 k
Installed size: 382 k
Downloading packages:
bzip2-devel-1.0.6-13.el7.x86_64.rpm                                                                      | 218 kB  00:00:03     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : bzip2-devel-1.0.6-13.el7.x86_64                                                                              1/1 Verifying  : bzip2-devel-1.0.6-13.el7.x86_64                                                                              1/1 Installed:bzip2-devel.x86_64 0:1.0.6-13.el7                                                                                             Complete!
configure: error: jpeglib.h not found.
[root@localhost php-5.6.30]# yum install -y libjpeg-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* epel: mirror01.idc.hinet.net
Resolving Dependencies
--> Running transaction check
---> Package libjpeg-turbo-devel.x86_64 0:1.2.90-5.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved================================================================================================================================Package                                Arch                      Version                         Repository               Size
================================================================================================================================
Installing:libjpeg-turbo-devel                    x86_64                    1.2.90-5.el7                    base                     98 kTransaction Summary
================================================================================================================================
Install  1 PackageTotal download size: 98 k
Installed size: 314 k
Downloading packages:
libjpeg-turbo-devel-1.2.90-5.el7.x86_64.rpm                                                              |  98 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : libjpeg-turbo-devel-1.2.90-5.el7.x86_64                                                                      1/1 Verifying  : libjpeg-turbo-devel-1.2.90-5.el7.x86_64                                                                      1/1 Installed:libjpeg-turbo-devel.x86_64 0:1.2.90-5.el7                                                                                     Complete!
configure: error: png.h not found.
[root@localhost php-5.6.30]# yum install -y libpng-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* epel: mirror01.idc.hinet.net
Resolving Dependencies
--> Running transaction check
---> Package libpng-devel.x86_64 2:1.5.13-7.el7_2 will be installed
--> Finished Dependency ResolutionDependencies Resolved================================================================================================================================Package                         Arch                      Version                                Repository               Size
================================================================================================================================
Installing:libpng-devel                    x86_64                    2:1.5.13-7.el7_2                       base                    122 kTransaction Summary
================================================================================================================================
Install  1 PackageTotal download size: 122 k
Installed size: 211 k
Downloading packages:
libpng-devel-1.5.13-7.el7_2.x86_64.rpm                                                                   | 122 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : 2:libpng-devel-1.5.13-7.el7_2.x86_64                                                                         1/1 Verifying  : 2:libpng-devel-1.5.13-7.el7_2.x86_64                                                                         1/1 Installed:libpng-devel.x86_64 2:1.5.13-7.el7_2                                                                                          Complete!
configure: error: freetype-config not found
[root@localhost php-5.6.30]# yum install -y freetype-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* epel: mirror01.idc.hinet.net
Resolving Dependencies
--> Running transaction check
---> Package freetype-devel.x86_64 0:2.4.11-15.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved================================================================================================================================Package                            Arch                       Version                           Repository                Size
================================================================================================================================
Installing:freetype-devel                     x86_64                     2.4.11-15.el7                     base                     356 kTransaction Summary
================================================================================================================================
Install  1 PackageTotal download size: 356 k
Installed size: 2.4 M
Downloading packages:
freetype-devel-2.4.11-15.el7.x86_64.rpm                                                                  | 356 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : freetype-devel-2.4.11-15.el7.x86_64                                                                          1/1 Verifying  : freetype-devel-2.4.11-15.el7.x86_64                                                                          1/1 Installed:freetype-devel.x86_64 0:2.4.11-15.el7                                                                                         Complete!
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
[root@localhost php-5.6.30]# yum install -y libmcrypt-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* epel: mirror01.idc.hinet.net
Resolving Dependencies
--> Running transaction check
---> Package libmcrypt-devel.x86_64 0:2.5.8-13.el7 will be installed
--> Processing Dependency: libmcrypt = 2.5.8-13.el7 for package: libmcrypt-devel-2.5.8-13.el7.x86_64
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: libmcrypt-devel-2.5.8-13.el7.x86_64
--> Running transaction check
---> Package libmcrypt.x86_64 0:2.5.8-13.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved================================================================================================================================Package                             Arch                       Version                          Repository                Size
================================================================================================================================
Installing:libmcrypt-devel                     x86_64                     2.5.8-13.el7                     epel                      13 k
Installing for dependencies:libmcrypt                           x86_64                     2.5.8-13.el7                     epel                      99 kTransaction Summary
================================================================================================================================
Install  1 Package (+1 Dependent package)Total download size: 112 k
Installed size: 302 k
Downloading packages:
(1/2): libmcrypt-devel-2.5.8-13.el7.x86_64.rpm                                                           |  13 kB  00:00:00     
(2/2): libmcrypt-2.5.8-13.el7.x86_64.rpm                                                                 |  99 kB  00:00:00     
--------------------------------------------------------------------------------------------------------------------------------
Total                                                                                           112 kB/s | 112 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : libmcrypt-2.5.8-13.el7.x86_64                                                                                1/2 Installing : libmcrypt-devel-2.5.8-13.el7.x86_64                                                                          2/2 Verifying  : libmcrypt-devel-2.5.8-13.el7.x86_64                                                                          1/2 Verifying  : libmcrypt-2.5.8-13.el7.x86_64                                                                                2/2 Installed:libmcrypt-devel.x86_64 0:2.5.8-13.el7                                                                                         Dependency Installed:libmcrypt.x86_64 0:2.5.8-13.el7                                                                                               Complete!

上面的包依赖于epel-release的扩展源,必须先安装

[root@localhost php-5.6.30]# ./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#编译过程...
[root@localhost php-5.6.30]# echo $?0
[root@localhost php-5.6.30]# make && make install#编译过程...
[root@localhost php-5.6.30]# echo $?0
[root@localhost php-5.6.30]# ls /usr/local/php
bin  etc  include  lib  php
[root@localhost php-5.6.30]# du -sh /usr/local/php/bin/php
36M	/usr/local/php/bin/php
[root@localhost php-5.6.30]# du -sh /usr/local/apache2.4/modules/libphp5.so 
37M	/usr/local/apache2.4/modules/libphp5.so

静态模块

[root@localhost 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]

对比apache

[root@localhost php-5.6.30]# /usr/local/apache2.4/b -M
bin/   build/ 
[root@localhost php-5.6.30]# /usr/local/apache2.4/bin/httpd -M
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. 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)

apache配置文件

[root@localhost php-5.6.30]# vi /usr/local/apache2.4/conf/httpd.conf/php5.so152 LoadModule php5_module        modules/libphp5.so
[root@localhost php-5.6.30]# /usr/local/php/bin/php -i | lessphpinfo()
PHP Version => 5.6.30System => Linux localhost.localdomain 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64
Build Date => Dec 19 2017 05:07:49
Configure Command =>  './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'
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => /usr/local/php/etc:
[root@localhost php-5.6.30]# ls /usr/local/php/etc/
pear.conf

但并没有加载任何配置,因为/usr/local/php/etc为空

[root@localhost php-5.6.30]# cp php.ini-production  /usr/local/php/etc/php.ini
Build Date => Dec 19 2017 05:07:49

php.ini-development开发环境使用 php.ini-production生产环境使用

[root@localhost php-5.6.30]# /usr/local/php/bin/php -i | less
Configure Command =>  './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'
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => /usr/local/php/etc
:PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0

将date.timezone = Asia/Shanghai

安装PHP7

  • cd /usr/local/src/
  • wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2
  • tar jxf php-7.1.6.tar.bz2
  • ./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
[root@localhost php-5.6.30]# cd /usr/local/src/
[root@localhost src]# wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2
--2017-11-03 23:10:53--  http://cn2.php.net/distributions/php-7.1.6.tar.bz2
Resolving cn2.php.net (cn2.php.net)... 123.125.23.169, 123.125.23.171, 123.125.23.172, ...
Connecting to cn2.php.net (cn2.php.net)|123.125.23.169|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15732452 (15M) [application/octet-stream]
Saving to: ‘php-7.1.6.tar.bz2’100%[=============================================>] 15,732,452  3.53MB/s   in 6.0s   2017-11-03 23:10:59 (2.48 MB/s) - ‘php-7.1.6.tar.bz2’ saved [15732452/15732452]
[root@localhost src]# tar jxf php-7.1.6.tar.bz2 
[root@localhost src]# cd php-7.1.6/
[root@localhost php-7.1.6]# ./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#编译过程...
[root@localhost php-7.1.6]# make && make install#编译过程...
[root@localhost php-7.1.6]# du -sh /usr/local/apache2.4/modules/libphp7.so 
37M	/usr/local/apache2.4/modules/libphp7.so
[root@localhost php-7.1.6]# /usr/local/php7/bin/php -m
[PHP Modules]
bz2
Core
ctype
date
dom
exif
fileinfo
filter
gd
hash
iconv
json
libxml
mbstring
mcrypt
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]

与php5加载的模块是一致的

查看apache加载的php

[root@localhost php-7.1.6]# /usr/local/apache2.4/bin/apachectl -M
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. 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)
[root@localhost php-7.1.6]# vi /usr/local/apache2.4/conf/httpd.conf145 #LoadModule negotiation_module modules/mod_negotiation.so146 LoadModule dir_module modules/mod_dir.so147 #LoadModule actions_module modules/mod_actions.so148 #LoadModule speling_module modules/mod_speling.so149 #LoadModule userdir_module modules/mod_userdir.so150 LoadModule alias_module modules/mod_alias.so151 #LoadModule rewrite_module modules/mod_rewrite.so152 LoadModule php5_module        modules/libphp5.so153 LoadModule php7_module        modules/libphp7.so154 155 <IfModule unixd_module>156 #157 # If you wish httpd to run as a different user or group, you must run158 # httpd as root initially and it will switch.159 #160 # User/Group: The name (or #number) of the user/group to run httpd as.

若不使用有不使用则注释那一行

    145 #LoadModule negotiation_module modules/mod_negotiation.so146 LoadModule dir_module modules/mod_dir.so147 #LoadModule actions_module modules/mod_actions.so148 #LoadModule speling_module modules/mod_speling.so149 #LoadModule userdir_module modules/mod_userdir.so150 LoadModule alias_module modules/mod_alias.so151 #LoadModule rewrite_module modules/mod_rewrite.so152 LoadModule php5_module        modules/libphp5.so153 #LoadModule php7_module        modules/libphp7.so154 155 <IfModule unixd_module>156 #157 # If you wish httpd to run as a different user or group, you must run158 # httpd as root initially and it will switch.159 #160 # User/Group: The name (or #number) of the user/group to run httpd as.
[root@localhost php-7.1.6]# cp php.ini-production /usr/local/php7/etc/php.ini
[root@localhost php-7.1.6]# /usr/local/php7/bin/php -i | less
phpinfo()
PHP Version => 7.1.6System => Linux localhost.localdomain 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64
Build Date => Nov  3 2017 23:24:40
Configure Command =>  './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'
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => /usr/local/php7/etc
Loaded Configuration File => /usr/local/php7/etc/php.ini

修改与171219

转载于:https://my.oschina.net/hellopasswd/blog/1591683

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/539792.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Linux修改文件内容【命令】

在/opt/hello/world.txt文件中增加一行 hello linux world ! 方法一&#xff1a; 命令是&#xff1a;vi&#xff0c;vim vi 编辑器&#xff0c;相当于记事本&#xff0c;有编辑功能&#xff0c;但较弱 vim 复杂的编辑器&#xff0c;相当于windows的 editplus, notepad 等 …

hadoop中的9000端口代表什么_hadoop服务快速部署

这篇文章记录下针对不同的hadoop版本进行服务部署的过程&#xff0c;希望可以帮到你们安装docker hadoop2.7.0一键部署docker hadoop3.0.0集群(一个master 三个slave)安装docker hadoop 3.2.0 a、docker启动 b、docker compose方式启动安装hadoop 2.7.0版本安装命令docker run …

迷你世界电锯机器人_迷你世界:生产果冻的机器人,1分钟产出500个,10种口味随意挑选...

迷你世界是一款具有创意性和想象力的3D沙盒游戏&#xff0c;在游戏中玩家们总是能造出各种好玩的建筑物&#xff0c;毕竟背包里拥有成百上千的道具可供玩家们随意使用&#xff0c;而且一些道具相互叠加使用&#xff0c;还能产生更有趣的效果。近日就有一位大神使用多种道具&…

底层实现红黑树_图解:红黑树

注&#xff1a;本文比较硬核但是很值得大家花心思看完&#xff0c;看完你一定会有所收获的红黑树是面试中一个很经典也很有难度的知识点&#xff0c;网传字节跳动面试官最喜欢问这个问题。很多人会觉得这个知识点太难&#xff0c;不想花太多功夫去了解&#xff0c;也有人会认为…

处于停机等非正常状态_一文聊透 Dubbo 优雅停机

1 前言一年之前&#xff0c;我曾经写过一篇《研究优雅停机时的一点思考》&#xff0c;主要介绍了 kill -9&#xff0c;kill -15 两个 Linux 指令的含义&#xff0c;并且针对性的聊到了 Spring Boot 应用如何正确的优雅停机&#xff0c;算是本文的前置文章&#xff0c;如果你对上…

WinDbg 命令三部曲:(一)WinDbg 命令手册

《WinDbg 命令三部曲&#xff1a;&#xff08;一&#xff09;WinDbg 命令手册》《WinDbg 命令三部曲&#xff1a;&#xff08;二&#xff09;WinDbg SOS 扩展命令手册》《WinDbg 命令三部曲&#xff1a;&#xff08;三&#xff09;WinDbg SOSEX 扩展命令手册》导航目录 内置帮助…

华为手机的分类有何区别_“鸿蒙”系统能不能玩安卓游戏?如果能,它跟安卓系统有何区别?...

“鸿蒙”系统能不能玩安卓游戏&#xff1f;如果能&#xff0c;它跟安卓系统有何区别&#xff1f;笔者其实挺好奇一件事情&#xff0c;按理来说&#xff0c;华为即将推出“鸿蒙”系统&#xff0c;作为一款真正的国产系统&#xff0c;笔者肯定是要支持的&#xff0c;毕竟我自己使…

200t不稳定_技术革新!将不可能变为可能 这家企业是怎么做到的?

据水泥人网了解&#xff0c;每年的第四季度是整个水泥行业的高峰期&#xff0c;尤其是北方地区各大水泥集团都将会进入错峰停产和检修期&#xff0c;烧成技术改造往往是水泥企业技改过程最为重要的环节&#xff0c;如何做好烧成技术改造成为水泥企业必须要面对的问题。针对目前…

取消计算机触摸板,笔记本电脑触摸板如何打开和关闭

笔记本电脑触摸板怎么打开和关闭&#xff1f;现在用笔记本的用户都越来越多了&#xff0c;现在也有人把笔记本当电视使了。就是电视上看得到用笔记本联网也是能看到&#xff0c;电视看不到的笔记本电脑也能看到。但是笔记本上面有一个触摸板&#xff0c;现相信大家都用过。可是…

QQ显示服务器繁忙2013,在QQ空间发表日志的之后为什么样总是显示“服务器繁忙”?...

据小米方面介绍&#xff0c;小米手机认证空间帐号自2013年5月21日开通以来&#xff0c;框架&#xff0c;8mm加厚钢化玻璃&#xff0c;15mm防火板材质机壳3、在QQ空间发表日志的之后为什么总是显示“服务器繁忙”&#xff0c;发表不了日志&#xff1f;这个难题在我家电脑下终于存…

oracle更改编码

背景&#xff1a;win764bit英文操作系统&#xff08;支持中文&#xff09;   oracle11G默认安装   从ZHS16GBK字符集导入数据库表现&#xff1a;plsql显示为乱码解决&#xff1a;1、查看并更改数据库的编码为ZHS16GBK $sqlplus system/oracleSQL> select * from v$nls…

she is so css什么意思,输入she is so什么意思 微信she is so什么梗

最近很多人都在微信玩she is so的小游戏&#xff0c;会出现很多不同的形容词很有趣&#xff0c;适合好友之间一起玩。而不少人也不明白输入she is so是什么意思&#xff1f;该怎么玩呢&#xff1f;下文具体介绍。微信输入she is so是什么意思在微信聊天对话框中输入she /he is …

vs2017下开发C++MFC动态库实现

2019独角兽企业重金招聘Python工程师标准>>> 今天无意间浏览了一些关于vs2017新功能的介绍&#xff0c;特别是微软发部了Visual Studio Installer&#xff0c;这个集成安装工具简约的操作风格&#xff0c;丰富vs开发内容&#xff0c;真正打通了开发的“最后一公里”…

hadoop为什么出现

在很多领域里面&#xff0c;在现在这个时代下面&#xff0c;很多公司产生的数据太多了&#xff0c;数据量太大了。用原来的技术去做&#xff0c;有种捉襟见肘的感觉&#xff0c;要么在性能上面&#xff0c;要么在速度上面遇到了瓶颈&#xff0c;这个时候需要新的技术来解决&…

微信视频开发jquery mobile

功能 微信企业号里开发一个微视频功能&#xff0c;用于播放视频。技术 J2EE&#xff0c;前端ui是jquerymobile&#xff0c;HTML5&#xff0c;CSS3&#xff0c;开源视频插件&#xff1a;mediaelement-and-player.min.js 插件官网&#xff1a;http://www.mediaelementjs.com/视…

eclipse中tomcat服务器locations不能修改,解决eclipse中Tomcat服务器的server location选项不能修改的问题...

解决eclipse中Tomcat服务器的server location选项不能修改的问题问题描述编辑tomcat服务器时&#xff0c;server locations无法编辑&#xff0c;如下图&#xff1a;解决方法在Eclipse菜单栏中选择window — show view — server 可以看到服务的面板&#xff0c;服务面板中可看到…

当create table as select 遇上大数据

统计24小时的红包感知专题&#xff0c;有1.5亿行以上的数据&#xff0c;Nokia给出的方法是先按小时执行算法&#xff0c;再汇总各个小时的执行结果。 算法中包含了大量的 sum(case when)计算。 专题里有5个小节&#xff0c;执行计划的时候&#xff0c;需要跑5次where条件不同…

mybatis源码分析(方法调用过程)

十一月月底&#xff0c;宿舍楼失火啦&#xff0c;搞得20多天没有网&#xff0c;目测直到放假也不会来了。。。 正题 嗯~&#xff0c;其实阅读源码不是为了应付面试&#xff0c;更重要的让你知道&#xff0c;大师是怎样去写代码的&#xff0c;同样是用Java&#xff0c;为啥Clint…

提取多个字段_动态合并多个工作表,数据再多也不怕

小伙伴们好啊&#xff0c;今天老祝和大家分享一个动态合并多个工作表的技巧。很多时候&#xff0c;咱们的数据是按照部门或是月份等项目&#xff0c;分别存放在不同工作表中的&#xff0c;要对这些数据进行分析汇总的时候&#xff0c;需要先将不同工作表中的数据合并到一起才可…

2017-2018-1 20155229 《信息安全系统设计基础》第十四周学习总结

2017-2018-1 20155229 《信息安全系统设计基础》第十四周学习总结 对“第三章 程序机器级表示”的深入学习 我选择这章的理由是第一次学的时候还是不太理解&#xff0c;老师也有说这章建议在认真学习&#xff0c;所以本周的学习任务是认真再次学习这一章c语言、汇编代码以及机器…