Linux is a popular open source operating system based on Unix. Linux comes in many flavors including CentOS, RedHat, and Ubuntu.

Posts

Install the PHP SQLSRV Driver on Linux

Rejoice! Microsoft actually does provide a PHP Linux driver for Microsoft SQL Server. The bad news is, it can be a real pain to get it working.  I went through this experience tonight while setting up a utility I wrote for a client. I ran into two separate issues. This article provides some assistance with the issues I ran into when I tried to Install the PHP SQLSRV driver on Linux.

How to Install PHP SQLSRV Driver on Linux

The instructions in the repository’s readme.md are actually pretty good. Check out the official Github repository for the driver for the latest version and installation information. I recommend you follow their instructions first. When you hit a roadblock, come back to this article for help.

PECL Building with Wrong PHP Version

The final step in the installation is installing the base driver and the PDO variant withpecl install. PECL runs a build process on your machine and it uses a tool called phpize to execute the build. The version of this tool needs to match your PHP version. Otherwise, the build will succeed, but the extension file it generates won’t be compatible with the version of PHP you’re running. You’ll know pretty quickly if this is the case if you get “can’t load extension” errors after you build and execute PHP.

To solve the problem, install the version of phpize that matches your PHP version. For example, if you are running PHP 7.1, you would run:

sudo apt-get install phpize7.1

Microsoft ODBC Client is Missing

After I fixed the problem above, I ran my PHP script and the database connection failed. The PDO SQL Server driver reported an error message that it could not execute because it required the Microsoft ODBC Client. Installing the client is actually part of the steps in the instructions provided on Github. But for me, the installation failed and I didn’t notice. I went back and repeated this step and found that there was a missing dependency that would not install. Once I manually installed it and re-ran the client installation steps, then the PDO driver started working.

The Github repository below contains the official drivers from Microsoft. Check out the repository for the latest version information and installation instructions.

Microsoft Drivers for PHP for SQL Server
https://github.com/Microsoft/msphpsql
220 forks.
1,056 stars.
41 open issues.
Recent commits:

Converting My Business to Linux, Part 4: Updating my IPhone

(Back to Converting My Business to Linux, Part 3: Adobe Acrobat)

The last few days I’ve been using Linux on a daily basis without too many problems, but tonight I attempted to resolve an unresolvable issue: updating my IPhone to iOS 4.

Though there is plenty of support for syncing and using your IPhone under Linux, as far as I can tell updating simply can’t be done since ITunes is required to download updates. I installed ITunes under WINE, but since USB support doesn’t exist under WINE (or does it?) that wasn’t going to work.  I’m looking into libimobiledevice right now since the website says it supports firmware updates.  I’ll post an update when I know more.

Either way, I feel like this is an area where Linux has some room to improve!

Converting My Business to Linux, Part 3: Adobe Acrobat

(Back to Converting My Business to Linux, Part 2: Installation)

If tonight’s experience is any indication, my goal of 100% transformation from Windows to Linux is probably not going to happen.

Tonight I was asked my one of my clients to change a single page of a PDF document hosted on their website. No problem in the pay-to-play land of Windows, right?  You fire up your ridiculously-priced copy of Adobe Acrobat Professional and use the Replace Page menu option.  Dead simple.  On Linux? Not so much.

Editing PDFs on Linux

If all you need to do with PDF on Linux is view and print, your options are numerous and quite stable.  If you don’t like Ubuntu’s built-in PDF viewing support you can opt to download and install Adobe Reader from the Canonical Software Repository. Of course, that’s only if you miss all of the bloated and unnecessary features that make Adobe Reader what it is today.

If you have to create or edit existing PDF documents, you’re options are few and finicky.  I tried two methods: the first was to install PDF Edit from the Ubuntu Software Center.  PDF Edit has lots of features, but it couldn’t open the document that I needed to modify.  Upon further research I found that OpenOffice.org has a PDF Import extension.  I installed the extension, and it too had problems opening my document. Perhaps something was wrong with my docuement?

The Problem

I installed Adobe Reader as described above so I could verify that my PDF file would open using an Adobe product and so I could view it’s metadata.  Reader opened the document without any problems, but within the document metadata I noticed that the document had been created using the HP scanning software at my client’s office.  I tried opening other documents created with that software and verified that they opened in Adobe Reader, but not in PDF Edit or in OpenOffice.

The Solution

This isn’t so much a solution considering I still had to have Windows and Acrobat Professional available to solve the problem.  I opened the documents in Acrobat Professional and performed a “Save As.”  The new documents were now editable under both PDF Edit and OpenOffice.org’s PDF Import extension.

PDF Edit was able to quickly and easily replace the page that had changed within the document.  If it is able to open my documents in the future, this is what I’ll use to make changes to PDF documents on Linux.  The OpenOffice.org plug-in still has a long way to go.  It does exactly what I expected and what Microsoft Word import utilities have done for years: butchers your document.  But at least it opened!

Summary

