Jump to content

Detecting Locations for Dynamically loading extensions


damohickey

Recommended Posts

We have created an application that we want to run on shared hostings and install with our custom network installer but on those hostings it is not possible to change the php.ini file to include libraries like zlib and sqlite.

 

It is necessary to find the location of the .so files on the server so that the dl() function can find them.  However, by default, dl() only looks in the location specified by extension_dir.

 

Unfortunately, in shared hostings, this is often set to './' making extensions such as zlib and sqlite difficult to locate and therefore inaccessible.

 

Is there any way to find these extensions on a shared hosting PHP installation?

 

We can install to dedicated servers and localhost WAMP servers fine but we want to get it right for a mass market.

 

Thanks in advance,

 

Damian

 

Link to comment
Share on other sites

I only know how to check if they're available, but not how to use said function to link to externally available modules..

 

It begs the question, though, it would seem reasonable that if you have these dependencies, the 'mass market' would be aware of them and it's not your responsibility to (and I would be completely against a solution which tries to) configure a server.

 

My 2c, for what it's worth.

Link to comment
Share on other sites

Hi there,

The php extensions are always at the ext directory or any directory specified in the php.ini through this flag:extension_dir=.....

extensions can only be loaded from this directory and no other. In the dl() function you will only specify the filename of the library not the full path. such as

dl('zlib.dll');

I hope that solves.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.