help installing gd library

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
speedy33417
Forum Contributor
Posts: 128
Joined: Sun Jul 23, 2006 1:14 pm

help installing gd library

Post by speedy33417 »

I need to add an image upload page to my website. Users are allowed to upload jpg images only. My problem is that I may need to resize those images. This is where gd comes in.
I read a few articles about it, but for some reason they're all for installing gd on your computer. Is it possible to install it on my server and if yes could some one explain me how?

Thanks.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

What have you read so far?

PS This might be a good place to start.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

what type of server is it? (Windows / IIS - *nix / Apache - Windows / Apache) etc..
User avatar
speedy33417
Forum Contributor
Posts: 128
Joined: Sun Jul 23, 2006 1:14 pm

Post by speedy33417 »

Yeah, I actually looked at that page. Thanks, Everah.

So, do I have to download all of the files from here? ftp://ftp.uu.net/graphics/jpeg/
I see a zip file, like 6 gz file (I don't think I can uncompress those) and a .mirror file (??????)
And then what? Create a gd library in my main folder on the server. By main folder I mean where my index page is.

Thanks.
User avatar
speedy33417
Forum Contributor
Posts: 128
Joined: Sun Jul 23, 2006 1:14 pm

Post by speedy33417 »

Burrito wrote:what type of server is it? (Windows / IIS - *nix / Apache - Windows / Apache) etc..
Man!!! You guys just love asking me stuff that I have no idea about. :) Well, I'm hosted with goDaddy. I think it's a Linux server, because that tends to support php. I could be wrong...

Does that answer your question?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Nope. But this might...

Run the following in a new file and tell us the results please.

Code: Select all

<?php

$neg = array('off', 0, false, '', null);
$flags = array(
	'Register Globals' => 'register_globals',
	'Short Tags' => 'short_open_tag',
	'Display Errors' => 'display_errors',
	'Magic Quotes GPC' => 'magic_quotes_gpc',
	'Magic Quotes Runtime' => 'magic_quotes_runtime',
	'Magic Quotes Sybase' => 'magic_quotes_sybase',
);
$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
foreach ($flags as $n => $v)
{
	$flags[$n] = (in_array(strtolower(ini_get($v)), $neg) ? 'Off' : 'On');
}
$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;
}

$ec = array(
	'E_STRICT' => 2048, 'E_ALL' => 2047, 'E_USER_NOTICE' => 1024,
	'E_USER_WARNING' => 512, 'E_USER_ERROR' => 256, 'E_COMPILE_WARNING' => 128,
	'E_COMPILE_ERROR' => 64, 'E_CORE_WARNING' => 32, 'E_CORE_ERROR' => 16,
	'E_NOTICE' => 8, 'E_PARSE' => 4, 'E_WARNING' => 2, 'E_ERROR' => 1,
);

$e = array();
$t = $er;
foreach ($ec as $n => $v)
{
	if (($t & $v) == $v)
	{
		$e[] = $n;
		$t ^= $v;
	}
}
if (ceil(count($ec) / 2) + 1 < count($e))
{
	$e2 = array();
	foreach ($ec as $n => $v)
	{
		if (!in_array($n, $e) and $n != 'E_ALL')
		{
			$e2[] = $n;
		}
	}
	$er = $er . ' ((E_ALL | E_STRICT) ^ ' . implode(' ^ ', $e2) . '))';
}
else
{
	$er = $er . ' (' . implode(' | ', $e) . ')';
}

if (!$cli)
{
	echo '<html><head><title>quick info</title></head><body><pre>', $eol;
}

echo 'PHP Version: ', $ve, $eol;
echo 'PHP OS: ', $os, $eol;
echo 'Error Reporting: ', $er, $eol;
foreach ($flags as $n => $v)
{
	echo $n, ': ', $v, $eol;
}
echo 'Loaded Extensions:', $eol, $le, $eol;

if (!$cli)
{
	echo '</pre></body></html>', $eol;
}

?>
User avatar
speedy33417
Forum Contributor
Posts: 128
Joined: Sun Jul 23, 2006 1:14 pm

Post by speedy33417 »

Code: Select all

PHP Version: 4.3.11
PHP OS: Linux
Error Reporting: 2039 ((E_ALL | E_STRICT) ^ E_STRICT ^ E_NOTICE))
Register Globals: Off
Short Tags: On
Display Errors: On
Magic Quotes GPC: On
Magic Quotes Runtime: Off
Magic Quotes Sybase: Off
Loaded Extensions:
   zip              xml              tokenizer        sybase        
   standard         session          pcre             overload      
   mysql            mcrypt           gettext          gd            
   ftp              domxml           curl             ctype         
   calendar         bcmath           zlib             openssl       
   Zend Optimizer
Does this mean that gd is loaded??? 8O
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Is there another interpretation?
User avatar
speedy33417
Forum Contributor
Posts: 128
Joined: Sun Jul 23, 2006 1:14 pm

Post by speedy33417 »

volka wrote:Is there another interpretation?
I understand that most of you are smarter in programming in php than me, but your reply is just rude.
Do not forget that you were a newbie years ago as well. I don't think you were born with all that knowledge.

Let me just gently point out the link in your signature on forum rules and quote the following:

How To Answer Questions in a Helpful Way
If you're going to answer the question at all, give good value.

or

If you can't help, don't hinder.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

speedy33417 wrote:

Code: Select all

PHP Version: 4.3.11
PHP OS: Linux
Error Reporting: 2039 ((E_ALL | E_STRICT) ^ E_STRICT ^ E_NOTICE))
Register Globals: Off
Short Tags: On
Display Errors: On
Magic Quotes GPC: On
Magic Quotes Runtime: Off
Magic Quotes Sybase: Off
Loaded Extensions:
   zip              xml              tokenizer        sybase        
   standard         session          pcre             overload      
   mysql            mcrypt           gettext          gd            
   ftp              domxml           curl             ctype         
   calendar         bcmath           zlib             openssl       
   Zend Optimizer
Does this mean that gd is loaded??? 8O
Yes, it means the GD extension is loaded.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

speedy33417 wrote:
volka wrote:Is there another interpretation?
I understand that most of you are smarter in programming in php than me, but your reply is just rude.
Do not forget that you were a newbie years ago as well. I don't think you were born with all that knowledge.

Let me just gently point out the link in your signature on forum rules and quote the following:

How To Answer Questions in a Helpful Way
If you're going to answer the question at all, give good value.

or

If you can't help, don't hinder.
If there is a reasonable different interpretation then maybe the output of that standard script has to be changed to avoid further misunderstandings. So please tell me what got you confused?
Post Reply