<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>浮山狼de博客 &#187; centos</title>
	<atom:link href="https://www.fushanlang.com/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fushanlang.com</link>
	<description>next station - 下一站，活在当下，且行且思</description>
	<lastBuildDate>Sat, 29 Nov 2014 15:14:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.5</generator>
	<item>
		<title>CentOS 安装 mongobdb 和 php mongodb扩展</title>
		<link>https://www.fushanlang.com/centos-to-install-mongobdb-and-php-the-mongodb-expansion-2105/</link>
		<comments>https://www.fushanlang.com/centos-to-install-mongobdb-and-php-the-mongodb-expansion-2105/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 15:14:50 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2105</guid>
		<description><![CDATA[<p>1。准备工作第一步 升级php</p> <p>默认CentOS 5.5 的 php版本 是 5.1.6 ，为了更好的使用 mongodb，首先升级到php-5.2.17 ，具体操作如下</p> <p># rpm &#8211;import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka</p> <p># vi /etc/yum.repos.d/CentOS-Base.repo 增加下面信息</p> [utterramblings] name=Jason's Utter Ramblings Repo baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka <p>执行命令，自动升级。</p> yum update php -y yum install libmcrypt -y <p>2.安装gcc （如果没有安装gcc的话)</p> <p>yum install gcc</p> <p>3.安装 mongodb</p> <p>pecl install mongo</p> <p>如果报错 phpize找不到，可以安装php-devel</p> yum install php-devel <p>service mongod <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/centos-to-install-mongobdb-and-php-the-mongodb-expansion-2105/">CentOS 安装 mongobdb 和 php mongodb扩展</a></span>]]></description>
				<content:encoded><![CDATA[<p><strong>1。准备工作第一步 升级php</strong></p>
<p>默认CentOS 5.5 的 php版本 是 5.1.6 ，为了更好的使用 mongodb，首先升级到php-5.2.17 ，具体操作如下</p>
<p><a href="http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka" target="_blank"># rpm &#8211;import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka</a><wbr></wbr></p>
<p># vi /etc/yum.repos.d/CentOS-Base.repo 增加下面信息</p>
<pre>
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
</pre>
<p>执行命令，自动升级。</p>
<pre>
yum update php -y
yum install libmcrypt -y
</pre>
<p><strong>2.安装gcc （如果没有安装gcc的话)</strong></p>
<p>yum install gcc<span id="more-2105"></span></p>
<p><strong>3.安装 mongodb</strong></p>
<p>pecl install mongo</p>
<p>如果报错 phpize找不到，可以安装php-devel</p>
<pre><strong>yum install php-devel</strong></pre>
<p>service mongod start 开启 mongodb 服务</p>
<p><strong>4.配置 php 扩展</strong></p>
<pre>
/etc/php.ini 添加&gt;&gt;&gt;&gt;

; Enable mongo extension module
extension=mongo.so

; option documentation: http://www.php.net/manual/en/mongo.configuration.php

; If persistent connections are allowed.
;mongo.allow_persistent = 1

; Whether to reconnect to the database if the connection is lost.
;mongo.auto_reconnect = 1

; The number of bytes-per-chunk.
; This number must be at least 100 less than 4 megabytes (max: 4194204)
;mongo.chunk_size = 262144

; A character to be used in place of $ in modifiers and comparisons.
;mongo.cmd = $

; Default hostname when nothing is passed to the constructor.
;mongo.default_host = localhost

; The default TCP port number. The database's default is 27017.
;mongo.default_port = 27017

; Return a BSON_LONG as an instance of MongoInt64
; (instead of a primitive type).
;mongo.long_as_object = 0

; Use MongoDB native long (this will default to true for 1.1.0)
mongo.native_long = true

; If an exception should be thrown for non-UTF8 strings.
; This option will be eliminated and exceptions always thrown for non-UTF8
; strings starting with version 1.1.0.
mongo.utf8 = 1
</pre>
<p>&gt;&gt;&gt;&gt;或者将如上代码 放入/etc/php.d/mongo.ini</p>
<p>然后 重启 httpd 　service httpd restart.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/centos-to-install-mongobdb-and-php-the-mongodb-expansion-2105/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.131 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2025-12-17 17:22:00 -->