I may find myself updating this post in the future as I have more experience editing PDF’s on Linux.  My initial impression is that “it’s close, but no cigar. PDF Edit almost worked, and if it is able to open and edit my PDF’s in the future I’ll consider this a success.  OpenOffice.org’s plug-in works just as good as other PDF Conversion utilities:  it will import your document and keep most of your text intact, but any graphics or stray marks in your PDF document will make your converted document almost completely unusable.

(Continue to Converting my Business to Linux, Part 4: Updating my IPhone)

Converting My Business to Linux, Part 1

Call it frugality.  Call it insanity.  Call it what you will, but I’m converting my computers that I use for my consulting business to Linux.  That’s right, I’m a Microsoft Certified computer consultant whose going to switch to Linux.  Actually, I’ll go one step further: I’m going to try to switch completely to Free Software. This means:

  1. I will install and use Ubuntu Linux as my operating system.
  2. I will use OpenOffice.org as my office suite.
  3. I will use Evolution for email, calendars, and contact management.
  4. I will try to find and use a Free Software alternative to QuickBooks to manage my business accounts.
  5. I will try to find and use Free Software alternatives to Adobe Creative Suite.
  6. I will try to find and use a Free Software alternative to Virtual PC, so I can install Windows 7 and Server 2008 into virtual machines for my Microsoft training.

I’m pretty darn goods with computers, but this will be a daunting, quite possibly annoying, and maybe even futile task even for me.  So I invite you to come along and gawk at the train wreck I’m about to embark upon…

Proceed to Converting My Business to Linux, Part 2: Installation.

9 Reasons to Switch from Windows to Linux, Revisited

(Note: the original article I was responding to disappeared from the Internet sometime between 2009 and today.  I’ve updated the link to reference a cached version on archive.org, but there’s no guarantee that will remain active forever.)

After stumbling upon this article listing 9 Reasons to Switch from Windows to Linux, I felt more than a little compelled to respond critically to some of its claims.  That response became a bit long-winded to post as a comment, and so I decided to post a full rebuttal here on my blog.

Comparing Modern Linux to Old Windows

Although I agree with some of the claims in the original article, it seems as though it was written from the perspective of someone who switched to Linux in 1998 and never looked back.

The article was comparing fresh apples to rotten oranges. If one’s goal is to compare Windows and Linux and list the ways in which one outperforms the other, it’s only fair that we compare the versions with the closest release dates.  In other words, it’s unfair to compare the feature set of Windows 98 (released in June of 1998) to that of Ubuntu 9.04, code named Jaunty Jackalope (released in April of 2009).

1. Your Computer is Getting Slower!

First off: my computer isn’t getting slower.  I’ve run Windows XP on dozens of systems for years without a reinstall or even a reboot for months at a time, and unless I installed new software the performance never really changed.

I’ve worked on the sort of computer the author is referring to (I affectionately call them “thrashers“), and it seem to me that the tendancy for a computer to get slower over time has more to do with junk hardware and irresponsible usage patterns than about the operating system.

Think about this logically for just a second: people who use Linux tend to be highly technical individuals who might understand that there could be repercussions to downloading dozens of pieces of software from unknown sources on the Internet. If they use their heads, the sort of behavior that leads to a slow PC never happens.  In addition Linux comes with a large collection of programs and utilities which negates some of that need to constantly download and install programs from the Internet.  Why not list that as one of your reasons to switch?

Admittedly file system fragmentation  is still a problem on Windows that can degrade your performance over time, regardless of how responsibly you use your computer. You should defregment on Windows occassionally to keep things zippy, but Linux’s Ext2, Ext3, and all-new Ext4 filesystems aren’t completely immune to fragmentation, and fragmentation on a modern Windows system using NTFS  isn’t the crippling disease it was on FAT and FAT32-based Windows 98 systems, either.

2. You are fed up with viruses and spyware and you heard Linux does not have any!

Windows is a victim of it’s own popularity. If you were a hacker looking to cause damage to the greatest number of computers or a spyware developer looking to profit off the largest number of possible infections, would you target Windows or Linux? After taking into account the fact that Windows has an 87.9% share of the desktop operating system market, versus a 1.02% share for Linux. It’s a fact that there are fewer viruses written for Linux than Windows, but to say there are no Linux viruses is a fallacy.

This begs the questions: is Linux more secure than Windows? Or is the disparity between the amount of malware on Windows versus Linux simply a function of security through obscurity? This debate has raged for years and lack the energy to rehash it, so read this comprehensive discussion on Windows and Linux Securiyty at The Register instead (spoiler: Windows loses).

In Microsoft’s defense, some of the most sever virus outbreaks have been 100% preventable. The Conficker virus spread through unpatched systems (computers that aren’t installing their OS updates).  Microsoft released a patch to the bad code months before a virus was found lose in the wild that exploited it. In my opinion this is even more anecdotal evidence of the disparity in usage patterns between Windows users versus Linux users. Would users automatically become more responsible and install patches if they switched to Linux? Probably not.

3. Your old printer or scanner don’t work with the latest version of Windows!

A few weeks ago I attended a CPLUG  meeting where for the first time I was able to participate in face-to-face discussions with real Linux power users.  In one of my conversations, I told a CPLUG member that I simply didn’t have much use for Linux because I can do everything I need to do very effectively in Windows. His response that was that I could install Linux on an old 486 and turn it into a router and firewall for my home network. My response was that that would be a waste of my time, since I can already by a powerful home router for $50.00 that consume a heck of a lot less electricity than a full desktop system.

