【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.pswp.cn/news/539792.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/539792.shtml
英文地址,請注明出處:http://en.pswp.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;如何做好燒成技術改造成為水泥企業必須要面對的問題。針對目前…