It seems to me that if you are writing in an interpreted language that it must be difficult to sell software, because anyone who buys it can edit it/change it/resell it without much difficulty.

How do you get around this? I have a couple of PHP apps that I'm reluctant to sell to people as it seems that it's too simple for them to change/read/edit/sell what I've produced.

+6  A: 

People sell the service of creating web sites all the time. Also, even a compiled language can be altered, it`s just more difficult.


Obfuscation may be a good way to go

Daniel Silveira
If somebody REALLY wants to get at your code, they can. Usually, obfuscation isn't worth the trouble.
Jason Baker
+1  A: 

Don't sell the software, sell "licences".

I'll try to explain better, build the web app but provide hosting for it. this way your client will never get to "hold" the source code.

If you really must deliver the source code, Obfuscating is the way to go ;)

Obfuscating is a pointless waste of time that rarely accomplishes anything more than being an annoyance. TrollTech, MySQL AB, and many other companies deliver unobfuscated source code and do quite well because of - not despite - doing so.
Dave Sherohman
Well, that is the concept of open source, is it not? We are not discussing open source software in here.
-1 for "obfuscating is the way to go".
+1  A: 

Read the answer to How do I protect python code? and replace Python with PHP.

+5  A: 

Most of the time the user base does not understand how to make the changes or what to do with the scripts so you are really selling your knowledge of how to install and change the scripts.

David Allan Finch
Let's hope the users know this. Considering the kind of questions one can read in PHP newsgroups, I guess many people want to save some buck.
A lot of people would like to save money by servicing there own car, but most still pay someone else to do it ;)
David Allan Finch
+13  A: 

Hardly anyone sells code. We sell the ability to create, edit, support and understand the code.

I recently got a couple hours freelance work for putting some VBA behind an Excel sheet! We are valuable for knowing how, not the end result.
But there's a difference between consulting and selling a licenced product. Unless I misunderstand, you guys are talking about consulting, and Rich Bradshaw is talking about licensing a product.
John MacIntyre
Not entirely unrelated. You just have to provide something with the license that can't be readily copied, such as support services (which may or may not include consulting).
Dave Sherohman
John, even licensed products aren't always selling the code. Pirating a product for business usually isn't a great idea because you'll always need support and extension. If your business relies on the product you'll be gimped when things go wrong.
+1  A: 

With PHP you have the option of using the Zend Guard for PHP. I believe it compiles the source code in a way similar to what the php interpreter does, so it should also increase performance. Of course the price of $ 600 may be too much for your liking ;-)

Anyway, I see no reason why you shouldn't distribute your code with an open source license (see the Open Source Initiative for a list of licenses available). You can find one that prohibits your customer from redistributing your app.

+9  A: 

As a potential buyer of your application, I might find these features attractive:

  • The ability to change the code to suit my needs
  • The ability to read the code to better understand what it's doing

... and yes ...

  • The ability to sell my modifications

All three of those are features.

The third one might be a feature you can't afford to give me. Fix that through legal measures, not technical measures. That's what licensing is for. You could also sell more expensive licenses which do allow resale.

There are things you could do to remove the first two features, but bear in mind that in doing so you are reducing the overall value of your product to some people, and therefore its sale price.

For many people the primary reason for using Open Source software is not that it costs nothing -- it's that you get the source code.

+2  A: 

Plenty of companies make money off of applications in interpreted languages and happily distribute the source code with them. Don't take this personally, but your program probably isn't going to be popular enough to have a large following of pirates. And anybody who would pirate your software probably isn't going to buy it in the first place. If they can't pirate it, they'll pirate somebody elses.

Whatever you do, please don't obfuscate your code. It's not an effective means of preventing infringement and it won't do anything other than make life miserable for you and your customers.

Jason Baker
+1  A: 

Protecting your secret bits is getting more and more difficult.

IMHO, your solution really depends on your target market. If you are targeting business, just give them the code with a good license, and possibly some type of defect so you can determine who gave your code away if that ever happens. Businesses will mostly pay for your app just to stay compliant; it's not worth the legal hassles. And if an individual gets your app for free, that's probably a good thing, since they will try to convince their current and future employers to buy it.

If you are targeting individuals, and can do it as a web app (which you obviously are with PHP), do it as a hosted service, and either sell a monthly subscription or allow free access and find another way to monetize it.

If you definitely need to or want to distribute it to individuals for whatever reason, you can give it away for free, and try to monetize customizations, add-ins, & other support features.

This is a problem that's been discussed a lot, and a few hours’ worth of really focused googling should reveal all the current philosophies on this.

I hope this helps.

John MacIntyre
+2  A: 

Possible routes to go:

  • Translate to a bytecode, binary or an obfuscated format

For instance, Splunk is written mostly in Python, and distribute bytecode. The EVE online client uses Stackless Python to compile to an executable binary.

  • Host the solution yourself

Put up a website, charge for use.

  • License the software

They get the source, but cannot legally modify or redistribute the source.

  • Open source the solution

Anyone can change the code, but you are the de-facto authority on it, and you can earn money by selling support, consultancy and customization services.

You could also consider a combination of approaches. E.g., partition your solution into several stand alone packages, and then open source some of them, and sell bytecode versions of other parts. What you then sell is the complete solution, as well as other services, and some people may benefit and enhance other parts of the solution.