編譯安裝php5.6.2
編譯安裝php5.6.2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
1. 前期準備工作 # mkdir /home/download && cd /home/download # yum install gcc pcre pcre-devel gcc-c++ autoconf libxml2 libxml2-devel zlib zlib-devel glibc libjpeg libjpeg-devel libpng libpng-devel glibc-devel glib2 glib2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel openssl openssl-devel openldap openldap-devel openldap-clients openldap-servers freetype freetype-devel mhash-devel libmcrypt-devel 【libiconv】 下載LIBICONV 1.14 並安裝 Libiconv URL: http: //ftp .gnu.org /pub/gnu/libiconv/
# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz && tar zxvf libiconv-1.14.tar.gz && cd libiconv-1.14 && ./configure --prefix=/usr/local && make && make install # ln -s /usr/local/lib/libiconv.* /usr/lib/ # ldconfig # cd .. 2. 編譯安裝php # wget http://php.net/get/php-5.6.2.tar.gz/from/this/mirror -O php-5.6.2.tar.gz && tar zxvf php-5.6.2.tar.gz && cd php-5.6.2 # ./configure --prefix=/usr/local/php --with-config- file -path= /usr/local/php/etc
--with-pdo-sqlite --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock --with-mcrypt --with-mhash --with-iconv- dir = /usr/local
--with-gd --with-gettext --with-freetype- dir
--with-jpeg- dir
--with-png- dir
--with-libxml- dir = /usr
--with-curl --with-xmlrpc --with-zlib --with-pear --with-openssl --with-libdir --with-kerberos -- enable -cgi
-- enable -fpm
-- enable -pdo
-- enable -opcache
-- enable -mbstring
-- enable -gd-native-ttf
-- enable -xml
-- enable -exif
-- enable -zip
-- enable -soap
-- enable -sockets
-- enable -sysvmsg
-- enable -sysvsem
-- enable -sysvshm
-- enable -shmop
-- enable -json
-- enable -bcmath
-- enable -calendar
-- enable - ftp
-- enable -inline-optimization
-- enable -pcntl
-- enable -mbregex
--disable-rpath # cp -a ext/phar/phar.php ext/phar/phar.phar # make ZEND_EXTRA_LIBS=`-liconv` # make install # cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm # chmod +x /etc/init.d/php-fpm # chkconfig php-fpm on # ln -s /usr/local/php/bin/* /usr/bin/ # ln -s /usr/local/php/etc/php.ini /etc/ # php -v PHP 5.6.2 (cli) (built: Apr 7 2015 10:53:08) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies # cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf # cp php.ini-production /usr/local/php/etc/php.ini # cd .. 3. php模組和對應的服務的安裝 增加php模組: memcache: libmemcached-devel imagick: ImageMagick-devel gearman: libgearman-devel sphinx: libsphinxclient-devel redis: hiredis-devel 1)使用pecl安裝模組: 【memcache】 # yum install libmemcached-devel # pecl install memcache 【imagick】 # yum install ImageMagick-devel # pecl install imagick 【gearman】 # yum install libgearman-devel # pecl install gearman 【sphinx】 # yum install libsphinxclient-devel # pecl install sphinx 【redis】 # yum install hiredis-devel # pecl install redis 2)服務安裝和啟動: # yum install memcached # memcached -d -m 512 -l localhost -u root # yum install gearmand # gearmand -L 127.0.0.1 -d 4. 配置檔案 【php.ini】 # vim /usr/local/php/etc/php.ini expose_php = Off max_execution_time = 300 max_input_time = 600 post_max_size = 100M date .timezone = Asia /Shanghai
增加到檔案末尾: extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/" extension = "memcache.so"
extension = "imagick.so" extension = "gearman.so" extension = "sphinx.so" extension = "redis.so" zend_extension = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/opcache.so" opcache. enable =1
opcache.enable_cli=1 opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.save_comments=0 opcache.fast_shutdown=1 更新配置檔案後要reload一下 # service php-fpm reload 【php-fpm.conf】 # vim /usr/local/php/etc/php-fpm.conf user = www group = www # service php-fpm start |
本文轉自 pcnk 51CTO部落格,原文連結:http://blog.51cto.com/nosmoking/1629891,如需轉載請自行聯絡原作者
相關文章
- 編譯安裝zabbix編譯
- apache編譯安裝Apache編譯
- 編譯安裝nmon編譯
- swoole 編譯安裝編譯
- 編譯安裝Nginx編譯Nginx
- 編譯安裝mysql編譯MySql
- nginx編譯安裝Nginx編譯
- Griffin編譯安裝編譯
- 安裝編譯ffmpeg編譯
- Shell編譯安裝nginx編譯Nginx
- centos PHP 編譯安裝CentOSPHP編譯
- httpd編譯安裝phphttpd編譯PHP
- PHP的編譯安裝PHP編譯
- Mysql 5.7.17 編譯安裝MySql編譯
- ffmpeg安裝之linux編譯安裝Linux編譯
- CentOS 下編譯安裝 NginxCentOS編譯Nginx
- CentOS 下編譯安裝 apacheCentOS編譯Apache
- Mac 編譯安裝 PHPRedis 模組Mac編譯PHPRedis
- PHP7 編譯安裝PHP編譯
- Linux編譯安裝NginxLinux編譯Nginx
- CentOS 6.4 編譯安裝 apacheCentOS編譯Apache
- ubuntu編譯安裝kernel教程。Ubuntu編譯
- windows下編譯安裝thriftWindows編譯
- 編譯安裝php7編譯PHP
- php7編譯安裝PHP編譯
- 原始碼編譯安裝Redis原始碼編譯Redis
- 編譯安裝LAMP環境編譯LAMP
- LNMP—Nginx的編譯安裝LNMPNginx編譯
- LAMP原始碼編譯安裝LAMP原始碼編譯
- php5.5.38編譯安裝PHP編譯
- PHP編譯安裝引數PHP編譯
- LNMP編譯安裝配置+discuzLNMP編譯
- ubuntu thrift 0.9.3編譯安裝Ubuntu編譯
- ubuntu下 編譯安裝swftoolsUbuntu編譯
- Centos 下編譯安裝RedisCentOS編譯Redis
- MySQL5.5.24編譯安裝MySql編譯
- 編譯安裝CoreSeek-4.1編譯
- MySQL 5.6.19編譯安裝MySql編譯