设为首页 收藏本站
查看: 1090|回复: 0

[经验分享] 编译安装php-5.4.29

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-5-8 09:02:19 | 显示全部楼层 |阅读模式
PHP的安装依赖Mysql环境,在安装前需要先检查mysql是否安装

一.环境
    系统:CentOS 6.4x64 最小化安装

    IP:192.168.3.54


二、安装   
    安装前检查系统环境

1
2
3
4
5
6
7
8
9
10
11
12
[iyunv@rsync-3 ~]# netstat -anpt |egrep '3306|80'
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      1609/mysqld         
tcp        0      0 :::80                       :::*                        LISTEN      1739/httpd
[iyunv@rsync-3 ~]# /usr/local/apache/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built:   May  5 2015 15:44:15
[iyunv@rsync-3 ~]# mysql -u root -plyao36843 -h 127.0.0.1 -e 'select version();'
+------------+
| version()  |
+------------+
| 5.5.37-log |
+------------+



    安装PHP所需的基础库文件

1
yum install -y zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel libxslt-devel



    源码安装libiconv
1
2
3
4
5
[iyunv@rsync-3 ~]# wget
[iyunv@rsync-3 ~]# tar xf libiconv-1.14.tar.gz
[iyunv@rsync-3 ~]# cd libiconv-1.14
[iyunv@rsync-3 libiconv-1.14]# ./configure  --prefix=/usr/local/libiconv
[iyunv@rsync-3 libiconv-1.14]# make && make install



    安装PHP

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
[iyunv@rsync-3 ~]# tar xf php-5.4.29.tar.gz
[iyunv@rsync-3 ~]# cd php-5.4.29
[iyunv@rsync-3 php-5.4.29]# ./configure \
> --prefix=/usr/local/php-5.4.39 \
> --with-apxs=/usr/local/apache/bin/apxs \
> --with-mysql=/usr/local/mysql \
> --with-xmlrpc \
> --with-openssl \
> --with-zlib \
> --with-freetype-dir \
> --with-gd \
> --with-jpeg-dir \
> --with-png-dir \
> --with-iconv=/usr/local/libiconv \
> --enable-short-tags \
> --enable-sockets \
> --enable-zend-multibyte \     #该参数已被废弃
> --enable-soap \
> --enable-mbstring \
> --enable-static \
> --enable-gd-native-ttf \
> --with-curl \
> --with-xsl \
> --enable-ftp \
> --with-libxml-dir

#开始编译文件
configure: WARNING: unrecognized options: --enable-zend-multibyte
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /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... lib
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... no
checking for byacc... no
checking for bison version... invalid
configure: WARNING: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4 (found: none).
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking whether to enable computed goto gcc extension with re2c... no
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... configure: error: You have enabled Apache 1.3 support while your server is Apache 2.  Please use the appropriate switch --with-apxs2
#这里提示我们使用--with-apxs2参数
#修改参数重新编译
[iyunv@rsync-3 php-5.4.29]# ./configure \
> --prefix=/usr/local/php-5.4.39 \
> --with-apxs2=/usr/local/apache/bin/apxs \     #这里根据提示使用--with-apxs2
> --with-mysql=/usr/local/mysql \
> --with-xmlrpc \
> --with-openssl \
> --with-zlib \
> --with-freetype-dir \
> --with-gd \
> --with-jpeg-dir \
> --with-png-dir \
> --with-iconv=/usr/local/libiconv \
> --enable-short-tags \
> --enable-sockets \
> --enable-zend-multibyte \   #该参数已被废弃,删除后重新编译
> --enable-soap \
> --enable-mbstring \
> --enable-static \
> --enable-gd-native-ttf \
> --with-curl \
> --with-xsl \
> --enable-ftp \
> --with-libxml-dir
[iyunv@rsync-3 php-5.4.29]# make && make install
[iyunv@rsync-3 php-5.4.29]# ln -s /usr/local/php-5.4.39 /usr/local/php
[iyunv@rsync-3 php-5.4.29]# cp php.ini-production /usr/local/php/lib/php.ini



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-64839-1-1.html 上篇帖子: PHP将session保存到memcache服务器 下篇帖子: php for Linux之mysqli扩展模块安装与配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表