Page 1 of 2
GD Library not working...
Posted: Wed Aug 09, 2006 11:39 am
by infolock
This is the first time I've run into this issue and it's driving me insane..
Basically, I'm on php 4.4 and the GD 2 library won't show up as an installed module.
I uncommented the line for the module=php_gd2.dll or whatever, but nothing shows up.
If i check the php_info page, it shows my extensions_dir as c:\php4 (yes, it's a windows box running apache 2)
So, I went to the ini file, but the extensions_dir directive is set for c:\php\extensions like it should be... but the php_info file is saying otherwise.
I've tried removing the file and copying it back into the c:\windows directory, but it still keeps saying the same thing. Something tells me that this is hardwired in php.
So, I also tried copying the php.ini file into ever directory known to man just to see if i could get around it (i created php4, i copied it into c:\php, and apache and everywhere). Same thing.
I even tried copying the dll into every file on my box that could possibly have it load (windows, system, system32, apache, php, etc).
Nothing has worked. Any insight would be greatly appreciated. Thanks

Posted: Wed Aug 09, 2006 11:43 am
by feyd
This may be obvious, but did you restart Apache?
Posted: Wed Aug 09, 2006 11:56 am
by infolock
Yeah. Even rebooted the system. Even tried stupid stuff like turning apache off, removing the ini file, putting the revised one back int he directory, and restarting apache. Nothing has helped =\
Posted: Wed Aug 09, 2006 2:20 pm
by volka
phpinfo() tells you which php.ini is used. Have you changed the right file?
Change something else and check wether phpinfo() reflects the new value, e.g. error_reporting=E_COMPILE_ERROR
Posted: Wed Aug 09, 2006 3:53 pm
by infolock
Volka:
yep... it says c:\windows\php.ini, which is what i have been fighting with for about 3 days now.. =\
what is worse, is I can actually DELETE c:\windows\php.ini out of the folder, turn apache off, and reboot it. Guess what? Apache reboots fine, no errors. I can even still run my php files!@! =(
Reboot. same thing.
in case you wanna see the config, here ya go :
Code: Select all
System Windows NT NSA 5.1 build 2600
Build Date Jan 13 2006 13:49:27
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS\php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20050606
Debug Build no
Zend Memory Manager enabled
Thread Safety enabled
Registered PHP Streams php, http, ftp, compress.zlib
Posted: Thu Aug 10, 2006 9:53 am
by pickle
Is there a php.ini file anywhere else on the box?
Posted: Thu Aug 10, 2006 10:07 am
by infolock
There is one in the Zend folder, but it's only 2 lines of code that is used by zend for stuff like function look up. After running into this issue, I tried copying it into multiple other directories just for testing, but ended up removing it out of them after my tests didnt work.
c:\windows\php.ini config lines for extensions and for module:
Code: Select all
; Directory in which the loadable extensions (modules) reside.
extension_dir = "c:\php\extensions"
extension=php_gd2.dll
of course i didn't post the rest of the file. can if needed.
Posted: Thu Aug 10, 2006 10:39 am
by volka
http://de2.php.net/ini tells you when,where and why php searches for its ini. If php does not find an ini it simply uses default values for all parameters.
If you really want to change the ini path
API module specific location (PHPIniDir directive in Apache 2
is probably the best way for you.
What about
Change something else and check wether phpinfo() reflects the new value, e.g. error_reporting=E_COMPILE_ERROR
?
It doesn't make sense to look further into your gd problem until you are able to change the php settings.
Posted: Thu Aug 10, 2006 10:47 am
by infolock
Volka: I'll look into the apache setting. As for the changing thing, I stated above that I can actually remove the php.ini file from c:\windows, reboot the server, and it boots with no problem and the same issue. And I checked for PHPini flag in apache but nothing is there stating that is even an option. I haven't looked further into that setting so I can only assume I would have to manually enter that line in the conf file itself.
Anyways, it's like php_info has the ini file set to c:\windows\php.ini, but for one reason or another it's not actually using it. I even have wierd include paths set that are not even remotely correct in my ini file. I guess I'll have to look into your suggestion. Thanks and I'll let you know what I find.
Posted: Thu Aug 10, 2006 10:52 am
by volka
I stated above that I can actually remove the php.ini file from c:\windows, reboot the server, and it boots with no problem and the same issue.
Yes, and then it is using default values.
http://de2.php.net/ini wrote: * SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD)
* The PHPRC environment variable. Before PHP 5.2.0 this was checked after the registry key mentioned below.
* HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry location)
* Current working directory (for CLI)
* The web server's directory (for SAPI modules), or directory of PHP (otherwise in Windows)
* Windows directory (C:\windows or C:\winnt) (for Windows), or --with-config-file-path compile time option
If there was an php.ini at c:\windows it would have used the values. The path is printed in phpinfo() because it was "the last resort" for php to find such a file (ok, maybe a bit confusing).
And I checked for PHPini flag in apache but nothing is there stating that is even an option.
It's
PHPIniDir and you have to place it there yourself. There's an example in install.txt
install.txt wrote:Installing as an Apache module
You need to insert these two lines to your Apache httpd.conf
configuration file to set up the PHP module for Apache 2.0:
Example 2-6. PHP and Apache 2.0 as Module
# For PHP 4 do something like this:
LoadModule php4_module "c:/php/php4apache2.dll"
# Don't forget to copy the php4apache2.dll file from the sapi directory!
AddType application/x-httpd-php .php
# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"
Posted: Thu Aug 10, 2006 1:49 pm
by infolock
volka wrote:
It's
PHPIniDir and you have to place it there yourself. There's an example in install.txt
install.txt wrote:Installing as an Apache module
You need to insert these two lines to your Apache httpd.conf
configuration file to set up the PHP module for Apache 2.0:
Example 2-6. PHP and Apache 2.0 as Module
# For PHP 4 do something like this:
LoadModule php4_module "c:/php/php4apache2.dll"
# Don't forget to copy the php4apache2.dll file from the sapi directory!
AddType application/x-httpd-php .php
# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"
Ok, I tried this and still no change.. I even tried changin the PHPInDir to be c:/windows instead of c:/php.

Dunno what else to do other than uninstall and reinstall and then try it again... This is seriously very frustrating.
Edit: The path to the ini actually changes at the top of the php_info page, however the values for the extensions_dir doesn't.
Posted: Thu Aug 10, 2006 4:08 pm
by volka
Posted: Thu Aug 10, 2006 5:12 pm
by infolock
yeah, i'm sure that would work. just would rather know why it's not working for me as it stands before going the newbie route.
Posted: Thu Aug 10, 2006 5:17 pm
by feyd
is there only one web server installed (and running) on the machine?
Posted: Thu Aug 10, 2006 5:21 pm
by infolock
Yep. Apache 2 is all i have.