Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load a library at runtime?

Status
Not open for further replies.

MasterKaos

Programmer
Joined
Jan 17, 2004
Messages
107
Location
GB
Is there any way of loading libraries in PHP at runtime? For example are there any PHP functions that let me specify a path to a library and to enable it?

The server is running on a hosting provider, so i have very limited configuration options. I am unable to use .htaccess and of course i can't modify the php.ini file.

My problem is i'm trying to use the font fucntions in GD, and although my hosting provider has GD enabled, to use font functions - for eg imagefttext() or imagettftext() - i have to have the FreeType library loaded.

For now i'm using the imagestring() function which returns rather primitive looking text but it's better than nothing.

Any ideas?

----------------------------------------------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
 
PHP's dl() function can load a library at runtime.

Just keep in mind, though, that you will likely have only limited capability to get the library to the server to make it available to the script engine.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top