4

我有一个用 C 语言编写的库,它作为 PHP 扩展分发,我的用户在共享主机环境中运行时访问该库时遇到问题。

以前(在低于 5.2.5 的 PHP 版本中)我们的客户可以简单地使用 dl() 函数和库的完整路径来访问它。

由于 PHP 5.2.5 dl() 函数不能包含任何路径信息,因此该库必须由系统管理员安装在全局 PHP 扩展目录中。

自 PHP 5.4 起,dl() 函数已被弃用,并已从 PHP 6.0 中完全删除。这意味着所有库都必须由系统管理员安装并通过 PHP.ini 加载。

据我所知,这是共享托管环境中 PHP 扩展的新现实,没有“变通办法”。

为了使共享主机管理员代表我的客户安装它的可能性最大化,我需要对我的分发执行哪些关键操作?

4

1 回答 1

4

A lot of shared hosts are going to disable the dl() function, even if its usable in their particular version of PHP. In short, shared hosting is rapidly becoming antiquated except for those who just want to host a blog or some other kind of vanity site.

Its going to be quite some time before most people are 'in the clouds', however I don't see anything wrong with you expecting more serious users to have a VPS .. and specify the need for one as a system requirement.

I feel the same burn on both sides. I own a small hosting company and also develop custom PHP extensions. Fortunately, for me, I can make my products available to clients that I host without hassle.

Have you thought of just bringing up a shared server and offering hosting to those who need it?

于 2009-10-01T02:27:45.240 回答