lakshitha Posted July 22, 2008 Share Posted July 22, 2008 Hello all, I have been looking for manuals on installing image support to PHP under Windows / IIS. I had no luck with my searches. Can anyone explain me how I can do that. Any help really appreciated! Thank you, Lakshitha Quote Link to comment Share on other sites More sharing options...
trq Posted July 22, 2008 Share Posted July 22, 2008 This manual entry covers the subject. Quote Link to comment Share on other sites More sharing options...
lakshitha Posted July 22, 2008 Author Share Posted July 22, 2008 This manual entry covers the subject. Thank you for your support. But I already went through all that manuals at php.net. I'm confused on what kind of lines I should add to php.ini. I saw another forum saying that I have to add an extension in php.ini and I downloaded "php_gd2.dll" file and copied inside \PHP\ext folder and I added "etension=php_gd2.dll" line in php.ini and restarted IIS but no luck with that. Do I have to add a line like "--with-gd [php_gd2.dll]" in php.ini? They are also talking about a GD bundle. Where can I find the bundle for Windows? I only saw bundles for Linux and installation help for Linux. But I had no luck finding any manuals for Windows. When I execute the following command, it gives me HTTP 500 Internal Server Error. Is that because of GD? Code: <?php header ("Content-type: image/png"); $im = @imagecreatetruecolor(120, 20) or die("Cannot Initialize new GD image stream"); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); imagepng($im); imagedestroy($im); ?> Any help really appreciated! Thank you. Quote Link to comment Share on other sites More sharing options...
trq Posted July 22, 2008 Share Posted July 22, 2008 I'm not a windows user but as far as I'm aware most extensions are bundled already into the windows package. You simply need to enable them via the php.ini. Do I have to add a line like "--with-gd[php_gd2.dll]" in php.ini? No, that is a compile time option used when building php from source on *nix based systems. Sorry, but a windows user will hoepfully come allong soon and provide further assistance. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 22, 2008 Share Posted July 22, 2008 [but I already went through all that manuals at php.net. I'm confused on what kind of lines I should add to php.ini. I saw another forum saying that I have to add an extension in php.ini and I downloaded "php_gd2.dll" file and copied inside \PHP\ext folder and I added "etension=php_gd2.dll" line in php.ini and restarted IIS but no luck with that. When PHP is installed on Windows, the extensions your use must be of same version of PHP installed. For example if you have PHP5.2.6 installed but the extension you downloaded is for PHP5.2.4 it wont work. The build version has to be PHP5.2.6. You can tell the version of extension by looking at the file in windows explorer, it'll display the file name and then beneath it'll show the version number. You should also make sure the extension_dir directive points to PHP's extension folder, eg extension_dir = "C:/PHP/ext" You do not need to do any recompiling on Windows. Quote Link to comment Share on other sites More sharing options...
lakshitha Posted July 22, 2008 Author Share Posted July 22, 2008 [but I already went through all that manuals at php.net. I'm confused on what kind of lines I should add to php.ini. I saw another forum saying that I have to add an extension in php.ini and I downloaded "php_gd2.dll" file and copied inside \PHP\ext folder and I added "etension=php_gd2.dll" line in php.ini and restarted IIS but no luck with that. When PHP is installed on Windows, the extensions your use must be of same version of PHP installed. For example if you have PHP5.2.6 installed but the extension you downloaded is for PHP5.2.4 it wont work. The build version has to be PHP5.2.6. You can tell the version of extension by looking at the file in windows explorer, it'll display the file name and then beneath it'll show the version number. You should also make sure the extension_dir directive points to PHP's extension folder, eg extension_dir = "C:/PHP/ext" You do not need to do any recompiling on Windows. Thank you for your advice. I just saw that my PHP version is 5.2.4.4 and php_gd2.dll version is 5.1.7.7. So does that mean if I get the right version of php_gd2.dll which should be 5.2.4.4, is it the only file which PHP requires to enable image function in Windows or do I have to include more extensions to enable image support? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
lakshitha Posted July 22, 2008 Author Share Posted July 22, 2008 And also where will I find php_gd2.dll 5.2.4.4 version? Thank you! Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 22, 2008 Share Posted July 22, 2008 If you have PHP5.2.4 installed, then you need to that release from the PHP archives, download the windows binary version here. Open the zip and extract php_gd2.dll from the ext folder and place it in your PHP ext folder EDIT: You'll also need gds32.dll this file comes in the download too, move it where php.exe is Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.