General help

 
 
Picture of Navs M
Windows server: CGI Error: application misbehaved
 
The environment:
Windows XP SP2, with IIS 5.1 on a Lenovo Laptop [3000 N200]
Php installer:php-5.2.6-win32-installer.msi
MySQL 5.0.6.7
Moodle 1.9

The Problem:
On the web browser, I typed:
http://localhost/Moodle/install/install.php and it throws errors:


CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
PHP Warning: PHP Startup: Unable to load dynamic library 'g:\Program Files\PHP\ext\php_oci8.dll' - The specified module could not be found.
 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'g:\Program Files\PHP\ext\php_pdo_oci.dll' - The specified module could not be found.
 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'g:\Program Files\PHP\ext\php_pdo_oci8.dll' - The specified module could not be found.
 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'g:\Program Files\PHP\ext\php_pdo_pgsql.dll' - The specified module could not be found.
 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'g:\Program Files\PHP\ext\php_pdo_sqlite_external.dll' - The specified module could not b


Please help.

 
Average of ratings: -
Sketch...
Re: Windows server: CGI Error: application misbehaved
Group Particularly helpful Moodlers

The message basically means that the PHP engine can't find the 5 .dll files that are listed in the error message but it is being instructed (by the php.ini configuration file) to load those .dll files. Those files should be in your g:\Program Files\PHP\ext\ directory which seems to be the directory that you have installed PHP in. Have you checked if those 5 .dll files ARE in your g:\Program Files\PHP\ext\ directory?

If they aren't then you need to upload them to that directory. Once they are there the error will go away.

But hold on, those missing files are drivers for the Oracle and Postgre database engines, but you say that you're running MySQL so you probably don't need to load all those extra drivers. MySQL doesn't need them and they'll just waste memory. It's probably ok if you DISABLE those files in your php.ini file so that they don't load when the PHP engine starts.

How?

Open your php.ini file. It's probably in your G:\Program Files\PHP directory. Scroll down to the "Dynamic Extensions" section of that file. There you should find a number of lines similar to:

extension=php_oci8.dll
extension=php_pdo_oci.dll
extension=php_pdo_oci8.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite_external.dll

All you have to do is comment each of these lines out, i.e. put a semi-colon in front of each of the lines, eg.

;extension=php_oci8.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite_external.dll

Then restart the laptop and run the Moodle setup again. The error should be resolved.

 
Average of ratings: -
Picture of Navs M
Re: Windows server: CGI Error: application misbehaved
 
Dear Luis,

First off, thank you for helping me out.

All these files are infact available in the directory g:\Program Files\PHP\ext\ . However after doing what you've suggested (commenting those lines in the php.ini file) and restarting I get a new set of errors. Such as:

CGI ErrorThe specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
PHP Warning: PHP Startup: Unable to load dynamic library 'g:\Program Files\PHP\ext\php_pgsql.dll' - The specified module could not be found.
 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'g:\Program Files\PHP\ext\php_pspell.dll' - The specified module could not be found.
 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'g:\Program Files\PHP\ext\php_sybase_ct.dll' - The specified module could not be found.
 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'g:\Program Files\PHP\ext\php_ibm_db2.dll' - The specified module could not be found.
 in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'g:\Program Files\PHP\ext\php_ifx.dll' - The specified module could not be found.
 in Unk

So now I'm wondering if I should do this for these files as well?
I went ahead and commented the others it complained about as well such as:

;extension=php_pgsql.dll;
;extension=php_pspell.dll;
;extension=php_sybase_ct.dll;
;extension=php_ibm_db2.dll
;extension=php_ifx.dll
;extension=php_ingres2.dll
;extension=php_maxdb.dll
;extension=php_mcve.dll
;extension=php_netools.dll
;extension=php_oracle.dll
;extension=php_pdo_ibm.dll


Without restarting I refreshed and it now complains:


CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (SNMPv2-SMI): At line 0 in (none)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB):

Please help some more. The webserver I selected when installing PHP is IIS CGI.
Thanks

 
Average of ratings: -
Sketch...
Re: Windows server: CGI Error: application misbehaved
Group Particularly helpful Moodlers

Yes, you must make sure that each of the extensions that you are loading in the php.ini file IS in the \PHP\ext folder. If they are not in that folder the PHP engine won't be able to find them when it starts and you'll get those "unable to load" errors.

It's best to only enable the extensions that you DO need. Eg. you probably don't need the php_oracle.dll extension so it's safe to disable it.

When you've got the extensions sorted run PHPInfo() to see if there are any other problems with the PHP configuration.

 
Average of ratings: -