Installing MSSQL driver for PHP on Ubuntu

The driver used is FreeTDS, TDS stands for Tabular Data Stream which is an application layer protocol, used to transfer data between a database server and a client. It was initially developed by Sybase Inc. (that’s where the name of the package comes from, for those curious) and later by Microsoft for their relational SQL databases.

In most cases this should work:

sudo apt-get install php5-sybase freetds-common libsybdb5

but if it doesn’t, you probably need to change the TDS version that is in use by the driver. The configuration file is named freetds.conf, and should be in your /etc/ folder.

There are 2 ways for this:

  • Change the global settings, uncomment the global version and set it to the desired one, e.g.
    • tds version = 8.0
  • Or make a new server and set the version explicitly
    • [exampleServer]
      host = server.com
      port = 1433 (this is default MSSQL port)
      tds version = 7.0
If you picked the latter way, then just use exampleServer as the host, e.g.
mssql_connect("exampleServer\\SQLEXPRESS", "user", "password");

Ow, if it still isn’t working, then you have probably forgotten to allow remote connections on your server. From the start menu find and open “SQL Server Surface Area Configuration” then “Surface Area Configuration for Services and Connections”. Find your instance, expand the “Database Engine” tab, select “Remote Connections” and choose the “Using both TCP/IP and Named Pipes” option. After applying, you must restart your instance for the settings to take effect.

For info on TDS versions used in specific MSSQL version you can go here, or just use the direct link and download [MS-TDS].pdf and go to Appendix A. (or just use the newest version, think it’s 8.0 at the moment, it should work fine)

Tagged , , , ,

VirtualBox doesn’t work on Ubuntu after kernel upgrade

One would think that they would automate the process… but no, need to run dpkg-reconfigure to rebuild it for the current kernel.

So run these 2 commands:

sudo dpkg-reconfigure virtualbox-dkms
sudo dpkg-reconfigure virtualbox

and your VB should be running again without problems.

Tagged , , , ,

How to setup LDAP Server on Ubuntu

LDAP (Lightweight Directory Access Protocol), in short, is an application protocol used to lookup for information on a server. As far as I figured, it is used mostly for user authorization or (e-mail) address books. The Wikipedia article on LDAP is quite good, so you can get basic info/ideas there.

Continue reading

Tagged , , , , ,

Platform Wars: Simulating the Battle for Video Game Supremacy

Not my type of thing really, strategy, economics… BUT, the idea of making a game so people can practice these things sounds a lot better. Instead of mindless crop growing, and watering at 3 in the morning, do “mindless” parameter changing to uncover the dynamics of a system.. Well, MIT surely choose the second. 🙂

Read the abstract, or try playing their Platform Wars which are free so far.

Tagged , ,

dochub.io (HTML/CSS/JavaScript/DOM Documentation)

For a software developer (or, well, anyone at all) good documentation is a relic! Since web programming is mainstream now, and anyone saying otherwise is just ignorant, there is a need for a good HTML, CSS, JavaScript documentation.

It was about time something like dochub.io appeared. Mozilla Developer Network made an awesome documentation for HTML/CSS/JavaScript/DOM.

 

Tagged , , , , ,