centos 7.0 編譯安裝php 5.6.7

編譯安裝php參考資料 php

MySQL PHP API

http://dev.mysql.com/doc/apis-php/en/index.htmlhtml

nginx + php +mysql 最簡單安裝 官方介紹mysql

http://php.net/manual/zh/install.unix.nginx.phplinux

php下載地址:ios

http://cn2.php.net/distributions/php-5.6.7.tar.gznginx

編譯php環境須要的包 web

  • autoconf: 2.13+(PHP < 5.4.0),2.59+(PHP >= 5.4.0)
  • automake: 1.4+
  • libtool: 1.4.x+(除了 1.4.2)
  • re2c: 版本 0.13.4 或更高
  • flex: 版本 2.5.4(PHP <= 5.2)
  • bison: 版本 1.28(建議),1.35 或 1.75
[root@localhost /]# yum -y install flex
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.yun-idc.com
 * extras: mirrors.btte.net
 * updates: mirrors.sina.cn
正在解決依賴關係
--> 正在檢查事務
---> 軟件包 flex.x86_64.0.2.5.37-3.el7 將被 安裝
--> 解決依賴關係完成

依賴關係解決

================================================================================
 Package        架構             版本                      源              大小
================================================================================
正在安裝:
 flex           x86_64           2.5.37-3.el7              base           292 k

事務概要
================================================================================
安裝  1 軟件包

總下載量:292 k
安裝大小:744 k
Downloading packages:
flex-2.5.37-3.el7.x86_64.rpm                               | 292 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安裝    : flex-2.5.37-3.el7.x86_64                                    1/1
  驗證中      : flex-2.5.37-3.el7.x86_64                                    1/1

已安裝:
  flex.x86_64 0:2.5.37-3.el7

完畢!
[root@localhost /]#
[root@localhost /]# yum -y install libtool
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.yun-idc.com
 * extras: mirrors.btte.net
 * updates: mirrors.sina.cn
正在解決依賴關係
--> 正在檢查事務
---> 軟件包 libtool.x86_64.0.2.4.2-20.el7 將被 安裝
--> 解決依賴關係完成

依賴關係解決

================================================================================
 Package           架構             版本                   源              大小
================================================================================
正在安裝:
 libtool           x86_64           2.4.2-20.el7           base           588 k

事務概要
================================================================================
安裝  1 軟件包

總下載量:588 k
安裝大小:2.2 M
Downloading packages:
libtool-2.4.2-20.el7.x86_64.rpm                            | 588 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安裝    : libtool-2.4.2-20.el7.x86_64                                 1/1
  驗證中      : libtool-2.4.2-20.el7.x86_64                                 1/1

已安裝:
  libtool.x86_64 0:2.4.2-20.el7

完畢!
[root@localhost /]#

php下載sql

下載目錄:/usr/local/src (沒有wget yum -y install wget 安裝)json

[root@localhost src]# wget http://cn2.php.net/distributions/php-5.6.7.tar.gz
--2015-04-09 17:02:13--  http://cn2.php.net/distributions/php-5.6.7.tar.gz
正在解析主機 cn2.php.net (cn2.php.net)... 202.108.5.184, 202.108.5.133
正在鏈接 cn2.php.net (cn2.php.net)|202.108.5.184|:80... 已鏈接。
已發出 HTTP 請求,正在等待迴應... 200 OK
長度:17756830 (17M) [application/x-gzip]
正在保存至: 「php-5.6.7.tar.gz」

100%[======================================>] 17,756,830  3.62MB/s 用時 4.5s

2015-04-09 17:02:18 (3.77 MB/s) - 已保存 「php-5.6.7.tar.gz」 [17756830/17756830])

php解壓api


[root@localhost src]# tar zxvf php-5.6.7.tar.gz -C /usr/local/bin

安裝基礎模塊 libxml2-devel

 這裏忘記記下了 就用之前的了~

[root@localhost php-5.6.5]# yum -y install libxml2-devel
已加載插件:fastestmirror
base                                                     | 3.6 kB     00:00
extras                                                   | 3.4 kB     00:00
updates                                                  | 3.4 kB     00:00
Loading mirror speeds from cached hostfile
 * base: mirrors.btte.net
 * extras: mirrors.hustunique.com
 * updates: mirrors.skyshe.cn
正在解決依賴關係
--> 正在檢查事務
---> 軟件包 libxml2-devel.x86_64.0.2.9.1-5.el7_0.1 將被 安裝
--> 正在處理依賴關係 libxml2 = 2.9.1-5.el7_0.1,它被軟件包 libxml2-devel-2.9.1-5.el7_0.1.x86_64 須要
--> 正在處理依賴關係 xz-devel,它被軟件包 libxml2-devel-2.9.1-5.el7_0.1.x86_64 須要
--> 正在檢查事務
---> 軟件包 libxml2.x86_64.0.2.9.1-5.el7 將被 升級
---> 軟件包 libxml2.x86_64.0.2.9.1-5.el7_0.1 將被 更新
---> 軟件包 xz-devel.x86_64.0.5.1.2-8alpha.el7 將被 安裝
--> 解決依賴關係完成

依賴關係解決

================================================================================
 Package             架構         版本                      源             大小
================================================================================
正在安裝:
 libxml2-devel       x86_64       2.9.1-5.el7_0.1           updates       1.0 M
爲依賴而安裝:
 xz-devel            x86_64       5.1.2-8alpha.el7          base           44 k
爲依賴而更新:
 libxml2             x86_64       2.9.1-5.el7_0.1           updates       664 k

事務概要
================================================================================
安裝  1 軟件包 (+1 依賴軟件包)
升級           ( 1 依賴軟件包)

總下載量:1.7 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/3): xz-devel-5.1.2-8alpha.el7.x86_64.rpm                |  44 kB   00:00
(2/3): libxml2-devel-2.9.1-5.el7_0.1.x86_64.rpm            | 1.0 MB   00:00
(3/3): libxml2-2.9.1-5.el7_0.1.x86_64.rpm                  | 664 kB   00:01
--------------------------------------------------------------------------------
總計                                               1.0 MB/s | 1.7 MB  00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在更新    : libxml2-2.9.1-5.el7_0.1.x86_64                              1/4
  正在安裝    : xz-devel-5.1.2-8alpha.el7.x86_64                            2/4
  正在安裝    : libxml2-devel-2.9.1-5.el7_0.1.x86_64                        3/4
  清理        : libxml2-2.9.1-5.el7.x86_64                                  4/4
  驗證中      : libxml2-devel-2.9.1-5.el7_0.1.x86_64                        1/4
  驗證中      : xz-devel-5.1.2-8alpha.el7.x86_64                            2/4
  驗證中      : libxml2-2.9.1-5.el7_0.1.x86_64                              3/4
  驗證中      : libxml2-2.9.1-5.el7.x86_64                                  4/4

已安裝:
  libxml2-devel.x86_64 0:2.9.1-5.el7_0.1

做爲依賴被安裝:
  xz-devel.x86_64 0:5.1.2-8alpha.el7

做爲依賴被升級:
  libxml2.x86_64 0:2.9.1-5.el7_0.1

完畢!

編譯安裝php前 必備庫的安裝 gd庫等

1.gd庫

phpize 編譯安裝GD庫 好像都沒用到phpize 

http://www.cnblogs.com/xxx91hx/p/4466581.html

 

 

 

編譯安裝php

把php安裝在 /usr/etc/php下

加粗的是正確最小 使用  

定義安裝目錄--prefix  

定義php.ini路徑--with-config-file-path  

啓動fpm --enable-fpm

 

在php源碼裏  /usr/local/bin/php-5.6.7

./configure \
--prefix=/usr/etc/php \
--with-config-file-path=/usr/etc/php/etc \
--with-config-file-scan-dir=/usr/etc/php/etc \
--enable-fpm \
--enable-zip \
--enable-mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-mysql=mysqlnd \
--enable-re2c-cgoto \
--with-libdir=/usr/etc/php/lib/php/extensions/no-debug-non-zts-20131226

