PHP gd extension problem
Moderator: General Moderators
- DarkConsultant
- Forum Newbie
- Posts: 17
- Joined: Mon Apr 14, 2008 3:17 am
- Location: Luton, England
PHP gd extension problem
Hello Everyone,
I am running Apache 2.2.4 with PHP 5.2.3 on Windows 2000 and I cannot enable the gd extension. I get no errors but it just does not work. If I check phpinfo then I see everything else but no gd. PHP is working fine apart from the gd.
Any thoughts ...
I am running Apache 2.2.4 with PHP 5.2.3 on Windows 2000 and I cannot enable the gd extension. I get no errors but it just does not work. If I check phpinfo then I see everything else but no gd. PHP is working fine apart from the gd.
Any thoughts ...
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP gd extension problem
How are you enabling it? Sorry, might be an patronising question.
Also... very imporant... and the cause of much furstration... don't forget the restart the httpd server.
Also... very imporant... and the cause of much furstration... don't forget the restart the httpd server.
- DarkConsultant
- Forum Newbie
- Posts: 17
- Joined: Mon Apr 14, 2008 3:17 am
- Location: Luton, England
Re: PHP gd extension problem
Hi everyone,
I have done all the usual things ....
In the PHPO ini file I have set the extensions directory, uncommented the gd2 dll and set the root directory.
I did google the problem but after spending 4 hours I was no closer so I have put it back to fresh install.
Does anyone have any suggestions ....
I have done all the usual things ....
In the PHPO ini file I have set the extensions directory, uncommented the gd2 dll and set the root directory.
I did google the problem but after spending 4 hours I was no closer so I have put it back to fresh install.
Does anyone have any suggestions ....
Re: PHP gd extension problem
Are you definitely editing the right php.ini file? php_info() will tell you which one PHP is using.
- DarkConsultant
- Forum Newbie
- Posts: 17
- Joined: Mon Apr 14, 2008 3:17 am
- Location: Luton, England
Re: PHP gd extension problem
Hi,
My php resides in a folder called C:\php5 and the ini file is in the same folder.
If I deliberately set a false reading php wont open so I think its the right one.
My php resides in a folder called C:\php5 and the ini file is in the same folder.
If I deliberately set a false reading php wont open so I think its the right one.
Re: PHP gd extension problem
Ok. Save this little script into a file and run it from a browser...
Do you get a big red square?
Code: Select all
<?php
$i = imagecreate(200,200);
$red = imagecolorallocate($i,255,0,0);
imagefill($i,0,0,$red);
header("Content-type: image/jpeg");
imagejpeg($i);
- DarkConsultant
- Forum Newbie
- Posts: 17
- Joined: Mon Apr 14, 2008 3:17 am
- Location: Luton, England
Re: PHP gd extension problem
Hi,
No I got
or see result for your self at http://www.contactconsultants.co.uk/test.php.
No I got
Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at /home/val3072/public_html/test.php:6) in /home/val3072/public_html/test.php on line 10
ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ÿÛC $.' ",#(7),01444'9=82<.342ÿÛC 2!!22222222222222222222222222222222222222222222222222ÿÀÈÈ"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?â袊ù“÷¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(ÿÙ- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP gd extension problem
Looks like GD is installed to me
Even if there is an error in the code you've run. That warning is unrelated to GD, and the gibberish is image data.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP gd extension problem
It looks like you've wrapped that code inside a HTML document? That won't work, which is why there's a headers-sent warning appearing.
- DarkConsultant
- Forum Newbie
- Posts: 17
- Joined: Mon Apr 14, 2008 3:17 am
- Location: Luton, England
Re: PHP gd extension problem
Hi,
Now I remove the html I see a big red square ..... however this is on my remote server which has got gd installed successfully.
On my own server I get ...
Fatal error: Call to undefined function imagecreate() in F:\Webs\root\test.php on line 2.
Shall I give up and live without it?
Now I remove the html I see a big red square ..... however this is on my remote server which has got gd installed successfully.
On my own server I get ...
Fatal error: Call to undefined function imagecreate() in F:\Webs\root\test.php on line 2.
Shall I give up and live without it?
- DarkConsultant
- Forum Newbie
- Posts: 17
- Joined: Mon Apr 14, 2008 3:17 am
- Location: Luton, England
Re: PHP gd extension problem
Additional ...
I have just noticed that when I look at phpinfo it report my Configuration File (php.ini) Path is C:\WINNT when it should be C:\php5 and it says below that Loaded Configuration File (none) although Under Apache Environment it reports PHPRC = C:/php5 (forward slash?).
I do not know if this is important or not.
I have just noticed that when I look at phpinfo it report my Configuration File (php.ini) Path is C:\WINNT when it should be C:\php5 and it says below that Loaded Configuration File (none) although Under Apache Environment it reports PHPRC = C:/php5 (forward slash?).
I do not know if this is important or not.
Re: PHP gd extension problem
It is important. For some reason your PHP installation is using the windows directory php.ini file instead of the php5 install directory version (I think.. I suck at sys admin stuff). You've got two options ... either attempt to make PHP use the right one ( http://uk.php.net/configuration ) or just update the one in the c:/winnt directory to enable GD like you did with the c:/php5 version. Updating the c:/winnt version is going to be the easier fix.
- DarkConsultant
- Forum Newbie
- Posts: 17
- Joined: Mon Apr 14, 2008 3:17 am
- Location: Luton, England
PHP gd extension problem (RESOLVED)
Hi All,
To all contributers ....
The problem is fixed by dropping a copy of php.ini into C:\WINNT et voila. (Although I will try to reconfigure it to use the c:\php5 version)
Many thanks to all.
To all contributers ....
The problem is fixed by dropping a copy of php.ini into C:\WINNT et voila. (Although I will try to reconfigure it to use the c:\php5 version)
Many thanks to all.
- EverLearning
- Forum Contributor
- Posts: 282
- Joined: Sat Feb 23, 2008 3:49 am
- Location: Niš, Serbia
Re: PHP gd extension problem
For Apache2 there is PHPIniDir directive which tells the server where to look for php.ini.
- DarkConsultant
- Forum Newbie
- Posts: 17
- Joined: Mon Apr 14, 2008 3:17 am
- Location: Luton, England
PHP gd extension problem (RESOLVED)
Dear Everlearning,
Yah I know but it gets ignored. This was set to C:\php5 from the word go.
The solution .....
I promised to try and make it work (without resorting to dropping copy of php.ini into C:\WINNT) and I have found the solution.
In the Apache httpd.conf file amend PHPinidir path from 'C:\php5' to (wait for it) 'C:/php5' and the problem goes away.
Thanks again for all the help, I have put the instructions on how to (definitively) set up Apache 2.2.4 with PHP 5.2.3 on my website for general viewing.
Yah I know but it gets ignored. This was set to C:\php5 from the word go.
The solution .....
I promised to try and make it work (without resorting to dropping copy of php.ini into C:\WINNT) and I have found the solution.
In the Apache httpd.conf file amend PHPinidir path from 'C:\php5' to (wait for it) 'C:/php5' and the problem goes away.
Thanks again for all the help, I have put the instructions on how to (definitively) set up Apache 2.2.4 with PHP 5.2.3 on my website for general viewing.