I have a Ubuntu 14.04 machine running a local server.
On this server, I have a PHP script that needs to access data on a remote Microsoft Azure SQL Database.
I was unable to find a way to access the database from Ubuntu uing purely PHP, so I tried out a Python script and imported the pyodbc library after following this tutorial: https://snakeycode.wordpress.com/2013/12/04/installing-pyodbc-on-ubuntu-12-04-64-bit/
I can run this script fromthe terminal, and it successfully connects to the Azure SQL Database and prints the output of my query to the console.
This was great news, so I began to test it out on my local server.
On the server, in a PHP method, I call echo shell_exec('my_script.py');
This gives me an error:
pyodbc.Error: ('08001', '[08001] [unixODBC][FreeTDS][SQL Server] Unable to connect to data source (0) (SQLDriverConnect)')
Why does my_script.py
not work when executed by the local server?