Hi All,
I would like to use the GD library with my PHP installation, but I'm not sure quite how to do it. I'm not confident in my abilities enough to re-compile PHP, so I was wondering if there was another way I could get access to the GD libraries. Would it be an edit in the php.ini file perhaps? Thanks.
FYI: I do have the gd.so file in my extensions directory.
Load GD at runtime
Moderator: General Moderators
Load GD at runtime
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
there should be a line in the php.ini thats like
remove the ";" it comments it out and restart apache
Code: Select all
;LoadModule gd2.dll;Actually, I figured it out. There is a PHP command, [php_man]dl()[/php_man], to dynamically load PHP extensions at run-time. There are, of course, some fine details that need to be worked out, but here's the code I used:
Thanks for your help anyway.
Code: Select all
//load GD extension
if(!extension_loaded('gd'))
{
dl('gd.so');
}Real programmers don't comment their code. If it was hard to write, it should be hard to understand.