[root@localhost php-5.6.7]# ./configure \
> --prefix=/usr/etc/php \
> --with-config-file-path=/usr/etc/php/etc \
> --with-config-file-scan-dir=/usr/etc/php/etc \
> --enable-fpm \
--enable-zip \
--enable-mysqlnd \
> --enable-zip \
> --enable-mysqlnd \
> --with-pdo-mysql=mysqlnd \
--with-mysql=mysqlnd  \
> --with-mysqli=mysqlnd  \
> --with-mysql=mysqlnd  \
> --enable-re2c-cgoto \
> --with-libdir=/usr/etc/php/lib/php/extensions/no-debug-non-zts-20131226
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether ln -s works... yes
checking for system library directory... /usr/etc/php/lib/php/extensions/no-debug-non-zts-20131226
checking whether to enable runpaths... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for gawk... gawk
checking for bison... bison -y
checking for bison version... 2.7 (ok)
checking for re2c... re2c
checking for re2c version... 0.14.2 (ok)
checking whether to enable computed goto gcc extension with re2c... yes
checking whether re2c -g works... yes
checking whether to force non-PIC code in shared modules... no
checking whether /dev/urandom exists... yes
checking for pthreads_cflags... -pthread
checking for pthreads_lib...

Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking whether to enable Apache charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS... no
checking for Apache 1.x (hooks) module support via DSO through APXS... no
checking for Apache 1.x (hooks) module support... no
checking whether to enable Apache charset compatibility option... no
checking for Caudium support... no
checking for setproctitle... no
checking sys/pstat.h usability... no
checking sys/pstat.h presence... no
checking for sys/pstat.h... no
checking for PS_STRINGS... no
checking for CLI build... yes
checking for Continuity support... no
checking for embedded SAPI library support... no
checking for FPM build... yes
checking for setenv... yes
checking for clearenv... yes
checking for setproctitle... (cached) no
checking for library containing socket... none required
checking for library containing inet_addr... none required
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking sysexits.h usability... yes
checking sysexits.h presence... yes
checking for sysexits.h... yes
checking for prctl... yes
checking for clock_gettime... yes
checking for ptrace... yes
checking whether ptrace works... yes
checking for proc mem file... mem
checking if gcc supports __sync_bool_compare_and_swap... yes
checking for TCP_INFO... yes
checking for sysconf... yes
checking for times... yes
checking for kqueue... no
checking for port framework... no
checking for /dev/poll... no
checking for epoll... yes
checking for poll... yes
checking for select... yes
checking for apparmor... no
checking for Zeus ISAPI support... no
checking for LiteSpeed support... no
checking for Milter support... no
checking for NSAPI support... no
checking for phpdbg support... no
checking for phpdbg debug build... no
checking for PHTTPD support... no
checking for Pi3Web support... no
checking whether Roxen module is build using ZTS... no
checking for Roxen/Pike support...
checking for thttpd... no
checking for TUX... no
checking for webjames... no
checking for CGI build... yes
checking for socklen_t in sys/socket.h... yes
checking for sun_len in sys/un.h... no
checking whether cross-process locking is required by accept()... no
checking for chosen SAPI module... none
checking for executable SAPI binaries...  cli fpm cgi

