Connect to MS SQL Server from PHP on Linux? [closed] - php

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I need to connect to an MS SQL Server database from a PHP script running on a Linux server. I'm looking at using FreeTDS as there is no official MS SQL Server driver for Linux. Is this my best option? Is it ok in a production environment? Are there other options, perhaps ODBC?

The company I work for has been running FreeTDS to connect to SQL 2000 on our production server for almost 6 years now. There's a couple of issues with special character encoding, but overall it works well.

Is the best free option. I've used it with Qt (C++).
You can use it with unixODBC.
If you can pay it you could use the driver from easysoft

Related

Using PHP with PostgreSQL instead of MySQL [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
NOTE: This is not about which better database, not at all.
Hi, my client has a shared host with the following stack:
PHP: 7.x.x
MySQL: 5.6.x
Postgres: 9.2.x
PhpMyAdmin
PhpPgAdmin
I'm able to use both MySQL(PHP) and PostgreSQL(C#, Go, Python, JS), but I personally prefer Postgres, also my client's host specs make it harder to use some SQL features like CTE which have no support in MySQL 5.6 (I know 8.0 has them).
The problem:
I plan to use Postgres, but I'm a little concerned about the combination of PHP+Postgres, since it seems that most PHP development is coupled with MySQL, for example, PhpMyAdmin is activly developed compared to PhpPgAdmin (the last release from 2018), also it seems it ALWAYS assumed that PHP runs using MySQL while Postgres is like a second citizen.
So, in your experience, should I go with Postgres or MySQL, to minimize the trouble that may arise?
Thanks.
I have used php with postgresql for about 20 years off and on. The driver is stable enough. You lack built-in support for some of the fancier data types in PostgreSQL (or used to anyway) - ranges, arrays etc.

How does PHP (mysqli or pdo) run MySQL commands? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
When using mysqli or PDO in a PHP script what are the mechanics that take place for the sql query to run?
Does the mysqli module run shell_exec() with a mysql command? I'm sure there is something more here.
Edit
More specifically what I wanted to know was what is the process that PHP takes to actually make a MySQL call, what are the mechanics involved for PHP to have access to the database.
There is a thing called Mysql C API.
Both PHP extensions are written by implementing low-level C functions from this API.
It connects directly over a socket to the server. There is no way to have connection pooling if you're just doing shell_exec(), which you may have noticed is an option. Not only that, but running another executable for every single query is insanely slow. As the other answer has mentioned, PHP uses C-bindings for Mysql which do all the hard work reading/writing sockets.

Which on is better? php on iis or php on WAMP Server on windows server 2003(VDS) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have a VDS(Virtual Dedicated Server) that Windows Server 2003 is installed on it. I want to use php and MySQL on my VDS. I have two options: 1-install wamp server as a web server or 2-install iis and then use php and MySQL on iis.
Which one do you suggest me to use?
Wamp is a great tool for development but it's not very secure and fast for production.
In my opinion, on Windows the best option is IIS, faster and more secure.
You can easily find some tests by searching on Internet :
https://groups.drupal.org/node/234373
I recommand wamp, more stable and efficient.

Connect PHP (GoDaddy) to local Oracle Database [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I've been trying to find a way for a while but I had no success! (OCI, PDO..)
I need Oracle (Express) or something in my php installation.
Could anyone help me? GoDaddy PHP to Oracle DB.
Thanks!
Download INSTANT_CLIENT
Set `%ORACLE_HOME%` to your instant client path
Set `%TNS_ADMIN%` to your `*.ORA` files
Add `%ORACLE_HOME%` to your `%PATH%`
Enable the extension `php_ociX.dll` in your `php.ini` file
Restart your Apache Server
Follow this example to connect to ORACLE : http://php.net/manual/en/oci8.examples.php

Using SQL Server with PHP [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
PHP was originally made to interface with MYSQL. I'm wondering what is the difficulty level and how the best way to go about using PHP with SQL Server 2008 r2 is. I've done some research and it seems like there are some usable libraries. Is this something that is feasible on the production level?
PHP has a library for dealing with MSSQL (http://php.net/manual/en/book.mssql.php). You also might consider using something like PDO with its appropriate driver (http://www.php.net/manual/en/ref.pdo-sqlsrv.php) if you would like a more abstracted library to work with.
There is a SQL Server driver that works under windows: http://www.microsoft.com/en-ca/download/details.aspx?id=20098
http://php.net/manual/en/book.mssql.php
take a look at http://puurunen.ca/blog/?p=139
You should find there some info on sql server 2008 r2 PDO implementation

Categories