How to enabled GD in PHP 5.2.0?
Moderator: General Moderators
How to enabled GD in PHP 5.2.0?
I've installed the following:
Windows XP
PHP 5.2.X
Apache 2.2.X
I don't know where to check the GD enable or not. I've been searching through the phpinfo() but couldn't find any of GD related infor.
Anyone could tell me how to enable or install the GD on window machine? Thanks a lot if anyone could tell me.
Windows XP
PHP 5.2.X
Apache 2.2.X
I don't know where to check the GD enable or not. I've been searching through the phpinfo() but couldn't find any of GD related infor.
Anyone could tell me how to enable or install the GD on window machine? Thanks a lot if anyone could tell me.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Are you sure you've edited the correct php.ini?
Code: Select all
<?php
echo get_cfg_var('cfg_file_path');
?>- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
The following will list all extensions that are loaded.
Code: Select all
<?php
$cli = (php_sapi_name() == 'cli');
$eol = "\n";
$gle = get_loaded_extensions();
$rows = array();
$le = '';
$wide = 4;
$j = count($gle);
$pad = $wide - $j % $wide;
$len = max(array_map('strlen', $gle));
$func = create_function('$a', 'return str_pad($a, ' . intval($len) . ');');
$gle = array_map($func, $gle);
for($i = 0; $i < $j; $i += $wide)
{
$le .= ' ' . implode(' ', array_slice($gle, $i, $wide)) . $eol;
}
if (!$cli)
{
echo '<html><head><title>quick info</title></head><body><pre>', $eol;
}
echo 'Loaded Extensions:', $eol, $le, $eol;
if (!$cli)
{
echo '</pre></body></html>', $eol;
}
?>This is what it shows. I've done more things this time, I search in the ext folder of the php root, it doesn't have php_gd2..dll, so I downloaded the PHP 4.x.x binary zip file and get the php_gd2.dll from it's extension. I copy and moved it into my PHP ext folder.Loaded Extensions:
bcmath calendar com_dotnet ctype
session filter ftp hash
iconv json odbc pcre
Reflection date libxml standard
tokenizer zlib SimpleXML dom
SPL wddx xml xmlreader
xmlwriter apache2handler mysql mysqli
pop3
Restart Apahce. Nothing happen as well. =.="
What's going on. I check and check the extension=php_gd2.dll has been uncommented, the extension_dir is pointing to the correct path which is the C:/Program Files/PHP/ext.
What's wrong with my PHP GD?
please tryand post the output
Code: Select all
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
echo 'version: ', phpversion(), "<br />\n";
echo 'uname: ', php_uname('srv m'), "<br />\n";
$ini = get_cfg_var('cfg_file_path') or die('no config file');
echo 'ini: ', $ini, "<br />\n";
foreach(file($ini) as $l) {
if ( false!==strpos($l, 'php_gd')) {
echo 'gd: ', trim($l), "<br />\n";
}
}
$ext = get_cfg_var('extension_dir');
echo 'extdir: ', $ext, "<br />\n";
foreach( glob($ext.'/php_gd*') as $f) {
echo 'php_gd: ', $f, "<br />\n";
}
foreach( get_loaded_extensions() as $e ) {
if ( false!==strpos($e, 'gd')) {
echo 'extension: ', trim($e), "<br />\n";
}
}