简体   繁体   中英

How to distribute a PHP extension for use in a Shared Hosting Environment

I have a library written in C that gets distributed as a PHP extension, and my users are having problems accessing the library when running in a Shared Hosting environment.

Previously ( In PHP versions less that 5.2.5 ) our customers could simply use the dl() function and the full path to the library to access it.

Since PHP 5.2.5 the dl() function can not contain any path information and so the library must be installed by a System administrator in the global PHP extensions directory.

As of PHP 5.4 the dl() function has been deprecated and has been removed completely from PHP 6.0. This will mean that all libraries must be installed by a System Administrator and also loaded via the PHP.ini.

As far as I can tell this is the new reality for PHP extensions in a shared hosting environment and there are no 'work arounds'.

What are the key things I need to do with my distribution to maximise the likelihood that a Shared Host Administrator will install it on behalf of my customers?

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM