MAC homebrew php pdo firebird driver - php

I installed php53 on mac osx with homebrew. I need to enable pdo driver for firebird.
I tried to instal via pecl ..
I donwload http://pecl.php.net/package/PDO_FIREBIRD
and compile this but I get this error
...
...
configure: error: libgds or libib_util not found! Check config.log for more information.
I found that means that I don't have installed firebird develepoment libraries...
I have installed firebird 2.0 on my mac.. this version is working Flamerobin.
Does anyone have pdo firebird driver on mac server installed via homebrew?

Pdo Firebird from pecl is deprecated , i will updated it soon that i get access to it
you need to download the source code for php extract it and then build only the pdo_firebird extension
cd ext/pdo_firebird
phpize
./configure
(you might need to pass the firebird framework dir --with-pdo-firebird=/Library/Frameworks/Firebird.framework )
make
sudo make install
after that you need to copy the extension in your brew build php extensions folder and add it to php.ini
extension=pdo_firebird.so
I also recommend firebird 2.5.x is more recent and well supported on recent macosx versions

I've solve this issue by :
sudo ln -s /Library/Frameworks/Firebird.framework/Versions/A/Firebird /usr/local/lib/libfbclient.dylib
macOS High Siera 10.13.3

Related

Trouble installing mssql extensions for PHP

We're using a MSSQL db at work and I want to be able to write PHP scripts that fetches data directly from the db to my local MAMP environment. I've tried installing pdo_sqlsrv and sqlsrv using Homebrew and I've tried compiling the extensions on my own using PECL commands, but in both cases it has ended unsuccessfully with the error message:
fatal error: 'sql.h' file not found
I've been googling this problem all day and can't seem to find a solution that I can get to work/understand. I'd be grateful for any help or hints.
Computer: Macbook Pro 2018 (macOS 10.13.6)
Local environment: MAMP PRO 4.5 (PHP version: 7.2.1)
I found the solution here: https://github.com/Microsoft/msphpsql/issues/198
I was missing tools provided by unixodbc, so:
brew install unixodbc
...provided the .h file(s) I was missing. The PECL installer was then able to locate the required libraries. In case it wouldn't have worked, I would have tried:
sudo CXXFLAGS="-I/usr/local/opt/unixodbc/include" LDFLAGS="-L/usr/local/lib" pecl install pdo_sqlsrv
sudo CXXFLAGS="-I/usr/local/opt/unixodbc/include" LDFLAGS="-L/usr/local/lib" pecl install sqlsrv
...as suggested in the link.

How do I install PHP PDO ODBC drivers on CentOS 7?

I already have PHP 5.4 installed in a CentOS 7 VPS. I am trying now to access a legacy database in .mdb format with a PHP script.
However, my phpinfo() page says that only mysql and sqlite PDO drivers are enabled. No driver named ODBC is enabled.
Which is why I have tried to follow this tutorial to get that to work. But it doesn't work. bash: ./configure: No such file or directory.
I don't know from which folder I have to run the commands listed there. Is there a command which will allow me to install the PDO ODBC drivers from the system e.g. yum -y install php_odbc which would be easier for me to work with? If not, what am I doing wrong?
Looks like php_odbc is one of CentOS 7 packages.
See http://mirror.centos.org/centos/7/os/x86_64/Packages/ it is a very long list.
So yum -y install php_odbc should work. Just don't forget to restart your web-server if required.
You would run ./configure ... if you were compiling PHP from source. It will not work in your case.

Can not connect to MongoDB from PHP

