定制 openid/php-openid 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

openid/php-openid

最新稳定版本:3.0.3

Composer 安装命令:

composer require openid/php-openid

包简介

OpenID library for PHP5

README 文档

README

This is the PHP OpenID library by JanRain, Inc. You can visit our website for more information about this package and other OpenID implementations and tools:

http://www.openidenabled.com/

Getting Started

First, run the examples/detect.php script either from the command line or via the web. It will generate a report of any system configuration changes necessary to run the library.

Installation

You will need PHP 5.6.0 or greater to use this library.

Follow these steps:

  1. Install dependencies.

    • Enable either the GMP extension or Bcmath extension. (GMP is STRONGLY recommended because it's MUCH faster!) This is required.

    • Enable the CURL extension.

    • If you plan to use SQLite, PostgreSQL, or MySQL to store OpenID data, you'll need PEAR MDB2. You can install this by running this as root:

      pear install MDB2

      You'll also need to install and enable the appropriate PHP database extension. Alternatively, you can store OpenID data on the filesystem instead of using a relational database. Nothing special is required for using the filesystem method.

    • Install either the DOM or domxml PHP XML processing extension, but not both (they are incompatible).

  2. Copy the Auth/ directory into your PHP include path.

Testing Your Setup

You can use the example code to test your setup. To run the example consumer or server, follow the instructions in the examples/README.md file.

Using the API

The best way to get started using the API is to take a look at the example consumer and server in the examples/ directory. See the examples/README.md file for more details.

Troubleshooting

  • If you're unable to use an OpenID URL with the library, you may want to try using the discover tool (examples/discover.php). This tool will perform OpenID discovery on the identifier and give a list of discovered OpenID services and their types.

  • On some systems, PHP basedir restrictions prevent web servers from opening a source of randomness, such as /dev/urandom. If your PHP OpenID library has trouble getting a satisfactory source of randomness, check your Apache and PHP configurations to be sure that the randomness source is in the list of allowed paths for the open_basedir option.

  • In some cases, bugs in the GMP math library will result in signature validation errors when using this library. Since GMP is preferred over bcmath (for performance), you will have to define Auth_OpenID_BUGGY_GMP in your application before importing any of the library code:

define('Auth_OpenID_BUGGY_GMP', true);
  • Not all PHP installations support SSL. You can find out if yours supports SSL by reading the "HTTP Fetching" section of the output of examples/detect.php. If your installation does not support SSL, then https:// identity URLs and server URLs will not be supported by the library. An attempt to use such an identity URL will be equivalent to using an invalid OpenID. To enable SSL support, recompile PHP with OpenSSL support or install the appropriate OpenSSL module for your platform. If you are using CURL, CURL will need to be built with OpenSSL support.

Getting Help

If you have any questions, recommendations, or patches, please tell us! Subscribe to our OpenID development discussion list at

https://openid.net/developers/dev-mailing-lists/

Documentation

You can view the HTML library documentation in the doc/ directory.

This package's documentation is in PhpDoc format. To generate the documentation, install phpdoc and run the admin/makedoc.sh script. Phpdoc lives at:

https://www.phpdoc.org/

Contributing

If you have a bugfix or feature you'd like to contribute, don't hesitate to send it to us. Post your patch to the development list at

https://openid.net/developers/dev-mailing-lists/

For more detailed information on how to contribute, see

http://openidenabled.com/contribute/

To run the test suite included with this package, install PHPUnit 1.x and run

php admin/texttest.php

PHPUnit 1.x can be found at

http://pear.phpunit.de/get/

openid/php-openid 适用场景与选型建议

openid/php-openid 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.27M 次下载、GitHub Stars 达 759, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「OpenId」 「Authentication」 「auth」 「yadis」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 openid/php-openid 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 openid/php-openid 我们能提供哪些服务?
定制开发 / 二次开发

基于 openid/php-openid 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.27M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 759
  • 点击次数: 28
  • 依赖项目数: 9
  • 推荐数: 0

GitHub 信息

  • Stars: 759
  • Watchers: 65
  • Forks: 276
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-01-04