Connecting to Sybase database using Doctrine orm and php7 - php

I am creating a web application in php 7.2 and need to connect to a Sybase database. I am using Doctrine orm.
I have tried using the sqlanywhere driver and the pdo_sqlsrv driver to connect to Sybase.
However with sqlanywhere I am getting the error:
Warning: sasql_pconnect(): SQLAnywhere: [-832] Connection error: Connection was dropped (may not be a SQL Anywhere server)
With pdo_sqlsrv I get the error:
PDOException: SQLSTATE[HY000]: [Microsoft][ODBC Driver 13 for SQL Server]Protocol error in TDS stream.
I have googled both these errors and have not been able to resolve either.
Does anyone have any suggestions for how to connect to Sybase using php7.2 and Doctrine orm?

Related

connecting php to ms sql server database

I installed Microsoft SQL Server 2014 (x64)-Express and install the SQL Server Drivers for PHP 7, did changes in php.ini file also, still i am getting error while connecting php to mssql server database 'connection failed. could not find the driver'. Please help me to solve this error.
In my case, in order to access a MS SQL server database from PHP I had to do the following:
Have a PHP version installed that is compatible with microsoft SQL Server executables. Install PDO, PDO_sqlsrv driver and PDO_odbc driver.
Check the following link for instructions on how to install it.
https://learn.microsoft.com/en-us/sql/connect/php/download-drivers-php-sql-server?view=sql-server-ver16

A Database connection using "Mysql" was missing or unable to connect

My code is executing properly on development. But on production gives following error:
Missing Database Connection
Error: A Database connection using "Mysql" was missing or unable to connect.
The database server returned this error: Selected driver is not enabled
Error: Mysql driver is NOT enabled
Mysql extension on PHP 5.5.x and above is deprecated.
On PHP 7 mysql has been removed.
You should use PDO. If you can't, then try to replace your mysql with mysqli extension.
I got the same error, but it resolved with this
yum install --enablerepo=remi,remi-php70 php-mysqlnd

Connection Failed CakePHP 3 and MSSQL on Linux

I'm trying to connect a new project CakePHP v3 installed in a common LAMP on Ubuntu Server and the DataBase is a MSSQL 2008. I've tried to install the library php5-mssql but nothing changes. Any idea?
The error message received is:
CakePHP is NOT able to connect to the DataBase.
DataBase driver Cake\Database\Driver\Sqlserver cannot be used due to a missing PHP extension or unmet dependency
Thanks!
CakePHP does not have an ODBC driver at this time. You can connect to MSSQL servers using the SQLServer driver from a Windows server, but this issue (https://github.com/cakephp/cakephp/issues/6990 ) just keeps getting bumped.
Since Cake3 uses PDO drivers to connect SQL Server (from Linux), you should try to install Microsoft ODBC Driver for Linux, see
http://onefinepub.com/2013/03/ms-sql-odbc-ubuntu/
it may helps

Connect to SQL Server with PHP

I am trying to connect to a remote SQL Server Windows 2008R2 and a file server Windows 2008. I am wondering what the best way is to handle this. I've tried odbc_connect and mssql_connect without any luck.
When using odbc_connect I get these errors:
[unixODBC][Driver Manager]Data source name not found, and no default driver specified
[16-Jan-2014 16:02:12 UTC] PHP Warning: odbc_connect() [<a href='function.odbc-
connect'>function.odbc-connect</a>]: SQL error: [unixODBC][Driver Manager]Data source
name not found, and no default driver specified, SQL state IM002 in SQLConnect in
/mnt/stor12-wc1-dfw1/657080/843636/www.ia764.org/web/content/cms/wp-content/themes
/iatse/functions/syntonics.php on line 27
This is not my area of expertise so layman's terms are welcomed.
Any help/guidance would be greatly appreciated!
I had this problem, too. What you need to do is install FreeTDS so you can use the ODBC drivers. It's somewhat of an intense process if you're not familiar with linux. However, I've documented all the steps in the answers here Connect PHP to MSSQL via PDO ODBC
and here Can't Install FreeTDS via Yum Package Manager
This answer assumes you are on a linux server, not Windows.

How do I connect mssql with PDO using php 5.4.19

I am gettin following error when I connect to mssql
Uncaught exception 'PDOException' with message 'SQLSTATE[IMSSP]: This extension requires the Microsoft SQL Server 2012 Native Client ODBC Driver to communicate with SQL Server
And I am using
$db = new PDO("sqlsrv:server=127.0.0.1;database=test;", "sa", "mypassword");
I have also added driver in C:\xampp\php\ext and set that extension in php.ini file
[PHP_PDO_MSSQL]
extension=php_pdo_sqlsrv_54_ts.dll
I have tried several tutorials, what exactly I am doing, Please tell what I am doing wrong?
what version of the php pdo sqlsrv are you using?
Try updating it to v3.1
http://www.microsoft.com/en-us/download/details.aspx?id=20098
You might neet the ODBC driver as well:
http://www.microsoft.com/en-us/download/details.aspx?id=36434

Categories