Running system checks
checking for sendmail... /usr/sbin/sendmail
checking whether system uses EBCDIC... no
checking whether byte ordering is bigendian... no
checking whether writing to stdout works... This is the test message -- yes
checking for socket... yes
checking for socketpair... yes
checking for htonl... yes
checking for gethostname... yes
checking for gethostbyaddr... yes
checking for yp_get_default_domain... no
checking for __yp_get_default_domain... no
checking for yp_get_default_domain in -lnsl... yes
checking for dlopen... no
checking for __dlopen... no
checking for dlopen in -ldl... yes
checking for sin in -lm... yes
checking for inet_aton... yes
checking for ANSI C header files... (cached) yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for dirent.h... yes
checking for ApplicationServices/ApplicationServices.h... no
checking for sys/param.h... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for alloca.h... yes
checking for arpa/inet.h... (cached) yes
checking for arpa/nameser.h... yes
checking for assert.h... yes
checking for crypt.h... yes
checking for dns.h... no
checking for fcntl.h... (cached) yes
checking for grp.h... yes
checking for ieeefp.h... no
checking for langinfo.h... yes
checking for limits.h... yes
checking for locale.h... yes
checking for monetary.h... yes
checking for netdb.h... yes
checking for pwd.h... yes
checking for resolv.h... yes
checking for signal.h... yes
checking for stdarg.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for syslog.h... yes
checking for sysexits.h... (cached) yes
checking for sys/ioctl.h... yes
checking for sys/file.h... yes
checking for sys/mman.h... yes
checking for sys/mount.h... yes
checking for sys/poll.h... yes
checking for sys/resource.h... yes
checking for sys/select.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for sys/statfs.h... yes
checking for sys/statvfs.h... yes
checking for sys/vfs.h... yes
checking for sys/sysexits.h... no
checking for sys/varargs.h... no
checking for sys/wait.h... yes
checking for sys/loadavg.h... no
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking for unix.h... no
checking for utime.h... yes
checking for sys/utsname.h... yes
checking for sys/ipc.h... yes
checking for dlfcn.h... yes
checking for assert.h... (cached) yes
checking for fopencookie... yes
checking for broken getcwd... no
checking for broken libc stdio... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking for missing declarations of reentrant functions... done
checking for fclose declaration... ok
checking for tm_gmtoff in struct tm... yes
checking for struct flock... yes
checking for socklen_t... yes
checking size of size_t... 8
checking size of long long... 8
checking size of long long int... 8
checking size of long... 8
checking size of int... 4
checking size of intmax_t... 8
checking size of ssize_t... 8
checking size of ptrdiff_t... 8
checking size of short... 2
checking size of int... (cached) 4
checking size of long... (cached) 8
checking size of long long... (cached) 8
checking for int8... no
checking for int16... no
checking for int32... no
checking for int64... no
checking for int8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for uint8... no
checking for uint16... no
checking for uint32... no
checking for uint64... no
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for u_int8_t... yes
checking for u_int16_t... yes
checking for u_int32_t... yes
checking for u_int64_t... yes
checking for struct stat.st_blksize... yes
checking for struct stat.st_blocks... yes
checking for struct stat.st_rdev... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for struct sockaddr_storage... yes
checking for field sa_len in struct sockaddr... no
checking for IPv6 support... yes
checking for vprintf... yes
checking for _doprnt... no
checking for alphasort... yes
checking for asctime_r... yes
checking for chroot... yes
checking for ctime_r... yes
checking for cuserid... yes
checking for crypt... no
checking for flock... yes
checking for ftok... yes
checking for funopen... no
checking for gai_strerror... yes
checking for gcvt... yes
checking for getloadavg... yes
checking for getlogin... yes
checking for getprotobyname... yes
checking for getprotobynumber... yes
checking for getservbyname... yes
checking for getservbyport... yes
checking for gethostname... (cached) yes
checking for getrusage... yes
checking for gettimeofday... yes
checking for gmtime_r... yes
checking for getpwnam_r... yes
checking for getgrnam_r... yes
checking for getpwuid_r... yes
checking for grantpt... yes
checking for inet_ntoa... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for isascii... yes
checking for link... yes
checking for localtime_r... yes
checking for lockf... yes
checking for lchown... yes
checking for lrand48... yes
checking for memcpy... yes
checking for memmove... yes
checking for mkstemp... yes
checking for mmap... yes
checking for nl_langinfo... yes
checking for perror... yes
checking for poll... yes
checking for ptsname... yes
checking for putenv... yes
checking for realpath... yes
checking for random... yes
checking for rand_r... yes
checking for scandir... yes
checking for setitimer... yes
checking for setlocale... yes
checking for localeconv... yes
checking for setenv... (cached) yes
checking for setpgid... yes
checking for setsockopt... yes
checking for setvbuf... yes
checking for shutdown... yes
checking for sin... yes
checking for snprintf... yes
checking for srand48... yes
checking for srandom... yes
checking for statfs... yes
checking for statvfs... yes
checking for std_syslog... no
checking for strcasecmp... yes
checking for strcoll... yes
checking for strdup... yes
checking for strerror... yes
checking for strftime... yes
checking for strnlen... yes
checking for strptime... yes
checking for strstr... yes
checking for strtok_r... yes
checking for symlink... yes
checking for tempnam... yes
checking for tzset... yes
checking for unlockpt... yes
checking for unsetenv... yes
checking for usleep... yes
checking for utime... yes
checking for vsnprintf... yes
checking for vasprintf... yes
checking for asprintf... yes
checking for nanosleep... yes
checking for nanosleep in -lrt... yes
checking for getaddrinfo... yes
checking for __sync_fetch_and_add... yes
checking for strlcat... no
checking for strlcpy... no
checking for getopt... yes
checking for utime.h... (cached) yes
checking whether utime accepts a null argument... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for declared timezone... yes
checking for type of reentrant time-related functions... POSIX
checking for readdir_r... yes
checking for type of readdir_r... POSIX
checking for in_addr_t... yes
checking for crypt_r... no

General settings
checking whether to include gcov symbols... no
checking whether to include debugging symbols... no
checking layout of installed files... PHP
checking path to configuration file... /usr/etc/php/etc
checking where to scan for configuration files... /usr/etc/php/etc
checking whether to enable PHP's own SIGCHLD handler... no
checking whether to explicitly link against libgcc... no
checking whether to enable short tags by default... yes
checking whether to enable dmalloc... no
checking whether to enable IPv6 support... yes
checking whether to enable DTrace support... no
checking how big to make fd sets... using system default

Configuring extensions
checking size of long... (cached) 8
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking which regex library to use... php
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... no
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for PCRE library to use... bundled
checking whether to enable the SQLite3 extension... yes
checking bundled sqlite3 library... yes
checking for ZLIB support... no
checking if the location of ZLIB install directory is defined... no
checking whether to enable bc style precision math functions... no
checking for BZip2 support... no
checking whether to enable calendar conversion support... no
checking whether to enable ctype functions... yes
checking for cURL support... no
checking for QDBM support... no
checking for GDBM support... no
checking for NDBM support... no
checking for TCADB support... no
checking for Berkeley DB4 support... no
checking for Berkeley DB3 support... no
checking for Berkeley DB2 support... no
checking for DB1 support... no
checking for DBM support... no
checking for CDB support... no
checking for INI File support... no
checking for FlatFile support... no
checking whether to enable DBA interface... no
checking whether to enable DOM support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking for ENCHANT support... no
checking whether to enable EXIF (metadata from images) support... no
checking for fileinfo support... yes
checking for strcasestr... yes
checking for utimes... yes
checking for strndup... yes
checking whether to enable input filter support... yes
checking pcre install prefix... no
checking whether to enable FTP support... no
checking OpenSSL dir for FTP... no
checking for GD support... no
checking for the location of libvpx... no
checking for the location of libjpeg... no
checking for the location of libpng... no
checking for the location of libXpm... no
checking for FreeType 2... no
checking for T1lib support... no
checking whether to enable truetype string function in GD... no
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for GNU gettext support... no
checking for GNU MP support... no
checking for mhash support... no
checking whether to enable hash support... yes
checking whether byte ordering is bigendian... (cached) no
checking size of short... (cached) 2
checking size of int... (cached) 4
checking size of long... (cached) 8
checking size of long long... (cached) 8
checking for iconv support... yes
checking for iconv... yes
checking if iconv is glibc's... yes
checking if iconv supports errno... yes
checking if your cpp allows macro usage in include lines... yes
checking for IMAP support... no
checking for IMAP Kerberos support... no
checking for IMAP SSL support... no
checking for InterBase support... no
checking whether to enable internationalization support... no
checking whether to enable JavaScript Object Serialization support... yes
checking for ANSI C header files... (cached) yes
checking for LDAP support... no
checking for LDAP Cyrus SASL support... no
checking whether to enable multibyte string support... no
checking whether to enable multibyte regex support... yes
checking whether to check multibyte regex backtrack... yes
checking for external libmbfl... no
checking for external oniguruma... no
checking for mcrypt support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
checking for Oracle Database OCI8 support... no
checking whether to enable Zend OPcache support... yes
checking for mprotect... yes
checking for sysvipc shared memory support... yes
checking for mmap() using MAP_ANON shared memory support... yes
checking for mmap() using /dev/zero shared memory support... yes
checking for mmap() using shm_open() shared memory support... yes
checking for mmap() using regular file shared memory support... yes
checking "whether flock struct is linux ordered"... "yes"
checking "whether flock struct is BSD ordered"... "no"
checking whether to enable pcntl support... no
checking whether to enable PDO support... yes
checking for PDO_DBLIB support via FreeTDS... no
checking for Firebird support for PDO... no
checking for MySQL support for PDO... yes
checking for PDO includes... checking for PDO includes... /usr/local/bin/php-5.6.7/ext
checking Oracle OCI support for PDO... no
checking for ODBC v3 support for PDO... no
checking for PostgreSQL support for PDO... no
checking for sqlite 3 support for PDO... yes
checking for PDO includes... (cached) /usr/local/bin/php-5.6.7/ext
checking for usleep... (cached) yes
checking for nanosleep... (cached) yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for fdatasync in -lrt... yes
checking for PostgreSQL support... no
checking for phar archive support... yes
checking for phar openssl support... no
checking whether to enable POSIX-like functions... yes
checking sys/mkdev.h usability... no
checking sys/mkdev.h presence... no
checking for sys/mkdev.h... no
checking for seteuid... yes
checking for setegid... yes
checking for setsid... yes
checking for getsid... yes
checking for setpgid... (cached) yes
checking for getpgid... yes
checking for ctermid... yes
checking for mkfifo... yes
checking for mknod... yes
checking for getrlimit... yes
checking for getlogin... (cached) yes
checking for getgroups... yes
checking for makedev... no
checking for initgroups... yes
checking for getpwuid_r... (cached) yes
checking for getgrgid_r... yes
checking for working ttyname_r() implementation... no, posix_ttyname() will be thread-unsafe
checking for utsname.domainname... yes
checking for PSPELL support... no
checking for libedit readline replacement... no
checking for readline support... no
checking for recode support... no
checking whether to enable PHP sessions... yes
checking for mm support... no
checking whether pwrite works... yes
checking whether pread works... yes
checking whether to enable shmop support... no
checking whether to enable SimpleXML support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking for SNMP support... no
checking OpenSSL dir for SNMP... no
checking whether to enable SOAP support... no
checking whether to enable sockets support... no
checking whether zend_object_value is packed... no
checking whether flush should be called explicitly after a buffered io... no
checking for crypt in -lcrypt... yes
checking for standard DES crypt... yes
checking for extended DES crypt... no
checking for MD5 crypt... yes
checking for Blowfish crypt... no
checking for SHA512 crypt... yes
checking for SHA256 crypt... yes
checking whether the compiler supports __alignof__... yes
checking whether the compiler supports aligned attribute... yes
checking for getcwd... yes
checking for getwd... yes
checking for asinh... yes
checking for acosh... yes
checking for atanh... yes
checking for log1p... yes
checking for hypot... yes
checking for glob... yes
checking for strfmon... yes
checking for nice... yes
checking for fpclass... no
checking for isinf... yes
checking for isnan... yes
checking for mempcpy... yes
checking for strpncpy... no
checking for working POSIX fnmatch... yes
checking for fork... yes
checking if your OS can spawn processes with inherited handles... yes
checking for res_nsearch... no
checking for __res_nsearch... no
checking for res_nsearch in -lresolv... no
checking for __res_nsearch in -lresolv... yes
checking for dns_search... no
checking for __dns_search... no
checking for dns_search in -lresolv... no
checking for __dns_search in -lresolv... no
checking for dns_search in -lbind... no
checking for __dns_search in -lbind... no
checking for dns_search in -lsocket... no
checking for __dns_search in -lsocket... no
checking for dn_expand... no
checking for __dn_expand... yes
checking for dn_skipname... no
checking for __dn_skipname... yes
checking for res_search... no
checking for __res_search... yes
checking whether atof() accepts NAN... yes
checking whether atof() accepts INF... yes
checking whether HUGE_VAL == INF... yes
checking whether HUGE_VAL + -HUGEVAL == NAN... yes
checking whether strptime() declaration fails... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking for mblen... yes
checking for mbrlen... yes
checking for mbsinit... yes
checking for mbstate_t... yes
checking atomic.h usability... no
checking atomic.h presence... no
checking for atomic.h... no
checking for Sybase-CT support... no
checking whether to enable System V IPC support... no
checking whether to enable System V semaphore support... no
checking whether to enable System V shared memory support... no
checking for TIDY support... no
checking whether to enable tokenizer support... yes
checking whether to enable WDDX support... no
checking libexpat dir for WDDX... no
checking whether to enable XML support... yes
checking libexpat install dir... no
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking whether to enable XMLReader support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking for XMLRPC-EPI support... no
checking libexpat dir for XMLRPC-EPI... no
checking iconv dir for XMLRPC-EPI... no
checking whether to enable XMLWriter support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking for XSL support... no
checking for zip archive read/writesupport... yes
checking pcre install prefix... no
checking libzip... no
checking for the location of zlib... /usr
checking for int8_t... (cached) yes
checking for int16_t... (cached) yes
checking for int32_t... (cached) yes
checking for int64_t... (cached) yes
checking for uint8_t... (cached) yes
checking for uint16_t... (cached) yes
checking for uint32_t... (cached) yes
checking for uint64_t... (cached) yes
checking for ssize_t... yes
checking size of short... (cached) 2
checking size of int... (cached) 4
checking size of long... (cached) 8
checking size of long long... (cached) 8
checking size of off_t... 8
checking size of size_t... (cached) 8
checking for touch... /usr/bin/touch
checking for unzip... no
checking for struct tm.tm_zone... (cached) yes
checking whether to enable mysqlnd... yes
checking whether to disable compressed protocol support in mysqlnd... yes