Linux has fantastic support for old hardware, and if supporting your printer from the 1980’s is a priority but supporting your modern Windows software is not, then by all means, look up your device on the official Linux Hardware Compatibility site and go to town, my friend.

In my experience the Linux community has been so focused on support of legacy device compatibility that they neglect the fact that some of the most common off-the-shelf components don’t function on Linux out of the box.

Be warned: when your hardware doesn’t work out of the box with Linux, making the “tweaks” neccessary to get it fixed aren’t as trivial as they often are on Windows. Malfunctioning video drivers sometimes require you to drop to the shell and manually edit configuration files like x11.conf, whereas in Windows you could use Safe Mode to install the right driver or change your display settings in a low resolution mode which should work on any video hardware. Oh, and take a look at the steps neccessary to make one of the popular WPC54G wireless adapters work on Ubuntu Linux.  Real user friendly, huh?

It’s true that Windows Vista doesn’t have very good legacy hardware support, but it’s out-of-box support for modern hardware is impeccable.  There are two simple solutions to the legacy hardware dillema. The first is to upgrade to modern hardware, and at the cost of most home printing and scanning (and other) devices you’d be doing yourself a disservice to disregard this as an option. The second option is to simply skip Vista. Unless you have a specific reason to upgrade from Windows XP, don’t. Microsoft has pledge support for Windows XP through April of 2014. No one is forcing your hand to switch operating systems any time soon, despite what the original article might lead you to believe.

If you do decide to upgrade to Vista (or Windows 7 for that matter), download Microsoft’s Vista Upgrade Advisor. This free utility will check your system, analyze your hardware and software, and tell you what needs upgraded before your computer can run Windows Vista.

4. You have a computer without Windows and don’t want to buy Windows

Despite the annoying grammar and the fact that the author actually had the audacity to link the words “buy Windows” to an Amazon Affiliate link, this is a good point.  If you built a computer yourself or inherited a computer and not an operating system, you may find yourself in this position.  I can’t argue against Linux as a valid option in this scenario.  However if you are buying a new PC and are considering buying it without Windows in order to save money, think twice. Many manufacturers won’t sell you a computer without Windows, or at the very least won’t sell it to you any cheaper.

5. You want to run a Linux application

As the author mentioned himself, some of the best software available on Linux is already available for Windows, so switching operating systems probably isn’t neccesary.  Much of the software I use on a daily basis is open source, and a lot of it was originally built for Linux.  Some examples are PHP, Apache, NetBeans IDE, MySQL, Firefox, Gimp, FileZillaSubversion, and VirtualBox.

Speaking of VirtualBox, even if a Linux application you want to use doesn’t have a Windows-compatible version, you don’t have to give up Windows in order to install Linux and run your program.  Provided your computer has the neccessary power, you can install Linux in a virtual environment and run your program from there.

6. You want to (re)use an old computer.

In my opinion this is where Linux truly shines.  You can install a bare-bones Linux distribution like Damn Small Linux or powerful but non-graphical distribution such as Ubuntu Server on old hardware and use it for a variety of purposes.  I have personally used an old Pentium 3 workstation to host Counter-Strike: Source network game server, and used similar hardware equipped with the SAMBA package to emulate a Microsoft Active Directory domain. Other ideas are lightweight print servers, files servers, and LAMP-based web servers.

7. You had problems with Windows activation.

Admittedly Windows Genuine Advantage got off to a bad start, and like most copy protection schemes, only affected the people who legitimately paid for their software.  However we’re now three years out from WGA’s release, and most of the compatibility issues and reports of “false positives” of pirated software have been resolved. Unless you are philosophically opposed to paying for software, Windows Genuine Advantage doesn’t seem like a logical reason to completely switch your operating system.

8. You do not like the new Vista interface of Windows.

Once again, no one is forcing anyone to switch right now. Unless you buy a new computer preloaded with Windows Vista this isn’t even an issue.  What I’ve found after switching many users from Windows XP to Vista is that users convert over kicking and screaming, but within a few weeks come to appreciate many of the interface changes in Vista.

If fear of change is the issue with switching to Windows Vista, how is switching to a completely different operating system going to help anyone? Most of my customers would freak if they didn’t see the “Blue E” on their desktops that has become synonymous with the Internet.

9. You are curious about Linux.

Once again, there is no reason for a full conversion from Windows to Linux.  Thanks to virtualization technology, operating systems can coexist on the same system. By installing and exploring Linux within a virtual environment, you can decide for yourself wether or not it is worth a permanant switch without making any life or work-altering decisions on your physical system.

It should be noted that I’m no Linux expert, but I do have years of experience with Linux as both a casual user and as an LAMP-platform web developer.  I’ve been using Microsoft Windows since Windows for Workgroups, I co-administer a 350-workstation Windows network,  and I am a Microsoft Certified Windows Vista Technology Specialist (I’m not quite finished with the full MCITP curriculum).