> For the complete documentation index, see [llms.txt](https://docs.hivesql.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hivesql.io/tutorials/hivesql-for-php-developers.md).

# HiveSQL for PHP developers

It is a bit tricky to enable PHP on Linux to work with MS-SQL servers.\
Here is a procedure for this to work:

* install `php-pdo-dblib` (if you're using PDO)
* then `echo "extension=pdo_dblib.so" > /etc/php.d/mssql.ini`
* then restart your httpd
* you also need the ODBC drivers\
  `curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo`\
  &#x20;`yum remove unixODBC-utf16 unixODBC-utf16-devel #to avoid conflicts`\
  &#x20;`sudo ACCEPT_EULA=Y yum install msodbcsql17`\
  &#x20;`sudo pecl install sqlsrv`\
  &#x20;`sudo pecl install pdo_sqlsrv`
* You should add "extension=sqlsrv.so" to php.ini\
  You should add "extension=pdo\_sqlsrv.so" to php.ini

Thanks to [@drakos](https://peakd.com/@drakos) for this information.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hivesql.io/tutorials/hivesql-for-php-developers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