Configuring PEAR
checking whether to install PEAR... yes

Configuring Zend
checking for bison version... (cached) 2.7 (ok)
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for limits.h... (cached) yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for stdarg.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for signal.h... (cached) yes
checking for unix.h... (cached) no
checking for stdlib.h... (cached) yes
checking for dlfcn.h... (cached) yes
checking for size_t... (cached) yes
checking return type of signal handlers... void
checking for uint... yes
checking for ulong... yes
checking for int32_t... yes
checking for uint32_t... yes
checking for vprintf... (cached) yes
checking for _doprnt... (cached) no
checking for working memcmp... yes
checking for working alloca.h... (cached) yes
checking for alloca... (cached) yes
checking for memcpy... (cached) yes
checking for strdup... (cached) yes
checking for getpid... yes
checking for kill... yes
checking for strtod... yes
checking for strtol... yes
checking for finite... yes
checking for fpclass... (cached) no
checking for sigsetjmp... no
checking whether sprintf is broken... no
checking for finite... (cached) yes
checking for isfinite... no
checking for isinf... (cached) yes
checking for isnan... (cached) yes
checking whether fp_except is defined... no
checking for usable _FPU_SETCW... yes
checking for usable fpsetprec... no
checking for usable _controlfp... no
checking for usable _controlfp_s... no
checking whether FPU control word can be manipulated by inline assembler... yes
checking whether double cast to long preserves least significant bits... no
checking for dlfcn.h... (cached) yes
checking whether dlsym() requires a leading underscore in symbol names... no
checking virtual machine dispatch method... CALL
checking whether to enable thread-safety... no
checking whether to enable inline optimization for GCC... yes
checking whether to enable Zend debugging... no
checking for inline... inline
checking target system is Darwin... no
checking for MM alignment and log values... done
checking for memory allocation using mmap(MAP_ANON)... yes
checking for memory allocation using mmap("/dev/zero")... yes
checking for mremap... yes
checking for sigaction... yes
checking whether to enable zend signal handling... no

