SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to protect PHP code

    Hi all...
    I'm a php developer(beginner) and I want to know if there is any means to protect PHP code.
    Actually I noticed that in dotnet the code can be put into .dll file and then executed. So if we give that to other people(developers), they can use the code but can't see the code what we have used. So, is there something which can protect my php code? or else, is there any possibility to create a .dll file (of the php script) and run it the same way?
    Thanks in advance..

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,763
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    There are PHP obfuscators that can turn your PHP code into something unreadable. But if someone is determined, they could probably find a way to de-obfuscate it.

    As far as what you are talking about creating a DLL file, DLL files are specific to the Windows operating system. Such a thing would not work on a Linux system. But yes, you could do something similar by creating your own PHP extensions which would contain your code in binary form (or at least intermediate code) which you would call in your PHP scripts using function calls. I am not much familiar with how the Linux operating system works, with Windows you can create a DLL and it can be used by all kinds of different programs. I don't think a PHP extension would be widely available to anything other than PHP on a Linux box. Also, most users on shared servers cannot install their own custom PHP extensions. So your audience for hiding your code in a PHP extension would be limited, assuming you are hiding your code because people will be using it but not looking at it.

  3. #3
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,807
    Mentioned
    141 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vamsikothuru View Post
    Actually I noticed that in dotnet the code can be put into .dll file and then executed. So if we give that to other people(developers), they can use the code but can't see the code what we have used.
    That isn't true. You can use ilspy, dotpeek, reflector, etc to decompile the DLL into code. .NET also has obfuscators that you can use to serve this purpose too but it DOES NOT do it natively.
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •