Mssql mysql

I know php and a little of python, and i need to make a script that retrieves data out of MSSQL external server and insert’s it on a mysql server (if can’t be done with php) or just get the data out of the external servers!
I already tried to install freetds (and it seems it’s ok) but when i try to compile php gives a error saying that a dir where i install freetds is not the installation directory!