Configuring TSRM
checking for stdarg.h... (cached) yes
checking for sigprocmask... yes

Configuring libtool
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognize dependent libraries... pass_all
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes

creating libtool
appending configuration tag "CXX" to libtool

Generating files
configure: creating ./config.status
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

config.status: creating php5.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/fpm/php-fpm.conf
config.status: creating sapi/fpm/init.d.php-fpm
config.status: creating sapi/fpm/php-fpm.service
config.status: creating sapi/fpm/php-fpm.8
config.status: creating sapi/fpm/status.html
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: main/php_config.h is unchanged
config.status: executing default commands

 make make install

[root@localhost php-5.6.7]# make install
Installing shared extensions:     /usr/etc/php/lib/php/extensions/no-debug-non-zts-20131226/
Installing PHP CLI binary:        /usr/etc/php/bin/
Installing PHP CLI man page:      /usr/etc/php/php/man/man1/
Installing PHP FPM binary:        /usr/etc/php/sbin/
Installing PHP FPM config:        /usr/etc/php/etc/
Installing PHP FPM man page:      /usr/etc/php/php/man/man8/
Installing PHP FPM status page:      /usr/etc/php/php/php/fpm/
Installing PHP CGI binary:        /usr/etc/php/bin/
Installing PHP CGI man page:      /usr/etc/php/php/man/man1/
Installing build environment:     /usr/etc/php/lib/php/build/
Installing header files:          /usr/etc/php/include/php/
Installing helper programs:       /usr/etc/php/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/etc/php/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/etc/php/lib/php/
[PEAR] Archive_Tar    - already installed: 1.3.12
[PEAR] Console_Getopt - already installed: 1.3.1
[PEAR] Structures_Graph- already installed: 1.0.4
[PEAR] XML_Util       - already installed: 1.2.3
[PEAR] PEAR           - already installed: 1.9.5
Wrote PEAR system config file at: /usr/etc/php/etc/pear.conf
You may want to add: /usr/etc/php/lib/php to your php.ini include_path
/usr/local/bin/php-5.6.7/build/shtool install -c ext/phar/phar.phar /usr/etc/php/bin
ln -s -f /usr/etc/php/bin/phar.phar /usr/etc/php/bin/phar
Installing PDO headers:          /usr/etc/php/include/php/ext/pdo/

配置php.ini

 複製php.ini到安裝目錄 /usr/etc/php/etc/php.ini 當前目錄/usr/local/bin/php-5.6.7

[root@localhost php-5.6.7]# cp php.ini-production /usr/etc/php/etc/php.ini
[root@localhost php-5.6.7]# cd /usr/etc/php/etc
[root@localhost etc]# ls
pear.conf  php.ini

  vi php.ini 目錄:/usr/etc/php/etc

[root@localhost etc]# vi php.ini

  

修改的地方                  vi 命令行/timezone 向下查找( / ) ( ? 向上查找 )

date.timezone = PRC

配置php-fpm.conf

[root@localhost php-5.6.7]# cd /usr/etc/php/etc
[root@localhost etc]# ls
pear.conf  php-fpm.conf.default  php.ini
[root@localhost etc]# cp php-fpm.conf.default php-fpm.conf
[root@localhost etc]# ls
pear.conf  php-fpm.conf  php-fpm.conf.default  php.ini

  

[root@localhost etc]# vi php-fpm.conf

user = www #設置php-fpm運行帳號爲www 
group = www #設置php-fpm運行組爲www 
pid = run/php-fpm.pid #取消前面的分號

添加用戶組 和用戶 www

[root@localhost etc]# useradd www
[root@localhost etc]# groupadd www
groupadd:「www」組已存在
[root@localhost etc]#

  查看用戶組 和用戶

[root@localhost etc]# cut -d : -f 1 /etc/group
root
bin
daemon
sys
adm
tty
disk
lp
mem
kmem
wheel
cdrom
mail
man
dialout
floppy
games
tape
video
ftp
lock
audio
nobody
users
utmp
utempter
ssh_keys
systemd-journal
dbus
polkitd
avahi
avahi-autoipd
dip
postdrop
postfix
sshd
www

  查看用戶

[root@localhost etc]# cut -d : -f 1 /etc/passwd
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
operator
games
ftp
nobody
dbus
polkitd
avahi
avahi-autoipd
postfix
sshd
www

