search

Home  >  Q&A  >  body text

How to do PHP encryption authorization and packaging?

Recent project needs to make such a project requirement. Writing PHP has never been involved before. Please give me some advice:

  1. Is it possible to package php into an installation package for one-click installation (windows environment)

  2. Code encryption recommendation

  3. How to authorize?

To put it bluntly, I actually want to make a commercial software for an organization, but I don’t want it to be copied to other branches for use.

怪我咯怪我咯2779 days ago920

reply all(5)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-19 10:10:32

    1. About PHP packaging

    It’s no problem to package the PHP interpreter and PHP project into an installation package. I even packaged the PHP interpreter and ran it on an Android phone without any problem. Because PHP officially provides a Windows version of the binary package, I can even compile it myself This step is saved. In order to streamline the PHP interpreter, you can delete all the extensions you don’t need, such as the intl extension and its dependent ICU. After the reduction, the packaged interpreter is estimated to be less than 5 MB. Because PHP has built-in HTTP server and SQLite database, so the client no longer relies on Apache and MySQL, and can run PHP projects directly, and it also saves resources.

    2. About PHP code protection

    PHP7’s opcache supports using opcache.file_cacheto export binary opcodes corresponding to PHP scripts. These opcodes are related to the operating system and PHP interpreter version and can play a certain role in code protection. In addition, Zend Guard and ionCube also provide paid PHP code encryption service.

    3.Authorization

    For example, it can be judged in the encrypted PHP code$_SERVER['SERVER_NAME']. If it is not the domain name bound during authorization, the service will be directly refused.

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-19 10:10:32

    There seems to be no good code-level encryption, zend guard can encrypt the code. .
    The other is to use extensions, which means you must have your extension to run. The management system of wdlinux adopts this method

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-19 10:10:32

    不好意思,没注意看清楚。软件绑定机器,只能把mac地址写入到项目里面。验证部分通过加密来隐藏验证方式。
    

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-19 10:10:32

    For encryption, you can try this: EnPHP encryption obfuscation

    About packaging, directly compress the php exe and script into a directory and call it as a bat script

    As for usage restrictions, you can generally judge based on HTTP_HOST ENV

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-19 10:10:32

    You can encrypt the php source code as shown in the screenshot. If necessary, please +2795934612

    reply
    0
  • Cancelreply