Home Backend Development PHP Tutorial statusnet是什么?StatusNet怎么配置安装?

statusnet是什么?StatusNet怎么配置安装?

Jun 13, 2016 pm 12:45 PM
php

statusnet是什么?StatusNet怎么配置安装?下面本篇文章给大家介绍一下StatusNet安装配置方法,希望对大家有帮助。

statusnet是什么?StatusNet怎么配置安装?

statusnet是什么?

StatusNet是个相当老牌的开源微博程序,相当多的国外微博网站都是基于它架设的。不过StatusNet对于服务器的要求的确是多。

StatusNet支持文件分享、用户群组、自定义皮肤、与其它社会网络(如Twitter、facebook等)互联互通、从手机端和PC桌面发起访问、浏览器插件、短信接口、即时通信接口、多国语言包,还有很多的插件和应用。

StatusNet兼容Twitter的API,大部分的Twitter客户端可以容易就支持StatusNet,这使得StatusNet显得非常灵活。

StatusNet使用了包括Pear、OAuth、XMPPHP、openid、markdown、Yadis在内的大量开源程序,也使用了许多在线服务(如:snapshot、tinyurl)。

StatusNet安装配置

由于StatusNet引用大量的开源项目,加上在中文环境中有点水土不服,导致StatusNet的安装过程会出现许多的不好处理问题,在此我记录下我的安装过程及碰到的问题和解决方式。

一、运行环境配置

PHP 5.2.3+

1、开启Curl模块,Curl最好支持HTTPS;

2、开启XMLWriter模块

3、开启MySQL模块

4、开启GD模块

5、开启mbstring模块

6、开启gettext模块

7、开启tidy模块

MySQL 5.x

关闭MySQL Strict Mode,即在my.ini或者my.cnf里将下面这行注释掉:

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Apache 2.2.x

开启mod_rewrite模块

二、准备相关开源项目代码

1、启用PHP的PEAR,具体启用方式请自己搜索解决方案

2、在PEAR中使用如下命令,下载相关源码:

pear install db

pear install validate-0.8.3

pear install mdb2

pear install mdb2#mysql

pear install db_dataobject

pear install date

pear install mail

pear install Net_SMTP

pear install Mail_Mime

pear install Mail_mimeDecode

3、下载其它扩展项目代码

3.1、在StatusNet程序目录创建“ext”文件夹;

3.2、从 http://code.google.com/p/xmpphp/下载XMPHP,并解压到ext目录;

3.3、从 http://oauth.googlecode.com/svn/code/php/OAuth.php下载OAuth.php,保存到ext目录;

3.4、从 http://openidenabled.com/下载PHP OpenID Library,解压Auth目录到ext目录;

3.5、从http://michelf.com/projects/php-markdown/下载PHP Mark down,解压markdown.php到Ext目录;

上面工作做好后,ext目录结构应该是下面这样,另外你可以下载我打包的ext目录:ext库

目录结构树

H:\13.PHP\04.WORKSPACES\STATUSNET\STATUSNET-0.8.2\EXT
│  markdown.php
│  OAuth.php
├─Auth
│  │  OpenID.php
│  ├─OpenID
│  │      Association.php
│  │      AX.php
│  │      BigMath.php
│  │      Consumer.php
│  │      CryptUtil.php
│  │      DatabaseConnection.php
│  │      DiffieHellman.php
│  │      Discover.php
│  │      DumbStore.php
│  │      Extension.php
│  │      FileStore.php
│  │      HMAC.php
│  │      HMACSHA1.php
│  │      Interface.php
│  │      KVForm.php
│  │      MemcachedStore.php
│  │      Message.php
│  │      MySQLStore.php
│  │      Nonce.php
│  │      PAPE.php
│  │      Parse.php
│  │      PostgreSQLStore.php
│  │      Server.php
│  │      ServerRequest.php
│  │      SQLiteStore.php
│  │      SQLStore.php
│  │      SReg.php
│  │      TrustRoot.php
│  │      URINorm.php
│  ├─Services
│  │  └─Yadis
│  │          HTTPFetcher.php
│  │          Manager.php
│  │          Misc.php
│  │          ParanoidHTTPFetcher.php
│  │          ParseHTML.php
│  │          PlainHTTPFetcher.php
│  │          XML.php
│  │          XRDS.php
│  │          XRI.php
│  │          XRIRes.php
│  │          Yadis.php
│  └─Yadis
│          HTTPFetcher.php
│          Manager.php
│          Misc.php
│          ParanoidHTTPFetcher.php
│          ParseHTML.php
│          PlainHTTPFetcher.php
│          XML.php
│          XRDS.php
│          XRI.php
│          XRIRes.php
│          Yadis.php
├─Services
│  └─Yadis
│          HTTPFetcher.php
│          Manager.php
│          Misc.php
│          ParanoidHTTPFetcher.php
│          ParseHTML.php
│          PlainHTTPFetcher.php
│          XML.php
│          XRDS.php
│          XRI.php
│          XRIRes.php
│          Yadis.php
└─XMPPHP
        BOSH.php
        Exception.php
        Log.php
        Roster.php
        XMLObj.php
        XMLStream.php
        XMPP.php
        XMPP_Old.php
Copy after login

三、开始安装和配置

1、在服务器里配置StatusNet的目录,在浏览器中访问StatusNet目录下的install.php来安装;

2、打开StatusNet目录下生成的config.php,进行如下配置:

2.1、指定ext目录:

        $extra_path = array("H:/13.PHP/04.WorkSpaces/statusnet/statusnet-0.8.2/ext/");
        set_include_path(implode(PATH_SEPARATOR, $extra_path) . PATH_SEPARATOR . get_include_path());
Copy after login

2.2、配置Email发送账号:

        #Email info, used for SMS send. gmail example
        $config['mail']['notifyfrom'] = 'test@canbeing.com';
        $config['mail']['domain'] = canbeing.com';
        # See http://pear.php.net/manual/en/package.mail.mail.factory.php for options
        $config['mail']['backend'] = 'smtp';
        $config['mail']['params'] = array('host' => 'smtp.canbeing.com',
   'port' => 25,
   'auth' => true,
   'username' => 'test',
   'password' => 'test');
Copy after login

3.3、设置mysql mdb2 ini文件目录:

$config['db']['ini_statusnet'] = 'H:/13.PHP/04.WorkSpaces/statusnet/statusnet-0.8.2/classes/statusnet.ini';
Copy after login

到此为止,StatusNet基本功能已经有了,可以先注册一个用户发发牢骚。

四、可能碰到的问题

1、中文站点名称显示乱码,PHP报错“string is not in UTF-8”:

将config.php别存为“UTF-8”编码即可解决问题。

2、安装完成后,注册用户失败,mdb2报错“500 The database for a1 isn't responding correctly”:

一般原因是MySQL不正常,最常见的可能是没有关闭MySQL的Strict Mode,即在my.ini或者my.cnf里将下面这行注释掉:

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
Copy after login

3、用户注册完成后无法登录,或者只能通过“记住登录状态”的方式才能登录进去,而且进用户面板又会提示重新登录:

StatusNet登录信息都是以Session的方式传递的,但基SessionID存放到了Cookie里,而其程序中又使用不安全的$_REQUEST来获取客户端的SessionID,如果php.ini里的“request_order”配置没有“C”(php production配置是:request_order = "GP"),那么就读不到Cookie,那么就无法登录。

解决方案是在php.ini里设置:request_order = "GPC"

4、邮件标题乱码

发出的邮件标题乱码,这与文件编码没有关系,可能与邮件发送服务器的问题,我使用gmail发出的邮件正常,配置如下:

#Email info, used for SMS send. gmail example
$config['mail']['notifyfrom'] = 'canbeing.com@gmail.com';
$config['mail']['domain'] = 'gmail.com';
$config['mail']['backend'] = 'smtp';
$config['mail']['params'] = array('host' => 'ssl://smtp.gmail.com',
   'port' => 465,
   'auth' => true,
   'username' => 'canbeing.com@gmail.com',
   'password' => 'test');
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

See all articles