【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删除文件和文件夹【命令】

1、删除文件夹&#xff1a;rm -r /opt/hello 将会删除/opt/hello目录以及其下所有文件、文件夹 2、删除文件&#xff1a;rm -f /opt/hello/world.txt 将会强制删除/opt/hello/world.txt这个文件 使用这个rm 的时候一定要格外小心&#xff0c;linux没有回收站,以至于删除之后…

Linux修改文件内容【命令】

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

计算机机房管理具体工作和职责,机房管理

心得体会是指一种读书、实践后所写的感受性文字。体会是指将学习的东西运用到实践中去&#xff0c;通过实践反思学习内容并记录下来的文字。下面是出国留学网小编带来的机房管理工作心得体会范文&#xff0c;欢迎阅读参考。机房管理工作心得体会(一)学校计算机房是信息技术教学…

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 …

来自我的破船大大的博客,记录他的iOS成长之路,与君同勉!

注1&#xff1a;这篇文章是我的iOS成长之路系列文章中的第三篇文章&#xff0c;第一篇文章&#xff1a;iOS成长之路-1-入门&#xff0c;第二篇文章&#xff1a;iOS成长之路-2-我的第一个iOS Demo。通过两周时间来学习iOS&#xff0c;我慢慢的叩开了iOS开发的大门&#xff0c;接…

Linux下Oracle移植数据

案例&#xff1a; 老LTESQM数据库下的toolbox用户数据移植到 新LTESQM数据库下的 toolbox 用户。 新LTESQM数据库下还没有toolbox这个用户 开始&#xff1a; 1、查看老LTESQM下toolbox的权限 用oracle数据库dba角色登录&#xff0c;查看用户toolbox的sql。 使用sqldevelo…

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

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

电脑计算机显示向程序发送命令时出现问题,word提示向程序发送命令时出现问题怎么解决 wo...

word提示向程序发送命令时出现问题怎么解决 word提示向程序发送命令时出现问题解决方法 我们的生活中越来越离不开电脑&#xff0c;但在使用电脑的过程中总会遇到各种各样的问题。知识屋致力于给电脑小白朋友们介绍一些简单常用问题的解决方法&#xff0c;这次给大家介绍的是wo…

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

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

如何请教问题且以后都会回答你的方法

一、如何请教问题 在网上与人沟通时&#xff0c;学会客气&#xff0c;并且开门见山的把问题说清楚非常必要&#xff0c;还要带上你努力的过程&#xff0c; 并且尽量不要问开放式的问题&#xff0c;例如&#xff1a;你问一句&#xff0c;回答者可能要10句才能解答的问题不要问…

计算机编程方程求解的步骤,计算机解决问题的过程PPT学习课件

《计算机解决问题的过程PPT学习课件》由会员分享&#xff0c;可在线阅读&#xff0c;更多相关《计算机解决问题的过程PPT学习课件(17页珍藏版)》请在人人文库网上搜索。1、计算机解决问题的过程包括&#xff1a;编程&#xff0c;1&#xff0c;同&#xff0c;2&#xff0c;1&…

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

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

Centos 配置eth0 提示Device does not seem to be present

一.故障现象&#xff1a;[rootc1node01 ~]# service network restartShutting down loopback insterface: [ OK ]Bringing up loopback insterface: [ …

计算机boot进入u盘启动,暗影精灵5怎么设置u盘启动 暗影精灵5设置u盘启动方法...

最近有位电脑用户想要使用u盘启动盘重装系统&#xff0c;但是却不知道应该怎么使用bios设置u盘启动&#xff0c;为此非常苦恼&#xff0c;那么惠普暗影精灵5 omen 15-dc1068tx笔记本怎么使用bios设置u盘启动呢?下面为大家介绍惠普暗影精灵5 omen 15-dc1068tx笔记本使用bios设置…

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;毕竟我自己使…

MyEclipse2014破解

MyEclipse下载地址&#xff1a; http://www.xp85.com/html/MyEclipse2014.html 破解教程http://jingyan.baidu.com/article/7082dc1c57eb19e40a89bdcd.html

计算机模拟蛋白,酶的计算机模拟和蛋白质组分析

报告题目&#xff1a;Computer Simulation of Enzymes and Analysis of Proteomes/Protein Sets(酶的计算机模拟和蛋白质组分析)主讲人&#xff1a;郭鸿主讲人简介&#xff1a;Professor, Department of Biochemistry & Cellular and Molecular Biology, University of Ten…

分块编码(Transfer-Encoding: chunked)VS Content-length

参考链接&#xff1a; HTTP 协议中的 Transfer-Encoding 分块传输编码 https://www.cnblogs.com/xuehaoyue/p/6639029.html 一、背景&#xff1a; 持续连接的问题&#xff1a;对于非持续连接&#xff0c;浏览器可以通过连接是否关闭来界定请求或响应实体的边界&#xff1b;而…

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

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