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.
Related
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.
I need to use PHP pthreads on Mac OS High Sierra, but Homebrew is no longer supporting downloads of PHP --with-thread-safety.
How do I get and install a thread safe version of PHP for Mac OS, Php v7.1.16 without homebrew?
If it is going to have to be some sort of manual install - does anyone have step by step directions for the mac or know where I can get instructions?
I have been looking on the internet for instructions for 5 hours now. I'm tired and can't believe that no one has any posted info on this.
I was able to get PHP 7.2.5 installed on Mac OS HighSierra with ZTS/Thread safety by using phpbrew.
Install Steps I took:
Downloaded phpbrew from http://phpbrew.github.io/phpbrew/ and installed with their directions. Please note at the end of the installation, they give you further instructions for setting up your ~/.bashrc to load phpbrew, look for them at the terminal.
Once you have phpbrew running you are ready to install php with zts by using the command below (of course you can install all of the extensions that you like by checking the installation for extension instruction)
phpbrew install php-7.2.5 +openssl='/usr/local/opt/openssl/' -- --enable-maintainer-zts --with-curl=/usr/local/
It is important to have openssl and curl already installed before installing php and you must point to their location on your computer at the install line as I have done above. You can add all the extensions you need, but you must have the openssl and curl because I had a ton of problems with installation without them. But you could try omitting.
For those of you who are using PHP ZTS so that you can go on to install pthreads --ONLY PHP 7.2 and above works with Krakjoes pthread-master which you can download and follow the installation at https://github.com/krakjoe/pthreads
So our friends at Homebrew have gone and changed things. They've deprecated Homebrew/PHP. That's fine, that's what we developers do. I was able to successfully install PHP 5.6 using Homebrew on a fresh installation of OS X High Sierra. I'm trying now to install memcached and mcrypt, but with the Homebrew change I understand this needs to be done through Pear/PECL. However when I trying to use PECL, I get the following error message:
$ sudo pecl install memcached
pecl/memcached requires PHP (version >= 7.0.0), installed version is 5.6.36
I'm wondering now what my options are. I need to stay with PHP 5.6 for now because that's what I need to code against until I can get our stuff up to PHP 7.x.
I'm going to go with Docker. I'm learning it now and it is a breath of fresh air. I'm certain it will work.
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
I know you cannot install the MongoDB server on a PowerPC Mac, but I can't find any instructions on installing JUST the PHP driver to XAMPP.
Does anyone know if this is possible. If so, how do you do it? I've done extensive searching and can't find an answer to this.
I dusted off a G4 Powerbook with OS X 10.5.8 to test. Turns out that the current precompiled version of mongo.so for PHP 5.3 on github doesn't support PowerPC (the PHP 5.2 build appears to).
I downloaded the PHP 5.3.1 source to match XAMPP 1.7.3 and compiled my own mongo.so (1.2.12).
I did some minimal testing with XAMPP 1.7.3 on PowerPC to confirm this appears to work. Essentially, I just pasted the example from the MongoDB PHP Driver Tutorial, and inserted some documents into MongoDB 2.0.6 running on another computer.
Note this is an unofficial & unsupported mongo.so build, the same as what you should get building successfully from source with pecl install mongo. As a bonus, this is a much newer driver version than the precompiled OS X ones currently on github.
As a warning: I'm not sure about limitations or quirks of using this on PowerPC. Most of the OS X world has moved on to Intel architecture now.
So, instructions to use:
Download and install XAMPP Mac OS X 1.7.3 universal binary.
Download mongo-ppc-1.2.12.so from my github: mongodb-php-driver/downloads
Rename that to mongo.so and copy into /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/
Edit XAMPP/etc/php.ini and add a last line with:
extension=mongo.so
Check via phpinfo() that the mongo extension is available. Make sure you stop/start Apache if it was already running when you added the extension.