Bridge between an Linux Apache server and Windows SQL server

A short description showing how to automatically run a simple PHP script on a windoze machine that connects to a local SQL server database, grabs some data, then sends it to a remote Apache server. I'm assuming that you already have a remote server running so have only provided instructions for installing the windows server below.

Setup your windows environment

1. Install Apache and PHP on the windows machine. xampp makes this easy: http://www.apachefriends.org/en/xampp-windows.html#522

2. Install SQL server driver in your PHP extensions "xampp/php/ext" folder.
http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&Family...

3. Change php.ini (xampp/php/php.ini) so the extension is loaded. This should look like this. Though you may need to change which .dll you specify depending on your system.
extension=php_sqlsrv_53_ts_vc6.dll

4. Install Microsoft Drivers for PHP
http://msdn.microsoft.com/en-us/library/cc296170%28SQL.90%29.aspx

5. Now make sure your installation is secure by following these instructions:
http://robsnotebook.com/xampp-security-hardening

And apache / PHP should now be all be up and running. So all you need to do now is run a PHP script (as a scheduled task) to connect to your SQL server database and send it to the remote server - an example script will follow soon...

Comments

Post new comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3> <h2> <h4> <img> <div> <table> <tr> <td> <pre>
  • Lines and paragraphs break automatically.
  • Insert image: [img:node_id align=(left|right) size=(|fullLA|fullPreview|fullSQ|halfLA|halfPO|halfSQ|thirdSQ) action=(popup|link|frame) url=url style="margin:10px;" title=text description=text]

More information about formatting options

 
info@theanthillsocial.co.uk XHTML 1.0 Strict CSS2 WAI