Softaculous


Topic : Firebird doesn't work on a clean install


Posted By: pisisler on July 9, 2016, 1:33 pm
Platform: Windows 8.1 Pro 64bit
Installed components; Firebird 2.5 (64bit), Ampps 3.5
Using: PHP 5.6 (32bit)

Before upgrading to Ampps 3.5, I was using Ampps 2.5 with Firebird 2.5 and PHP 5.4, my Firebird code was working. Upgrading Ampps broke the code. Since I couldn't change PHP version, I uinstalled Ampps completely and did a clean install of Ampps 3.5

Now, with PHP 5.4 which I was using, OpenSSL won't work. (Couldn't load dynamic library php_openssl.dll). I had to change PHP version to 5.6 and extract php_openssl.dll from original PHP setup from php.net to make it work. Everything is the same, no configuration changes made; OpenSSL is now working with PHP 5.6 and doesn't work with PHP 5.5 or PHP 5.4.

Whatever, I am OK with PHP 5.6 for now. But couldn't make PDO_Firebird work with either version. Here is the PHP startup error log;

Code
Couldn't load dynamic library of php_interbase.dll, %1 is not a valid Win32 application
Couldn't load dynamic library of php_pdo_firebird.dll, %1 is not a valid Win32 application


Copying any files from Firebird to somewhere else isn't the concern now, because everything is in the same place and it was working before I upgraded to Ampps 3.5. But nevertheless, I copied fresh 32bit fbclient.dll both from my Firebird installation in program files and from a clean setup downloaded from Firebird web site. Copying that files again to Windows, System32, SysWow64 and root PHP folders is no use either. Copying 64bit version of the file or renaming it to gsd32.dll for compatibility brought no luck either.

So much weirdly, PHP cli and PHP Apache module are loading the same php.ini file but are producing different results.

phpinfo() has no signs of Firebird, PDO_Firebird or anything similar at all and it prints:

Code

Loaded configuration file: E:\Server\php\php.ini
...
PDO Drivers mysql, sqlite


Running php --ini, php -m, php -i | find "firebird" prints;
Code

Loaded Configuration File: E:\Server\php\php.ini
...
PDO_Firebird
...
PDO Drivers firebird, mysql, sqlite


Really what's going on?! CLI says that firebird driver is available while phpinfo() says it's not! Both rely on the same php.ini.

Script run on browser throws an exception saying Firebird driver is not available; while CLI can successfuly connect to Firebird server but it produces a warning like;

Code
Warning: Module 'PDO_Firebird' already loaded in Unknown on line 0


This has got my 2 days and I am stuck, my business is slowed down because my integrations doesn't work; I have to do lots of things manually just because of this. So please, any ideas?

Posted By: Rishi_P on July 11, 2016, 6:58 pm | Post: 1
Hi,

Please open support ticket here:
https://www.softaculous.com/support/

Posted By: pisisler on July 12, 2016, 9:26 am | Post: 2
I solved this problem. It was actually caused by Apache and PHP reading different directories to find fbclient.dll

Steps to be taken:

1- Make sure PHP and apache\bin folders are in path.

Press Windows+R buttons, type sysdm.cpl, press enter, go to Advanced tab, click system variables at the bottom, double click Path variable and if there isn't your php root and apache\bin added, add them manually. like ;c:\ammps\php;c:\ammps\apache\bin

2- If you are tired of different php.ini files are exchanged between PHP CLI and Apache module, then edit PHPIniDir directive in Apache httpd.conf file to point the root PHP folder, instead of Apache's. This way, CLI and Apache will use the same configuration file. Otherwise you might experience different configurations ran and different results taken from CLI and browser.

3- If you are using Ampps, then you are definitely using PHP 32bit (aka x86), then you have to have fbclient.dll 32bit version from a Firebird installation or a Firebird setup.

You might have Windows 32bit or 64bit, or even worse you might have 64bit Windows but Firebird 32bit. It's a complete mess; it will be hard for you to determine which file to copy; so I highly recommend downloading a fresh Firebird 32bit Zip version from Firebird's website. Whether you are on Windows 32bit or 64bit, you must download a 32bit zip file, because Ampps uses only PHP 32bit, unless you cracked your head to exchange it with a PHP 64bit installation from php.net.

When you download an 32bit zip from Firebird website, just copy bin\fblient.dll file to both;

ampps\php and ampps\apache\bin folders. Copying to one and not to other might cause some of your applications to work and some to break.

Powered By AEF 1.0.8 © 2007-2008 Electron Inc.