一 下载并软件包

wget http://124.205.69.169/files/A218000006E9730A/cn2.php.net/distributions/php-7.2.8.tar.gz
tar xf php-7.2..tar.gz
cd php-7.2.

二 安装依赖程序

yum -y install pcre pcre-devel openssl openssl-devel libicu-devel gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses ncurses-devel curl curl-devel krb5-devel libidn libidn-devel openldap openldap-devel nss_ldap jemalloc-devel cmake boost-devel bison automake libevent libevent-devel gd gd-devel libtool* libmcrypt libmcrypt-devel mcrypt mhash libxslt libxslt-devel readline readline-devel gmp gmp-devel libcurl libcurl-devel openjpeg-devel

安装 libsodium-1.0.16.tar.gz yum安装报错编译安装

下载地址:https://github.com/jedisct1/libsodium/releases

tar xf libsodium-1.0..tar.gz
cd libsodium-1.0./
./configure
make -j && make install
ldconfig

三 编译安装

部分编译注释 ===>>点击进入

[root@centos7 php-7.2.]# ./configure --prefix=/usr/local/php-7.2. --with-config-file-path=/usr/local/php-7.2./etc --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-gmp --with-snmp --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --with-curl  --with-sodium --with-gd --with-openssl --with-mhash --with-xmlrpc --with-xsl --with-gettext --enable-pcntl --enable-sockets --enable-zip --enable-soap --enable-fpm --enable-mysqlnd --enable-ftp --enable-intl --enable-xml --enable-bcmath --enable-shmop --enable-exif --enable-sysvsem --enable-mbregex --enable-mbstring --enable-maintainer-zts --enable-inline-optimization --disable-debug --disable-rpath --disable-opcache --disable-fileinfo
[root@centos7 php-7.2.]# echo $? [root@centos7 php-7.2.]# make -j
[root@centos7 php-7.2.]# echo $? [root@centos7 php-7.2.]# make install
[root@centos7 php-7.2.]# echo $?
0

在编译PHP过程中,编译php时,如果指定以下几个参数
--with-mysql=mysqlnd
--with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd
表示使用mysqlnd驱动。

 

四 拷贝默认php配置文件

[root@centos7 php-7.2.]# cp php.ini-development /usr/local/php-7.2./etc/php.ini
[root@centos7 php-7.2.]# cp /usr/local/php-7.2./etc/php-fpm.conf.default /usr/local/php-7.2./etc/php-fpm.conf
[root@centos7 php-7.2.]# cp /usr/local/php-7.2./etc/php-fpm.d/www.conf.default /usr/local/php-7.2./etc/php-fpm.d/www.conf

五 查看目录

[root@centos7 php-7.2.]# cd /usr/local/php-7.2./
[root@centos7 php-7.2.]# tree
.
├── bin
│   ├── pear
│   ├── peardev
│   ├── pecl
│   ├── phar -> phar.phar
│   ├── phar.phar
│   ├── php
│   ├── php-cgi
│   ├── php-config
│   ├── phpdbg
│   └── phpize
├── etc
│   ├── pear.conf
│   ├── php-fpm.conf
│   ├── php-fpm.conf.default
│   ├── php-fpm.d
│   │   ├── www.conf
│   │   └── www.conf.default
│   └── php.ini
├── include
│   └── php
│   ├── ext
│   │   ├── date
│   │   │   ├── lib
│   │   │   │   ├── timelib_config.h
│   │   │   │   └── timelib.h
│   │   │   └── php_date.h
│   │   ├── dom
│   │   │   └── xml_common.h
│   │   ├── filter
│   │   │   └── php_filter.h
│   │   ├── gd
│   │   │   ├── gdcache.h
│   │   │   ├── gd_compat.h
│   │   │   ├── libgd
│   │   │   │   ├── bmp.h
│   │   │   │   ├── gdcache.h
│   │   │   │   ├── gd_errors.h
│   │   │   │   ├── gdfontg.h
│   │   │   │   ├── gdfontl.h
│   │   │   │   ├── gdfontmb.h
│   │   │   │   ├── gdfonts.h
│   │   │   │   ├── gdfontt.h
│   │   │   │   ├── gd.h
│   │   │   │   ├── gdhelpers.h
│   │   │   │   ├── gd_intern.h
│   │   │   │   ├── gd_io.h
│   │   │   │   ├── jisx0208.h
│   │   │   │   └── wbmp.h
│   │   │   └── php_gd.h
│   │   ├── hash
│   │   │   ├── php_hash_adler32.h
│   │   │   ├── php_hash_crc32.h
│   │   │   ├── php_hash_fnv.h
│   │   │   ├── php_hash_gost.h
│   │   │   ├── php_hash.h
│   │   │   ├── php_hash_haval.h
│   │   │   ├── php_hash_joaat.h
│   │   │   ├── php_hash_md.h
│   │   │   ├── php_hash_ripemd.h
│   │   │   ├── php_hash_sha3.h
│   │   │   ├── php_hash_sha.h
│   │   │   ├── php_hash_snefru.h
│   │   │   ├── php_hash_tiger.h
│   │   │   └── php_hash_whirlpool.h
│   │   ├── iconv
│   │   │   ├── php_have_bsd_iconv.h
│   │   │   ├── php_have_glibc_iconv.h
│   │   │   ├── php_have_ibm_iconv.h
│   │   │   ├── php_have_iconv.h
│   │   │   ├── php_have_libiconv.h
│   │   │   ├── php_iconv_aliased_libiconv.h
│   │   │   ├── php_iconv_broken_ignore.h
│   │   │   ├── php_iconv.h
│   │   │   ├── php_iconv_supports_errno.h
│   │   │   ├── php_php_iconv_h_path.h
│   │   │   └── php_php_iconv_impl.h
│   │   ├── json
│   │   │   ├── php_json.h
│   │   │   ├── php_json_parser.h
│   │   │   └── php_json_scanner.h
│   │   ├── libxml
│   │   │   └── php_libxml.h
│   │   ├── mbstring
│   │   │   ├── libmbfl
│   │   │   │   ├── config.h
│   │   │   │   └── mbfl
│   │   │   │   ├── eaw_table.h
│   │   │   │   ├── mbfilter_8bit.h
│   │   │   │   ├── mbfilter.h
│   │   │   │   ├── mbfilter_pass.h
│   │   │   │   ├── mbfilter_wchar.h
│   │   │   │   ├── mbfl_allocators.h
│   │   │   │   ├── mbfl_consts.h
│   │   │   │   ├── mbfl_convert.h
│   │   │   │   ├── mbfl_defs.h
│   │   │   │   ├── mbfl_encoding.h
│   │   │   │   ├── mbfl_filter_output.h
│   │   │   │   ├── mbfl_ident.h
│   │   │   │   ├── mbfl_language.h
│   │   │   │   ├── mbfl_memory_device.h
│   │   │   │   └── mbfl_string.h
│   │   │   ├── mbstring.h
│   │   │   ├── oniguruma
│   │   │   │   └── oniguruma.h
│   │   │   ├── php_mbregex.h
│   │   │   └── php_onig_compat.h
│   │   ├── mysqli
│   │   │   ├── mysqli_mysqlnd.h
│   │   │   └── php_mysqli_structs.h
│   │   ├── mysqlnd
│   │   │   ├── config-win.h
│   │   │   ├── mysql_float_to_double.h
│   │   │   ├── mysqlnd_alloc.h
│   │   │   ├── mysqlnd_auth.h
│   │   │   ├── mysqlnd_block_alloc.h
│   │   │   ├── mysqlnd_charset.h
│   │   │   ├── mysqlnd_commands.h
│   │   │   ├── mysqlnd_connection.h
│   │   │   ├── mysqlnd_debug.h
│   │   │   ├── mysqlnd_enum_n_def.h
│   │   │   ├── mysqlnd_ext_plugin.h
│   │   │   ├── mysqlnd.h
│   │   │   ├── mysqlnd_libmysql_compat.h
│   │   │   ├── mysqlnd_plugin.h
│   │   │   ├── mysqlnd_portability.h
│   │   │   ├── mysqlnd_priv.h
│   │   │   ├── mysqlnd_protocol_frame_codec.h
│   │   │   ├── mysqlnd_ps.h
│   │   │   ├── mysqlnd_read_buffer.h
│   │   │   ├── mysqlnd_result.h
│   │   │   ├── mysqlnd_result_meta.h
│   │   │   ├── mysqlnd_reverse_api.h
│   │   │   ├── mysqlnd_statistics.h
│   │   │   ├── mysqlnd_structs.h
│   │   │   ├── mysqlnd_vio.h
│   │   │   ├── mysqlnd_wireprotocol.h
│   │   │   └── php_mysqlnd.h
│   │   ├── pcre
│   │   │   ├── pcrelib
│   │   │   │   ├── config.h
│   │   │   │   ├── pcre.h
│   │   │   │   ├── pcre_internal.h
│   │   │   │   ├── pcreposix.h
│   │   │   │   └── ucp.h
│   │   │   └── php_pcre.h
│   │   ├── pdo
│   │   │   ├── php_pdo_driver.h
│   │   │   ├── php_pdo_error.h
│   │   │   └── php_pdo.h
│   │   ├── phar
│   │   │   └── php_phar.h
│   │   ├── session
│   │   │   ├── mod_files.h
│   │   │   ├── mod_user.h
│   │   │   └── php_session.h
│   │   ├── simplexml
│   │   │   ├── php_simplexml_exports.h
│   │   │   └── php_simplexml.h
│   │   ├── sockets
│   │   │   └── php_sockets.h
│   │   ├── spl
│   │   │   ├── php_spl.h
│   │   │   ├── spl_array.h
│   │   │   ├── spl_directory.h
│   │   │   ├── spl_dllist.h
│   │   │   ├── spl_engine.h
│   │   │   ├── spl_exceptions.h
│   │   │   ├── spl_fixedarray.h
│   │   │   ├── spl_functions.h
│   │   │   ├── spl_heap.h
│   │   │   ├── spl_iterators.h
│   │   │   └── spl_observer.h
│   │   ├── sqlite3
│   │   │   └── libsqlite
│   │   │   └── sqlite3.h
│   │   ├── standard
│   │   │   ├── base64.h
│   │   │   ├── basic_functions.h
│   │   │   ├── crc32.h
│   │   │   ├── credits_ext.h
│   │   │   ├── credits.h
│   │   │   ├── credits_sapi.h
│   │   │   ├── crypt_blowfish.h
│   │   │   ├── crypt_freesec.h
│   │   │   ├── css.h
│   │   │   ├── cyr_convert.h
│   │   │   ├── datetime.h
│   │   │   ├── dl.h
│   │   │   ├── exec.h
│   │   │   ├── file.h
│   │   │   ├── flock_compat.h
│   │   │   ├── fsock.h
│   │   │   ├── head.h
│   │   │   ├── html.h
│   │   │   ├── html_tables.h
│   │   │   ├── info.h
│   │   │   ├── md5.h
│   │   │   ├── microtime.h
│   │   │   ├── pack.h
│   │   │   ├── pageinfo.h
│   │   │   ├── php_array.h
│   │   │   ├── php_assert.h
│   │   │   ├── php_browscap.h
│   │   │   ├── php_crypt.h
│   │   │   ├── php_crypt_r.h
│   │   │   ├── php_dir.h
│   │   │   ├── php_dns.h
│   │   │   ├── php_ext_syslog.h
│   │   │   ├── php_filestat.h
│   │   │   ├── php_fopen_wrappers.h
│   │   │   ├── php_ftok.h
│   │   │   ├── php_http.h
│   │   │   ├── php_image.h
│   │   │   ├── php_incomplete_class.h
│   │   │   ├── php_iptc.h
│   │   │   ├── php_lcg.h
│   │   │   ├── php_link.h
│   │   │   ├── php_mail.h
│   │   │   ├── php_math.h
│   │   │   ├── php_metaphone.h
│   │   │   ├── php_mt_rand.h
│   │   │   ├── php_password.h
│   │   │   ├── php_rand.h
│   │   │   ├── php_random.h
│   │   │   ├── php_smart_string.h
│   │   │   ├── php_smart_string_public.h
│   │   │   ├── php_standard.h
│   │   │   ├── php_string.h
│   │   │   ├── php_type.h
│   │   │   ├── php_uuencode.h
│   │   │   ├── php_var.h
│   │   │   ├── php_versioning.h
│   │   │   ├── proc_open.h
│   │   │   ├── quot_print.h
│   │   │   ├── scanf.h
│   │   │   ├── sha1.h
│   │   │   ├── streamsfuncs.h
│   │   │   ├── uniqid.h
│   │   │   ├── url.h
│   │   │   ├── url_scanner_ex.h
│   │   │   └── winver.h
│   │   └── xml
│   │   ├── expat_compat.h
│   │   └── php_xml.h
│   ├── include
│   ├── main
│   │   ├── build-defs.h
│   │   ├── fastcgi.h
│   │   ├── fopen_wrappers.h
│   │   ├── http_status_codes.h
│   │   ├── php_compat.h
│   │   ├── php_config.h
│   │   ├── php_content_types.h
│   │   ├── php_getopt.h
│   │   ├── php_globals.h
│   │   ├── php.h
│   │   ├── php_ini.h
│   │   ├── php_main.h
│   │   ├── php_memory_streams.h
│   │   ├── php_network.h
│   │   ├── php_open_temporary_file.h
│   │   ├── php_output.h
│   │   ├── php_reentrancy.h
│   │   ├── php_scandir.h
│   │   ├── php_stdint.h
│   │   ├── php_streams.h
│   │   ├── php_syslog.h
│   │   ├── php_ticks.h
│   │   ├── php_variables.h
│   │   ├── php_version.h
│   │   ├── rfc1867.h
│   │   ├── SAPI.h
│   │   ├── snprintf.h
│   │   ├── spprintf.h
│   │   └── streams
│   │   ├── php_stream_context.h
│   │   ├── php_stream_filter_api.h
│   │   ├── php_stream_glob_wrapper.h
│   │   ├── php_stream_mmap.h
│   │   ├── php_stream_plain_wrapper.h
│   │   ├── php_streams_int.h
│   │   ├── php_stream_transport.h
│   │   └── php_stream_userspace.h
│   ├── sapi
│   │   └── cli
│   │   └── cli.h
│   ├── TSRM
│   │   ├── readdir.h
│   │   ├── tsrm_config_common.h
│   │   ├── tsrm_config.h
│   │   ├── tsrm_config.w32.h
│   │   ├── TSRM.h
│   │   ├── tsrm_strtok_r.h
│   │   └── tsrm_win32.h
│   └── Zend
│   ├── zend_alloc.h
│   ├── zend_alloc_sizes.h
│   ├── zend_API.h
│   ├── zend_arena.h
│   ├── zend_ast.h
│   ├── zend_bitset.h
│   ├── zend_build.h
│   ├── zend_builtin_functions.h
│   ├── zend_closures.h
│   ├── zend_compile.h
│   ├── zend_config.h
│   ├── zend_config.nw.h
│   ├── zend_config.w32.h
│   ├── zend_constants.h
│   ├── zend_dtrace.h
│   ├── zend_errors.h
│   ├── zend_exceptions.h
│   ├── zend_execute.h
│   ├── zend_extensions.h
│   ├── zend_float.h
│   ├── zend_gc.h
│   ├── zend_generators.h
│   ├── zend_globals.h
│   ├── zend_globals_macros.h
│   ├── zend.h
│   ├── zend_hash.h
│   ├── zend_highlight.h
│   ├── zend_inheritance.h
│   ├── zend_ini.h
│   ├── zend_ini_parser.h
│   ├── zend_ini_scanner_defs.h
│   ├── zend_ini_scanner.h
│   ├── zend_interfaces.h
│   ├── zend_istdiostream.h
│   ├── zend_iterators.h
│   ├── zend_language_parser.h
│   ├── zend_language_scanner_defs.h
│   ├── zend_language_scanner.h
│   ├── zend_list.h
│   ├── zend_llist.h
│   ├── zend_long.h
│   ├── zend_modules.h
│   ├── zend_multibyte.h
│   ├── zend_multiply.h
│   ├── zend_object_handlers.h
│   ├── zend_objects_API.h
│   ├── zend_objects.h
│   ├── zend_operators.h
│   ├── zend_portability.h
│   ├── zend_ptr_stack.h
│   ├── zend_range_check.h
│   ├── zend_signal.h
│   ├── zend_smart_str.h
│   ├── zend_smart_string.h
│   ├── zend_smart_string_public.h
│   ├── zend_smart_str_public.h
│   ├── zend_sort.h
│   ├── zend_stack.h
│   ├── zend_stream.h
│   ├── zend_string.h
│   ├── zend_strtod.h
│   ├── zend_strtod_int.h
│   ├── zend_ts_hash.h
│   ├── zend_type_info.h
│   ├── zend_types.h
│   ├── zend_variables.h
│   ├── zend_virtual_cwd.h
│   ├── zend_vm_def.h
│   ├── zend_vm_execute.h
│   ├── zend_vm.h
│   └── zend_vm_opcodes.h
├── lib
│   └── php
│   ├── Archive
│   │   └── Tar.php
│   ├── build
│   │   ├── acinclude.m4
│   │   ├── ax_check_compile_flag.m4
│   │   ├── config.guess
│   │   ├── config.sub
│   │   ├── libtool.m4
│   │   ├── ltmain.sh
│   │   ├── Makefile.global
│   │   ├── mkdep.awk
│   │   ├── phpize.m4
│   │   ├── run-tests.php
│   │   ├── scan_makefile_in.awk
│   │   └── shtool
│   ├── Console
│   │   └── Getopt.php
│   ├── data
│   │   └── PEAR
│   │   ├── package.dtd
│   │   └── template.spec
│   ├── doc
│   │   ├── Archive_Tar
│   │   │   └── docs
│   │   │   └── Archive_Tar.txt
│   │   ├── PEAR
│   │   │   ├── INSTALL
│   │   │   ├── LICENSE
│   │   │   └── README.rst
│   │   ├── Structures_Graph
│   │   │   ├── docs
│   │   │   │   └── tutorials
│   │   │   │   └── Structures_Graph
│   │   │   │   └── Structures_Graph.pkg
│   │   │   └── LICENSE
│   │   └── XML_Util
│   │   └── examples
│   │   ├── example2.php
│   │   └── example.php
│   ├── OS
│   │   └── Guess.php
│   ├── PEAR
│   │   ├── Builder.php
│   │   ├── ChannelFile
│   │   │   └── Parser.php
│   │   ├── ChannelFile.php
│   │   ├── Command
│   │   │   ├── Auth.php
│   │   │   ├── Auth.xml
│   │   │   ├── Build.php
│   │   │   ├── Build.xml
│   │   │   ├── Channels.php
│   │   │   ├── Channels.xml
│   │   │   ├── Common.php
│   │   │   ├── Config.php
│   │   │   ├── Config.xml
│   │   │   ├── Install.php
│   │   │   ├── Install.xml
│   │   │   ├── Mirror.php
│   │   │   ├── Mirror.xml
│   │   │   ├── Package.php
│   │   │   ├── Package.xml
│   │   │   ├── Pickle.php
│   │   │   ├── Pickle.xml
│   │   │   ├── Registry.php
│   │   │   ├── Registry.xml
│   │   │   ├── Remote.php
│   │   │   ├── Remote.xml
│   │   │   ├── Test.php
│   │   │   └── Test.xml
│   │   ├── Command.php
│   │   ├── Common.php
│   │   ├── Config.php
│   │   ├── Dependency2.php
│   │   ├── DependencyDB.php
│   │   ├── Downloader
│   │   │   └── Package.php
│   │   ├── Downloader.php
│   │   ├── ErrorStack.php
│   │   ├── Exception.php
│   │   ├── Frontend
│   │   │   └── CLI.php
│   │   ├── Frontend.php
│   │   ├── Installer
│   │   │   ├── Role
│   │   │   │   ├── Cfg.php
│   │   │   │   ├── Cfg.xml
│   │   │   │   ├── Common.php
│   │   │   │   ├── Data.php
│   │   │   │   ├── Data.xml
│   │   │   │   ├── Doc.php
│   │   │   │   ├── Doc.xml
│   │   │   │   ├── Ext.php
│   │   │   │   ├── Ext.xml
│   │   │   │   ├── Man.php
│   │   │   │   ├── Man.xml
│   │   │   │   ├── Php.php
│   │   │   │   ├── Php.xml
│   │   │   │   ├── Script.php
│   │   │   │   ├── Script.xml
│   │   │   │   ├── Src.php
│   │   │   │   ├── Src.xml
│   │   │   │   ├── Test.php
│   │   │   │   ├── Test.xml
│   │   │   │   ├── Www.php
│   │   │   │   └── Www.xml
│   │   │   └── Role.php
│   │   ├── Installer.php
│   │   ├── PackageFile
│   │   │   ├── Generator
│   │   │   │   ├── v1.php
│   │   │   │   └── v2.php
│   │   │   ├── Parser
│   │   │   │   ├── v1.php
│   │   │   │   └── v2.php
│   │   │   ├── v1.php
│   │   │   ├── v2
│   │   │   │   ├── rw.php
│   │   │   │   └── Validator.php
│   │   │   └── v2.php
│   │   ├── PackageFile.php
│   │   ├── Packager.php
│   │   ├── Proxy.php
│   │   ├── Registry.php
│   │   ├── REST
│   │   │   ├── .php
│   │   │   ├── .php
│   │   │   └── .php
│   │   ├── REST.php
│   │   ├── RunTest.php
│   │   ├── Task
│   │   │   ├── Common.php
│   │   │   ├── Postinstallscript
│   │   │   │   └── rw.php
│   │   │   ├── Postinstallscript.php
│   │   │   ├── Replace
│   │   │   │   └── rw.php
│   │   │   ├── Replace.php
│   │   │   ├── Unixeol
│   │   │   │   └── rw.php
│   │   │   ├── Unixeol.php
│   │   │   ├── Windowseol
│   │   │   │   └── rw.php
│   │   │   └── Windowseol.php
│   │   ├── Validate.php
│   │   ├── Validator
│   │   │   └── PECL.php
│   │   └── XMLParser.php
│   ├── pearcmd.php
│   ├── PEAR.php
│   ├── peclcmd.php
│   ├── Structures
│   │   ├── Graph
│   │   │   ├── Manipulator
│   │   │   │   ├── AcyclicTest.php
│   │   │   │   └── TopologicalSorter.php
│   │   │   └── Node.php
│   │   └── Graph.php
│   ├── System.php
│   ├── test
│   │   ├── Console_Getopt
│   │   │   └── tests
│   │   │   ├── -getopt.phpt
│   │   │   ├── bug10557.phpt
│   │   │   ├── bug11068.phpt
│   │   │   └── bug13140.phpt
│   │   ├── Structures_Graph
│   │   │   └── tests
│   │   │   ├── AcyclicTestTest.php
│   │   │   ├── AllTests.php
│   │   │   ├── BasicGraphTest.php
│   │   │   ├── helper.inc
│   │   │   └── TopologicalSorterTest.php
│   │   └── XML_Util
│   │   └── tests
│   │   ├── AbstractUnitTests.php
│   │   ├── ApiVersionTests.php
│   │   ├── AttributesToStringTests.php
│   │   ├── Bug18343Tests.php
│   │   ├── Bug21177Tests.php
│   │   ├── Bug21184Tests.php
│   │   ├── Bug4950Tests.php
│   │   ├── Bug5392Tests.php
│   │   ├── CollapseEmptyTagsTests.php
│   │   ├── CreateCDataSectionTests.php
│   │   ├── CreateCommentTests.php
│   │   ├── CreateEndElementTests.php
│   │   ├── CreateStartElementTests.php
│   │   ├── CreateTagFromArrayTests.php
│   │   ├── CreateTagTests.php
│   │   ├── GetDocTypeDeclarationTests.php
│   │   ├── GetXmlDeclarationTests.php
│   │   ├── IsValidNameTests.php
│   │   ├── RaiseErrorTests.php
│   │   ├── ReplaceEntitiesTests.php
│   │   ├── ReverseEntitiesTests.php
│   │   └── SplitQualifiedNameTests.php
│   └── XML
│   └── Util.php
├── php
│   ├── man
│   │   ├── man1
│   │   │   ├── phar.
│   │   │   ├── phar.phar.
│   │   │   ├── php.
│   │   │   ├── php-cgi.
│   │   │   ├── php-config.
│   │   │   ├── phpdbg.
│   │   │   └── phpize.
│   │   └── man8
│   │   └── php-fpm.
│   └── php
│   └── fpm
│   └── status.html
├── sbin
│   └── php-fpm
└── var
├── log
└── run directories, files

六 启动并测试

cp /tools/php-7.2./sapi/fpm/init.d.php-fpm /etc/init.d/php.fpm
chmod +x /etc/init.d/php.fpm
chmod +x /etc/init.d/php.fpm start

[root@centos7 sbin]# netstat -lnutp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 57529/php-fpm: mast

七 Nginx配置php

        location / {
root html;
index index.php index.html index.htm;
} location ~ \.php$ {
fastcgi_pass 127.0.0.1:;
# fastcgi_pass unix:/var/run/php-fcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}

八 编写php-fpm启动文件

[root@centos7 php-fpm.d]# cat /etc/systemd/system/php-fpm.service
[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target [Service]
Type=simple
PIDFile=/var/log/php-fpm/php-fpm.pid
ExecStart=/usr/local/php/sbin/php-fpm --nodaemonize --fpm-config /usr/local/php/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/bin/kill -SIGINT $MAINPID [Install]
WantedBy=multi-user.targe

九 nginx检查配置并重启

[root@centos7 sbin]# nginx -t
nginx: the configuration file /usr/local/nginx-1.15./conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.15./conf/nginx.conf test is successful
[root@centos7 sbin]# systemctl restart nginx

十  网页浏览验证

编译安装PHP-7.2.8的更多相关文章

  1. Centos6.5下编译安装mysql 5.6

    一:卸载旧版本 使用下面的命令检查是否安装有MySQL Server rpm -qa | grep mysql 有的话通过下面的命令来卸载掉 rpm -e mysql //普通删除模式 rpm -e ...

  2. CENTOS 6.5 平台离线编译安装 PHP5.6.6

    一.下载php源码包 http://cn2.php.net/get/php-5.6.6.tar.gz/from/this/mirror 二.编译 编译之前可能会缺少一些必要的依赖包,加载一个本地yum ...

  3. Linux下编译安装Vim8.0

    什么是Vim? Vim 是经典的 UNIX 编辑器 Vi 的深度改良版本.它增加了许多功能,包括:多级撤销.格式高亮.命令行历史.在线帮助.拼写检查.文件名补完.块操作.脚本支持,等等.除了字符界面版 ...

  4. OpenSUSE下编译安装OpenFoam

    在不是Ubuntu系统下安装OpenFoam,需要采用编译安装的方式.以下以OpenSuSE为例进行编译安装. 1 软件包准备 需要下载两个程序包: OpenFOAM-4.x-version-4.1. ...

  5. 不要着急改代码,先想想--centos 6.8下编译安装tmux

    诸位读者新年好,2017开年第一篇博客,请允许我先问候一下看到这篇博客的诸位.写博客是我2017年定下的目标之一,希望我会坚持下去. 最近打算尝试一下tmux这个神器,于是有了这一篇关于思维方式的Bl ...

  6. protobuf的编译安装

    github地址:https://github.com/google/protobuf支持多种语言,有多个语言的版本,本文采用的是在centos7下编译源码进行安装. github上有详细的安装说明: ...

  7. 编译安装mysql

    参考:http://www.centoscn.com/CentosServer/www/2015/0422/5245.html 安装mysql5.6.17 1.按照标准需要给mysql创建所属用户和用 ...

  8. 编译安装zabbix3.2

    1.1 环境准备 系统环境准备:redhat 6.6 64位mysql-5.6.34php-5.6.28zabbix-3.2.1配置前先关闭iptables和SELINUX,避免安装过程中报错. # ...

  9. centos系统编译安装nginx+php环境另加独立mysql教程

    以前看过的安装nginx+php环境都带了mysql数据库了,这个是因为很多站长都是nginx+php+mysql都在同一台服务器了,那么今天我们是单独处理了,一个是nginx+php环境,然后mys ...

  10. Nginx编译安装(Centos)

    前言 Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行.由俄罗斯的程序设计师Igor Sysoev所开发,供俄国大 ...

随机推荐

  1. C2mini 摄像头添加 到 7832N 录像机方法

    1.在YS7.com 把2个设备全部添加 (录像机也可以通过手机添加) 2.在录像机里添加摄像头 注: 如出现 “未知错误”可能为录像机版本过低造成.

  2. jq PC做滚动效果经常用到的各类参数【可视区判断】

    获取 浏览器显示区域 (可视区域)的高度 :  $(window).height();  获取浏览器显示区域(可视区域)的宽度 :  $(window).width();  获取页面的文档高度: $( ...

  3. 【Codeforces Round #424 (Div. 2) C】Jury Marks

    [Link]:http://codeforces.com/contest/831/problem/C [Description] 有一个人参加一个比赛; 他一开始有一个初始分数x; 有k个评委要依次对 ...

  4. Linux学习总结(8)——VMware v12.1.1 专业版以及永久密钥

    VMware v12.1.1 专业版以及永久密钥 热门虚拟机软件VMware Workstation 现已更新至v12.1.1 专业版!12.0属于大型更新,专门为Win10的安装和使用做了优化,支持 ...

  5. CODEVS——T1052 地鼠游戏

     http://codevs.cn/problem/1052/  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 钻石 Diamond 题解  查看运行结果     题目描述 D ...

  6. 洛谷 P1985 翻转棋

    P1985 翻转棋 题目描述 农夫约翰知道,聪明的奶牛可以产更多的牛奶.他为奶牛设计了一种智力游戏,名叫翻转棋. 翻转棋可以分成 M × N 个格子,每个格子有两种颜色,一面是黑的,一面是白的. 一旦 ...

  7. linux杂谈(十八):DNSserver的配置(一)

    1.DNSserver简单介绍 域名系统(英文:Domain Name System,縮寫:DNS)是因特网的一项服务. 它作为将域名和IP地址相互映射的一个分布式数据库,可以使人更方便的訪问互联网. ...

  8. Java解析注解

    package com.itbuluoge.anno; import java.lang.reflect.Method; import java.util.ArrayList; import java ...

  9. Linux下使用SSH、Crontab、Rsync三工具实现数据自动备份

    Linux下使用SSH.Crontab.Rsync三工具实现数据自动备份 作为网管人员大概都无一例外的经历过系统备份,尤其是重要系统的备份.重要数据库系统的备份工作.由于备份是个频繁而琐碎的工作,如何 ...

  10. AIX设备四种状态

    AIX设备四种状态: Undefined(未定义):表示系统无法识别该设备,也就是系统无法找到该设备.(驱动无法识别) Defined(定义):表示系统可以识别设备,信息保存在ODM,但是系统不能使用 ...