Page 1 of 1

Graphics---pain in the a** to configure

Posted: Fri Aug 29, 2003 8:39 am
by wowiz
Hello there....
I have the following set-up:
-Apache(1.3) as module
-PHP 4.3.2
-Win98

I've downloaded and installed the gd,libpng in root directory where php is installed (c:\php, each library in its own folder). zlib is in my php version already.

In php.ini, other than:
-- uncommenting the: extension=php_gd2.dll and
-- extension_dir=".;c:\php\extensions"
what else is there to configure?????
Maybe copy some ****.c files out of those libraries somewhere?????

I assume this code:

Code: Select all

<?php
var_dump(gd_info());
?>
should work once the gd is correctly installed....

Now my browser's output is:
Fatal error: Call to undefined function: gd_info() in c:\folds\php_folds\gd.php on line 2
Heeeeeeelp!!!!!!!

Posted: Fri Aug 29, 2003 8:49 am
by Judas
donono but isn't that the lib must be instaled in the extension dir rather than the php root dir

Posted: Fri Aug 29, 2003 8:53 am
by JayBird
found this comment in the PHP Manual
this function, as well as other functions that rely on the gd library, generates an error when you don't have the extension configured in your php.ini file. I had some trouble finding out how to get it working so here are the steps I took on a clean (windows / apache)- install:

* In addition to the (windows binary) installer, I downloaded the zip package which has a lot of things the installer hasn't. I unpacked the extensions directory in my own c:\php\extensions dir.

* I changed some lines in php.ini:
+ find the extension_dir setting and set it to
c:/PHP/extensions (or your own path of course)
+ found the ;extension=php_gd.dll
line and removed the semicolon

* I restarted apache and it worked

Hope this helps you all out or at least gives you a valuable hint to get it working,
Mark

Posted: Fri Aug 29, 2003 8:57 am
by JayBird
i tries running

Code: Select all

<?php 
var_dump(gd_info()); 
?>
and i got the same error as you, but when i do

Code: Select all

<?

phpinfo();

?>
and scroll down to the GD section, it says everything is installed. And when i test a script that generates an image, it works perfectly

Mark

Posted: Fri Aug 29, 2003 9:00 am
by JayBird
try running this script and see if you can see the image

Code: Select all

<?php
header ("Content-type: image/png");
$im = @imagecreate (50, 100)
    or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
imagestring ($im, 1, 5, 5,  "Test image", $text_color);
imagepng ($im);
imagedestroy ($im);
?>
Mark

Posted: Fri Aug 29, 2003 11:07 am
by wowiz
Thanks for the replies guys!!!!

Bech100:
Your image-code did not work.....and when i run the phpinfo() function i do not see any gd section.....
What's your php version?

I did install the php-4.3.2-win32.zip binary package.....i did not run the installer binary.......
--In my c:\php\extensions i have the php_gd2.dll file
--I have the line ";extension=php_gd2.dll" uncommented in php.ini
--I set in php.ini also: "extension_dir=".;c:\php\extensions"

Any ideas?????????????
8O

Posted: Fri Aug 29, 2003 11:09 am
by wowiz
also those libraries i've downloaded (gd, libpng.... zip packages) have no dll files in them.....

Posted: Fri Aug 29, 2003 11:15 am
by evilmonkey
So you got the linux version? GD comes bundled with GD in the windows version...

Posted: Fri Aug 29, 2003 11:20 am
by wowiz
linux version??????????
From http://www.php.net/downloads.php under "Windows Binaries" are 2 packages....installer and zip package......Ain't these for windows?????

Posted: Fri Aug 29, 2003 11:25 am
by wowiz
:oops:
ups.....you meant the gd and libpng zips.....

Re: Graphics---pain in the a** to configure

Posted: Fri Aug 29, 2003 11:35 am
by Heavy
wowiz wrote: each library in its own folder
Shouldn't all extension files reside in the extensions subfolder?
Can't test it myself, but it sounds strange when you set:

extension_dir=".;c:\php\extensions"

and have your extensions in fodlers like:

c:\php\whateverfolder

Did I get it all wrong?

Posted: Fri Aug 29, 2003 12:36 pm
by wowiz
ok....but does anybody know why i have no gd section in the output of the phpinfo() function? I have php_gd2.dll in c:\php\extensions and also the php.ini settings i mentioned above...

also.....if those settings about are not enough, where should i get from the gd and libpng libraries for windows (i quess as dll's ?) to put to c:\php\extensions....?

MYSTERY RESOLVED

Posted: Sat Aug 30, 2003 5:13 am
by wowiz
In php.ini for:
error_reporting = E_ALL
I added:
error_reporting = E_ALL & E_NOTICE

so when i was loading my apache, i got a pop-up warning window:
Unknown(): Unable to load dynamic library '.;c:\php\extensions\php_gd2.dll' - One of the library files needed to run this application cannot be found
so my attention got the '.;c:\php\extensions\php_gd2.dll' and i changed the setting (in php.ini) of:
extension_dir = ".;c:\php\extensions"
to:
extension_dir = "c:\php\extensions"

of course the ";extension=php_gd2.dll" is uncommented:
extension=php_gd2.dll

run the code:

Code: Select all

<?php
phpinfo();
?>
i got a gd section

IT WORKS :lol:

grafics probbie

Posted: Sat Aug 30, 2003 11:35 am
by legsman
:wink: :wink:
i just copied all the extensions/ FILES.php to c:/windoze/system32
and ensure the directive in php.ini (ie; da extension line)
equalled to the c:/windoze/system32 directory.

after check iby running a phpinfo.php (contents shld have the followin..s:

<?
phpinfo();
?>)
running an individual check on 'one mod might not be advisable.

similarly, any ext you want to init just tick it off in the php.ini file

let me know how it went, yeah yeah