啓動php-fpm

[root@localhost ~]# cd /usr/etc/php/sbin
[root@localhost sbin]# ls
php-fpm
[root@localhost sbin]# ./php-fpm

  檢測是否啓動

[root@localhost sbin]# lsof -i:9000
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
php-fpm 2034 root    7u  IPv4  18742      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 2035  www    0u  IPv4  18742      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 2036  www    0u  IPv4  18742      0t0  TCP localhost:cslistener (LISTEN)

  

開機自啓動php-fpm

複製php-fpm到啓動目錄/etc/init.d 

[root@localhost fpm]# cp  /usr/etc/php/sbin/php-fpm  /etc/init.d/php-fpm

給予權限

[root@localhost sbin]# chmod 755 /etc/init.d/php-fpm

  

添加服務

[root@localhost init.d]# chkconfig --add php-fpm

  

開機啓動 開啓

[root@localhost init.d]# chkconfig php-fpm on

查看權限

 

[root@localhost sbin]# ll /etc/init.d/php-fpm
-rwxr-xr-x. 1 root root 2352 4月  10 17:06 /etc/init.d/php-fpm

  

 

查看開機服務列表

[root@localhost init.d]# chkconfig --list

注意:該輸出結果只顯示 SysV 服務,並不包含原生 systemd 服務。SysV 配置數據可能被原生 systemd 配置覆蓋。
      若是您想列出 systemd 服務,請執行 'systemctl list-unit-files'。
      欲查看對特定 target 啓用的服務請執行
      'systemctl list-dependencies [target]'。

denyhosts       0:關    1:關    2:開    3:開    4:開    5:開    6:關
iprdump         0:關    1:關    2:開    3:開    4:開    5:開    6:關
iprinit         0:關    1:關    2:開    3:開    4:開    5:開    6:關
iprupdate       0:關    1:關    2:開    3:開    4:開    5:開    6:關
mysql           0:關    1:關    2:開    3:開    4:開    5:開    6:關
netconsole      0:關    1:關    2:關    3:關    4:關    5:關    6:關
network         0:關    1:關    2:開    3:開    4:開    5:開    6:關
php-fpm         0:關    1:關    2:開    3:開    4:開    5:開    6:關

配置nginx文件 支持php

/usr/etc/nginx/conf/nginx.conf

進入nginx安裝目錄 下的conf目錄的nginx.conf文件 

vi nginx.conf 默認配置

[root@localhost conf]# vi nginx.conf

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #

  添加php支持 nginx

 server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm index.php ;
        }

  去掉前面的#號

 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

  esc -  :wq - 回車

 

創建測試index.php

進入nginx安裝目錄的html目錄

本例 地址  cd /usr/etc/nginx/html

新建index.php

[root@localhost html]# vi index.php

按 i 插入  輸入

<?php

phpinfo();

?>

esc 退出到命令行 :wq  保存退出

 


經常使用的 php環境提供的 模塊參考

bcmath         bz2          calendar     cgi-fcgi      Core       ctype          curl             date       dom      ereg                exif               fileinfo      filter            ftp        gd              gettext    hash     json 
mbstring       mcrypt     mhash       mysql        mysqli    mysqlnd      odbc           pcre        PDO      pdo_mysql       pdo_sqlsrv     Phar        Reflection      session  SimpleXML  iconv      libxml
SPL               sqlsrv      standard     tokenizer    wddx     xmlreader    xmlwriter    zip zlib

紅色大概也是須要的~ 大概~  憑感受了~

mysqlnd 介紹 官方文檔

 編譯mysqli擴展前  先提早編譯mysqlnd  mysql mysqli  pdo_mysql 均可以連接這個天然驅動

mysqlmysqli以及PDO Mysql驅動均可以各自配置使用 libmysql或者mysqlndmysqlnd做爲一個專門設計 用於PHP系統的庫,它在內存和速度上都比libmysql有很大提高。很是但願你去嘗試這些提高。

http://php.net/manual/zh/mysqli.overview.php#mysqli.overview.mysqlnd

nginx 啓動 重啓 中止
進入安裝目錄/usr/etc/nginx/sbin

檢測配置文件是否正確
./nginx -t

[root@localhost sbin]# ./nginx -t
nginx: the configuration file /usr/etc/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/etc/nginx/conf/nginx.conf test is successful

執行重啓命令

[root@localhost sbin]# ./nginx -s reload

啓動nginx

[root@localhost sbin]# ./nginx 

中止nginx

[root@localhost sbin]# ./nginx -s stop 

同時php-fpm也要啓動(安裝目錄下的/usr/etc/php/etc/php-fpm啓動) 正常顯示phpinfo()頁面

相關文章
相關標籤/搜索