SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Detecting Locations for Dynamically loading extensions

    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 Linux/UNIX servers and self controlled WAMP servers fine but we want to get it right for a mass market.

    Thanks in advance,

    Damian

  2. #2
    <?php while(!sleep()){code();} G.Schuster's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    >but we want to get it right for a mass market.
    Then don't use dl().
    Not only that you don't know where the .sos are located - dl() is often disabled - and should be!

  3. #3
    SitePoint Zealot Mau's Avatar
    Join Date
    Jan 2006
    Location
    California, USA
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    find / -iname 'extension.so' -type f
    should do it on unix systems.

  4. #4
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, it is great to search for threads when you ahve a shell but has anyone come up with a solution for this on a shared hosting where there is a control panel only?

    Cheers,

    Damian

  5. #5
    SitePoint Zealot Mau's Avatar
    Join Date
    Jan 2006
    Location
    California, USA
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also use a directory iterator to go through the system -- this might take a while though.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •