php tidy.so,PHP 爬虫所需环境安装 配置

以下为php相关的安装

安装

Rediska 0.5.1 (php

支持redis的扩展模块)

按照以下步骤安装

1.1. **Install from PEAR**

For begining you need to discover our PEAR channel:

执行  `sudo pear channel-discover

pear.geometria-lab.net`

And install package:

执行 `sudo pear

install geometria-lab/Rediska-beta`

安装

tokyo_tyrant-0.6.0

下载后,解压,进入目录

~/tokyo_tyrant-0.6.0

执行命令

phpize

生成 configure

等文件,

运行 ./configure 文件,报错configure: error: Please reinstall the Tokyo

Tyrant distribution

依次下载

tokyocabinet-1.4.45.tar.gz

安装这个时,执行./cofigure报错

configure: error: bzlib.h is required

安装 aptitude install libbz2-dev

configure:

error: zlib.h is required

安装 sudo apt-get install zlib1g-dev libssl-dev

此时居然提示 The program 'make' is currently not installed.

继续安装 make sudo apt-get install make

成功

继续安装tokyocabinet

tokyotyrant-1.1.40.tar.gz

并安装,

重新安装tokyo

运行config脚本

configure: error: Cannot find php-config. Please use

--with-php-config=PATH

_tyrant-0.6.0

执行

sudo apt-get install php5-dev

继续configure

仍旧提示:pkg-config not found

configure: error: Please reinstall the pkg-config

distribution

安装

sudo apt-get install

pkg-config

继续执行configure

过。 继续 make & sudo make install

重新进入目录 ~/tokyo_tyrant-0.6.0

依次执行

phpize ./configure make 及 make

install 命令

提示 Installing shared

extensions: /usr/lib/php5/20060613/

这次安装成功,不过仍提示 Class 'TokyoTyrant' not found

sudo 进入

进入目录 /etc/php5/apache2/conf.d

cp (目录下的某个.ini) tokyo_tyrant.ini

编辑

tokyo_tyrant.ini

修改其中的一行为extension=tokyo_tyrant.so

退出。

终于成功

接着安装php的memcache

客户端模块

执行命令

sudo pecl install memcache

提示:

sudo: pecl: command not found

安装

apt-get update

apt-get install php-pear // 多了 php5-dev

如法炮制 生成 memcache.ini ,内容为extension=memecache.so

tidy

扩展模块安装,

想偷懒,从别的机器上拷一个tidy.so 然后生成一个tidy.ini 提示无法找到 libtidy-0.99.so.0

无奈,用apt-get install tidy 安装

然后下载 tidy-1.2.tgz

解压,运行phpize,

运行configure 出现错误,死活提示找不着 libtidy

这时用ubuntu tidy php configuration

进入google搜索,发现如下网页

根据提示

执行命令 sudo apt-get install

-y libtidy-dev

/// 下面是第一次出错的使用,第二台机器未执行

再执行sudo apt-get install -y

subversion

svn co

http://svn.php.net/repository/php/php-src/branches/PHP_5_3/ext/tidy/

cd tidy/

phpize

./configure

make

编译出错。

// 第一次出错错的结束

回到原来的tidy目录下,重新configure

,make 终于成功

运行爬虫程序又发现一个问题。

PHP Fatal error: Class 'tidy' not found in

/home/

再搜索根据下文中的提示

执行如下命令

sudo pecl uninstall

tidy // 这两步第二次没有用

sudo apt-get remove php5-tidy

sudo apt-get install

php5-tidy

最后还要安装curl

执行命令

sudo apt-get install php5-curl

即可

终于成功下载网页了。不容易啊。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值