I have installed MongoDB PHP lib
but despite this I can't connect to MongoDB database
Error of rockmonogo :
To make things right, you must install php_mongo module. Here for installation documents on PHP.net.
Error of phpmoadmin :
PHP cannot access MongoDB, you need to install the Mongo extension for PHP.
Error of Laravel with Jenssegers\Mongodb lib :
Unsupported driver [mongodb]
Make sure that it is in fact properly installed. The errors you're getting seem to indicate that your environment can't find the extension. I've compiled installation instructions for you.
Unix-like Systems
Open a terminal emulator and run wget http://pear.php.net/go-pear.phar
Then start the installation of PECL with php go-pear.phar
Install the PHP MongoDB extension sudo pecl install mongodb.
Add extension=mongodb.so to the php.ini file.
Mac OS X
Install homebrew by running /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" in a terminal.
Run brew update
Run brew tap homebrew/php
Install the extension according to your PHP version.
PHP 5.4: brew install php54-mongodb
PHP 5.5: brew install php55-mongodb
PHP 5.6: brew install php56-mongodb
PHP 7.0: brew install php70-mongodb
Windows
Open your web browser to http://pecl.php.net/package/mongodb
Open the latest version from the DLL link (with the Windows icon).
Choose the appropriate version from the DLL list. They are sorted by PHP version, system architecture (i.e. 32-bit vs 64-bit), and thread safety.
Extract the downloaded archive and place php_mongodb.dll in your PHP extensions directory.
Add extension=php_mongodb.dll to the php.ini file.
For mac system, the homebrew php tap mechanism is deprecated and it won't work. You need to manually install it or you need to install Ampps which contains all the packages in built.
The following error might be thrown for the user with new version of the system
Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.

MongoDB installation on Mac OS X 10.11, with MacPorts

I am trying to install MongoDB on my computer running Mac OS X 10.11 (El Capitan).
My Apache + PHP configuration was already working correctly.
I installed MongoDB and PHP drivers for MongoDB through MacPorts:
sudo port install mongodb
sudo port install php55-mongodb
Installation ran correctly.
I added mongodb.so file to the extensions loaded in the php.ini file:
extension=/opt/local/lib/php55/extensions/no-debug-non-zts-20121212/mongodb.so
When I run phpinfo() function in php file, mongodb extension seems to be loaded correctly:
I tried to test my connexion by initializing a MongoClient instance:
<?php
$mongoDB = new MongoClient();
var_dump($mongoDB);
?>
Unfortunately, I got a HTTP ERROR 500, and I got the following line in my Apache logs:
PHP Fatal error: Class 'MongoClient' not found in ...
Did I make something wrong ?
On most of site I saw you need to add the extension mongo.so and not mongodb.so in your php.ini.
If it's not solved your problem, I recommand you to install MongoDB Drive with PELC.
Run command line:
$ sudo pecl install mongo
And add this line to your php.ini:
extension=mongo.so
Doc php.net Mongo Installation
Finally found a solution to my problem.
As #neverpanic and #Zagonine made me understand, php-mongodb and php-mongo are not the same extension.
If you want to use old PHP driving classes, you should use php-mongo package instead of the very new php-mongodb.
Trying to install latest php-mongo extension, I had an other problem related to OpenSSL. To bypass it, I installed an old version of php-mongo extension:
sudo /usr/local/pear/bin/pecl install mongo-1.5.8
Hopefully it will help someone else.

How to install MSSQL drivers in mac OS for PHP

I have mac os i am running PHP 5.3.8 using xampp, I want to run an application which uses MSSQL I am unable to find any drivers for it. When I searched for MSSQL for PHP on mac I found freetds but i am unable to install freetds because i don't have gcc compiler installed on my mac and "make install" command does not work. I can't install gcc compiler because it can only be done using xcode and I am running osx 10.7.2 so i can't install xcode(latest requirement is 10.8.x +). Kindly suggest any other way to install MSSQL drivers on MAC
EDIT: I'm pretty sure you're going to need a GCC compiler to make this happen. You should be able to install a 10.7 compatible version of XCode: https://discussions.apple.com/message/23199440#23199440
You'll need to install unixODBC and FreeTDS. The following link gives instructions for installing each from source, or you may install via Homebrew or MacPorts.
From source: http://2tbsp.com/content/connect-ms-sql-server-and-sybase-ase-mac-os-x-and-linux-unixodbc-and-freetds
Homebrew instructions: http://www.acloudtree.com/how-to-install-freetds-and-unixodbc-on-osx-using-homebrew-for-use-with-ruby-php-and-perl/
With these libraries installed and configured, you should then be able to configure PHP to connect via PDO or MSSQL extensions.
Have you checked out dblib? Apparently, it's supposed to be able to connect to SQL Server from PHP on a Mac. Check out a Stack Overflow answer about it here.

Categories