SugarCRM IIS 7.5 PHP Windows Server Exchange combined

When combining server roles to perform many tasks with one server there is a lot of potential for things to trip over themselves.

This started as a simple ‘Provide an LDAP connection between SugarCRM and Active Directory’.

Issue: Configuring the LDAP settings for SugarCRM is relatively easy but when trying to test by setting a specific user to ‘Use only LDAP Authentication’ the SugarCRM login page reports that the LDAP extensions are not loaded. Ok, so its a PHP config issue.

Issue: The PHP error log shows that not only is LDAP an issue but also CURL and a few other PHP extensions are not loading. With a ‘File not found’ error.

The extension files are all there, the paths are correct, etc. The issue appears to be that some supporting files are missing including libeay32.dll and ssleay.dll, so preparing a fresh install of PHP with these options enabled adds the files to the PHP directory. But the error persists.

Issue: PHP 32 bit not 64 bit so we need to set the Application Pool to allow for 32 bit applications. But this triggered another series of issues.

Issue: Attempting to set 32 bit for any App Pool on the server crashes with errors.
The browser returns an error 500 Internal Server Error.

The Application Event Viewer showed

Log Name: Application
Source: Microsoft-Windows-IIS-W3SVC-WP
Event ID: 2282
Task Category: None
Level: Error
Keywords: Classic
User: N/A

The Module DLL ‘C:Program FilesMicrosoftExchange ServerV14Binkerbauth.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.

Which led me to Chris’s Blog and issues with setting 32 bit apps on an OWA server. Following those instructions which can be summarised as follows:

  • Stop the IIS Service
  • Edit C:WindowsSystem32inetsrvconfigapplicationHost.config
  • Edit the following 3 lines to append/insert the preCondition=”bitness64″ option
  • <add name=”kerbauth” image=”C:Program FilesMicrosoftExchange ServerV14Binkerbauth.dll” preCondition=”bitness64″ />
  • <filter name=”Exchange OWA Cookie Authentication ISAPI Filter” path=”C:Program FilesMicrosoftExchange ServerV14ClientAccessowaauthowaauth.dll” enabled=”true” preCondition=”bitness64″ />
  • <filter name=”Exchange ActiveSync ISAPI Filter” path=”C:Program FilesMicrosoftExchange ServerV14ClientAccesssyncbinAirFilter.dll” enabled=”true” preCondition=”bitness64″ />
  • Start the IIS Service
  • Set an Application Pool to use 32 bit Applications
  • This resolved the 32 vs 64 bit war and brought me back to the PHP issues that started this.

    Issue: Curl and other extensions not loading.

    So I tried running php from the command line

    D:Applicationsphp> C:progra~1phpphp-cgi.exe
    PHP Warning: PHP Startup: bz2: Unable to initialize module
    Module compiled with module API=20060613, debug=0, thread-safety=0
    PHP compiled with module API=20060613, debug=0, thread-safety=1
    These options need to match
    in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘C:Program Files (x86
    )PHPextphp_curl.dll’ – The specified module could not be found.
    in Unknown on line 0
    PHP Warning: PHP Startup: dba: Unable to initialize module
    Module compiled with module API=20060613, debug=0, thread-safety=0
    PHP compiled with module API=20060613, debug=0, thread-safety=1
    These options need to match
    in Unknown on line 0

    So this suggests that it is not a missing file or path but the thread-safety option which is weird as everything I have read including the name of the download is ” PHP Non-Thread Safe” so why would the installer be installing a modules compiled differently to the PHP install? I will probably never know. I gave up at this point and removed PHP 5.2.8 completely and installed 5.3.8 via the Microsoft Installer for PHP which enabled curl and ldap but led to a whole different world of pain.

    Leave a Reply

    Your email address will not be published.