search
HomeBackend DevelopmentPHP Tutorialstatusnet是什么?StatusNet怎么配置安装?

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

三、开始安装和配置

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());

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');

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

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

到此为止,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"

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');
Statement
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
PHP's Current Status: A Look at Web Development TrendsPHP's Current Status: A Look at Web Development TrendsApr 13, 2025 am 12:20 AM

PHP remains important in modern web development, especially in content management and e-commerce platforms. 1) PHP has a rich ecosystem and strong framework support, such as Laravel and Symfony. 2) Performance optimization can be achieved through OPcache and Nginx. 3) PHP8.0 introduces JIT compiler to improve performance. 4) Cloud-native applications are deployed through Docker and Kubernetes to improve flexibility and scalability.

PHP vs. Other Languages: A ComparisonPHP vs. Other Languages: A ComparisonApr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP vs. Python: Core Features and FunctionalityPHP vs. Python: Core Features and FunctionalityApr 13, 2025 am 12:16 AM

PHP and Python each have their own advantages and are suitable for different scenarios. 1.PHP is suitable for web development and provides built-in web servers and rich function libraries. 2. Python is suitable for data science and machine learning, with concise syntax and a powerful standard library. When choosing, it should be decided based on project requirements.

PHP: A Key Language for Web DevelopmentPHP: A Key Language for Web DevelopmentApr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP: The Foundation of Many WebsitesPHP: The Foundation of Many WebsitesApr 13, 2025 am 12:07 AM

The reasons why PHP is the preferred technology stack for many websites include its ease of use, strong community support, and widespread use. 1) Easy to learn and use, suitable for beginners. 2) Have a huge developer community and rich resources. 3) Widely used in WordPress, Drupal and other platforms. 4) Integrate tightly with web servers to simplify development deployment.

Beyond the Hype: Assessing PHP's Role TodayBeyond the Hype: Assessing PHP's Role TodayApr 12, 2025 am 12:17 AM

PHP remains a powerful and widely used tool in modern programming, especially in the field of web development. 1) PHP is easy to use and seamlessly integrated with databases, and is the first choice for many developers. 2) It supports dynamic content generation and object-oriented programming, suitable for quickly creating and maintaining websites. 3) PHP's performance can be improved by caching and optimizing database queries, and its extensive community and rich ecosystem make it still important in today's technology stack.

What are Weak References in PHP and when are they useful?What are Weak References in PHP and when are they useful?Apr 12, 2025 am 12:13 AM

In PHP, weak references are implemented through the WeakReference class and will not prevent the garbage collector from reclaiming objects. Weak references are suitable for scenarios such as caching systems and event listeners. It should be noted that it cannot guarantee the survival of objects and that garbage collection may be delayed.

Explain the __invoke magic method in PHP.Explain the __invoke magic method in PHP.Apr 12, 2025 am 12:07 AM

The \_\_invoke method allows objects to be called like functions. 1. Define the \_\_invoke method so that the object can be called. 2. When using the $obj(...) syntax, PHP will execute the \_\_invoke method. 3. Suitable for scenarios such as logging and calculator, improving code flexibility and readability.

See all articles

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 agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools