According to the ADODB:
http://adodb.sourceforge.net/
documentation, it can be used for a number of databases on "Unix and Windows", so I'm assuming that includes OSX.
I've enabled PHP in my Apache installation, installed ADODB and modified include_path to include the ADODB directory, however I'm at a loss as to how to enable particular drivers. I have Firebird installed, so I'd prefer to connect to that, however I'm open to using some other database server.
I've managed to work it all out on a Windows install, however there seems to be scant information on how to do it on OSX.
Related
My default php.ini file lists both extensions (installed via brew), and I sometimes see different variations on Linux (AMZN vs Centos) with the _pdo_ bit. What is the difference?
Update: I was getting errors saying pg_connect not found and this seems to be part of the non-PDO version. To get this installed on Mac via brew, I needed to add support by running brew reinstall php56 --with-postgresql
PDO is short for PHP Data Objects and is an abstraction that can be mapped on to a lot of different databases. This means you can move between things like MySQL, PGSQL and SQLite very easily. The PDO module enables the functions you see here for PGSQL.
The non-PDO module is specific to Postgres and will enable this set of non-standardized functions that will only work with Postgres databases.
The PDO extension can connect to different database management systems with the same syntax, as long as there's a driver for the system you want to use. The PostgreSQL extension can only connecto to PostgreSQL.
What you see is the PostgreSQL extension and the PDO driver for PostgreSQL.
I have mssql_* functions working on my Ubuntu installation and want to duplicate this on my windows 7 box. I have installed wamp on the win7 box, but I cannot get it to see the mssql_* functions. I have read many posts about nothing is working. I have the ext directory properly set. I have extension=php_mssql.dll do not see the mssql section in phpinfo, but I do see sqlsrv section. I would like my prod and test environment to match.
Thanks in advance for any assistance
Dean-O
I just checked my local wampserver 2.1 installation, and although there's an option to enable the php_mssql extension, it's missing from the extensions directory.
You can try the FreeTDS extension, which supposedly works fine under both *nix and Windows.
The Moodle wiki specifies that the Microsoft SQL Server driver has "known problems":
WARNING: This driver has known problems and is therefore not suitable
for any Moodle production servers.
and recommends the use of FreeTDS instead (by installing the php_dblib extension). Moodle is a known user of MSSQL, and a respected project, but they don't really specify what they mean by "known problems", so you can take this with a grain of salt...
http://docs.moodle.org/24/en/Installing_MSSQL_for_PHP
If FreeTDS doesn't work for you, you can try installing the official Microsoft drivers:
http://www.microsoft.com/en-us/download/details.aspx?id=20098
I have successfully configured php in IIS. sample php pages working fine. now i want to connect it to sql server i tried it by downloading a mssql .dll file in ext folder,I also tried by installing a extension for windows driver, then also it is not working. please help to sort out this issue. I am Using php5.3.19 for the same.
In order to use PHP 5.3 with SQL Server (2005 and above), you will need the Microsoft Drivers for PHP for SQL Server. There are two versions available: 2.0 and 3.0. 3.0 includes support for SQL Server 2012 and PHP 5.4.
You can find instructions for installing the dlls and interfacing with SQL Server in a TechNet article.
To install the extensions, you must move them into your ext folder and add a line to php.ini to load them, like the following:
extension=php_sqlsrv_53_nts_vc9.dll
Once this is done, restart the web server and load phpinfo in order to see if the extension has loaded. If it has loaded correctly, you should see a "sqlsrv" section in PHPInfo.
When the time comes for you to begin writing PHP that connects to SQL Server, make sure you have installed the native client. The current version is the SQL Server 2012 Native Client. References for the API are available on TechNet and PHP.net.
Finally, consider upgrading to PHP 5.4. The 3.0 versions of the drivers support 5.4 but the 2.0 versions do not; if you cannot install 3.0 on your system, you can find a 5.4-compatible version of the DLL (sqlsrv-5.4-nts-snap.zip or
sqlsrv-5.4-ts-snap.zip) on PHP.net. I have had good results with these versions.
I have set up a XAMPP installation on a windows server 2008 R2 that includes:
Apache 2
PHP 5.3.x
MySQL (not used anyway)
Then I have installed PostGreSQL 9.x. I have uncommented the pgsql pdo dlls in the php.ini file accordingly but when I try to connect to pgsql I get 'driver could not be loaded'. I am stuck as I couldn't come across a fix to that on the internet, I have tried adding the path of the pgsql installation (bin and lib dirs) to the PATH environement system but the problem persists. I have also rebooted the system many times after changing any configuration to ensure it is saved and applied but still same outcome.
I have read in a nonclear conversation that this might be related to the versions but couldn't find anything further.
If you have succeeded in performing the latter I would be greateful if you could provide me with some insight. (I am open to any alternatives except downgrading to older software versions).
Thanks so much for your time
Fixed by manually installing apache2 and php instead of going through xampp (or wampp). It seems those are buggy when it comes to the latest php version and pgsql pdo driver.
How to setup PHP (5.3/5.4) with MSSQL support on a windows development environment, if applications should be deployed to a linux system? So basically, which driver should be used and how (like using mssql_ functions or PDO or sth.)?
Currently the target system is running PHP 5.1.6 on some CentOS, but this could be updated if needed. We are using the mssql_ functions for database access. I tried to setup the development machine using XAMPP, but had to find out, that the support for MSSQL driver has been dropped in PHP 5.3.
The suggestion seems to be to use sqlsrv driver and functions, but this won't work on the web server.
Use ODBC, the SQLSrv extension is only intended for use on Windows.