views:

121

answers:

6

I wanted to get some thoughts on selling a PHP application (CMS). I intend on offering a free version that may include ads or be limited in some way. My main concern is how to detect if the user has purchased a license or the paid version or not.

My idea is to have a file (license.php) which will check a variable against one on my database and make sure it matches the domain purchased for. Is this a good idea if the client's server maybe does not have curl enabled or is there another method to do this?

Also once I have set that $licensed = true, how would I make sure that continues change other things throughout the application. For example, if I had something like this:

if(!$licensed){
showads();
}

I guess there is no way to prevent them from just commenting out that section or modifying it.

I don't have too much of a problem in general with this, but wanted to see if there were any better ways people may have come up with. Thanks!

+3  A: 

The only technical solution (well... not really a solution, but something good to have) to protect a PHP application sold to the client is to have it obfuscated. Other than that you can't do much to protect you code and/or enforce a license.

Also your question is similar to this: http://stackoverflow.com/questions/232736/code-obfuscator-for-php

I recommend some obfuscation + license agreement + trust.

Alin Purcaru
That is not a solution, it's basic protection which is still easy to get around
Harmen
There is no other technical solution. The only real solution to this is legal action. Also basic protection is better than nothing.
Alin Purcaru
You could use something like zend guard but it would cost money and requires some sort of free server module to interpret the intermediate code.
CtRanger
Zend Guard requires the end user has Zend Optimizer installed. That's pretty much a deal breaker right there.
mellowsoon
That will only work for enterprise products.
Alin Purcaru
I do want there to be the ability to have some sort of customization, so I think I will play a bit with Zend Guard or another obfuscated solution for certain areas and work it in with an agreement. Thanks!
kilrizzy
+2  A: 

ZendGuard is pretty much the standard when it comes to this: http://www.zend.com/en/products/guard/downloads

mmattax
+2  A: 
Gordon
+1  A: 

Since php is a script language you can't protect the code very well unless you host it yourself. The source is open so people can change it easily. If you want to sell it as license you can offer it as a hosting package where you maintain the hosting of the site yourself or change to a language which can be compiled (although this can be hacked as well but it is a lot harder).

You can protect it with licenses but people don't always care about that.

Mark Baijens
Hosting yourself is not an option for a CMS. You have to give it to the client.
Alin Purcaru
+1  A: 

You'll be looking for a PHP encoder. I've heard good things about IonCube. Of course there might be a trade off - definitely in the area of maintenance for you (although it's not so different from compiling from a process point of view).

Obfuscation will only get you so far - it'll make it harder for observers to understand, but not impossible for them to comment out your above line in source.

Rudu
+1  A: 

Being in the app business, with a focus on CMS, I offer you good luck. There's SO many good, mature solutions out there already that you're going to be selling into a saturated market. Any more, it seems, the only money in CMS development is one-offs that are specially customized to the user. But I digress.

There are several companies that are using the "open" code concept to their advantage such as Interspire. I like their model--they openly sell it as open, so the code can be modified as a client might wish, which in my mind is a huge selling point. There is some sort of a code system to ensure only a certain amount of users is on the system at a time, and I'm honestly not sure how that works. thought I bet at some point that a competent developer could get in and get around it....but honestly, who has that kind of time? Microsoft is a great example of the futility of locking down code--if you can build it, someone else can hack it. Why not take the high road and offer great code that the user can openly manipulate to their needs?

You're entering a market where re-branding is a huge concern. If a CMS can't be rebranded, and the code is locked down, does rebranding become impossible? If I was in a position where I had to buy a CMS for my web firm, that would be an immediate deal breaker.

bpeterson76
This is why I may limit or not use the encoding solution. The application very much needs the ability to be customized, and I have been wavering on this being completely open source or not, however feel the result will be a better product if I am being paid for the countless hours I have put in so far :/
kilrizzy
Unfortunately many of us in this field never get back value for the countless hours we put in. I've got an app right now that when calculated based on hours divided by fee paid, will result in a paycheck that averages $12/hour. It's part of the risk that you take on when you begin a process. What separates the good from the bad is the responsibility and care you take when you know a project is getting out of hand in a hurry. For me, "eating" this particular project will likely result in 5 well-paying future projects. Good things come from great efforts.
bpeterson76