ubuntu php5.2,ubuntu安装php5.2.17遇到的一些bug

下载php5.2.17

这个就不说了。

安装

./configure --prefix=/usr/local/php52 --with-mysql=/usr/include/mysql --enable-mbstring --with-curl --with-config-file-path=/etc --enable-fastcgi --enable-fpm --enable-cgi --with-gd

sudo make

sudo make install

遇到的问题

1

3f813b993b00

image.png

解决方法

sudo apt-get install libmysqlclient-dev

2

3f813b993b00

image.png

解决方法

find / -name libmysqlclient.so* 2>null

ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so /usr/lib/libmysqlclient.so

3

出现 make: *** [ext/dom/node.lo] Error

解决方法

$ curl -o php-5.2.17.patch https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt

$ tar

jxf php-5.2.17.tar.bz2

$ cd php-5.2.17

$ patch -p0 -b <..>

patching file ext/dom/node.c

patching file

ext/dom/documenttype.c

patching file ext/simplexml/simplexml.c

4

错误:Following unknown configure options were used:--enable-fpm

解决方法

下载相对应的diff包:

执行下面的命令:

这是因为没有打补丁

gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1 ##fpm补丁安装到php源码

cd php-5.2.17

5

问题1 /usr/local/php/sbin/php-fpm start

Starting php_fpm –fpm-config /usr/local/php-5.2.14/etc/php-fpm.conf

Error in argument 1, char 1: no argument for option -

Usage: php-cgi [-q] [-h] [-s] [-v] [-i] [-f ]

解决方案:

重装编译安装php

参数如下:

./configure –prefix=/usr/local/php-5.2.14 –with-mysql –with-mysqli=/usr/lib/mysql/mysql_config –with-freetype-dir –with-jpeg-dir –with-png-dir -with-zlib –enable-xml –disable-rpath –enable-discard-path –enable-safe-mode –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –with-curl –with-curlwrappers –enable-mbregex–enable-fastcgi –enable-fpm –enable-force-cgi-redirect –enable-mbstring –with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-ldap –with-ldap-sasl

问题2 /usr/local/php/sbin/php-fpm start

Starting php_fpm Jul 13 16:00:09.254822 [ERROR] fpm_unix_conf_wp(), line 124: please specify user and group other than root, pool 'default'

...................................

这个把配置文件里面关于user和group的注释去掉即可。

6

安装gd

sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/

sudo ln -s /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
项目中要用到zend Optimizer,但是目前只支持php5.2,Ubuntu默认安装php版本为5.3,找了好多 方法,终于借助下面这篇文章的方法成功的安装了5.2及5.3两个版本的php Although Drupals 7+ run smoothly on PHP 5.3, Drupal 6 still feels much better with PHP 5.2. Even though D6 core is compatible with PHP 5.3 for quite some time now, a lot of contributes modules still get nasty hiccup when asked to run on the newer version. Therefore developing for both D7 and D6 at the same time becomes much less painful when running both versions of PHP in parallel. One way of doing it is using mod_php5 Apache module to serve PHP 5.3 applications, while running PHP 5.2 applications using fastcgi module. Under Ubuntu 12.04 this can be achieved by installing PHP 5.3 from the repositories and manually compiling and installing PHP 5.2 afterwards. Installing PHP 5.3 from repositories is fairly easy process, which you most probably already have under your belt, so let's just say that it looks more or less like this: sudo apt-get install php5 php5-common php5-cli php5-dev php5-mysql phpmyadmin php5-pgsql phppgadmin php5-gd php5-mcrypt php5-curl php-pear libapache2-mod-php5 php5-xdebug php5-codesniffer What is much more interesting though, and what this post will focus on, is how to add PHP 5.2 to the whole picture and make both those versions work nicely together. Please note that this tutorial is for Apache's name- based virtual hosts, and essentially leaves PHP 5.3 enabled globally while allowing to use PHP 5.2 on specific, selected virtual hosts only.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值