开发者

Using php as a desktop application [duplicate]

开发者 https://www.devze.com 2023-04-09 05:59 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: PHP as a Desktop Programming Language
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

PHP as a Desktop Programming Language

I have developed a sales application with php (codeigniter framework). i am using xampp to run this application in local PC's browser. now i want 2 things:

  1. is there any way to run this application as a desktop application? something like an icon will open the app and run without any browser. also without xampp to be set up.
  2. also i want to protect the开发者_开发百科 code from unauthorized using. someone can easily copy the code and run it on other computer. i want to prevent this.

please help me about these issues. thanks in advance.


PHP is not really suitable for either of these things. You're going to need a browser either way, but you could if you really wanted to use some kind of custom browser (e.g., you can use Java or .NET to create a window that has a basic browser page with only whatever controls you want to add on it rather than a full browser).

You won't be able to prevent people copying it, but you could try googling for a PHP obfuscator to make the code hard to read and you could add whatever checks you may wish to determine the PC is one you've approved (perhaps some kind of license file and you could activate it against a MAC address or something).


You can use PHP/GTK+ to create a PHP Desktop Application, but the code protection is very difficult, you can try ofuscating the code, or you can use a php compiler like this: http://www.phpcompiler.org/ I would not use php to develop a desktop application as you like, try using another language, dont use scripting, use compiled codes. Luck with you project.


PHP is a recursive acronym which stands for "PHP: Hypertext Preprocessor." At its core, PHP is designed to process information and output it as HTML ("Hypertext"). If you wish to output information primarily as something other than HTML, PHP is probably the wrong language.

PHP is also a scripting language. That means that it is not compiled (converted from source code to machine code). As such, the scripts are human-readable. Tools such as phc exist, but if you want a compiled application, PHP is probably the wrong language.

Can you use PHP as a desktop application? Yes. Can you compile PHP? Yes. Should you? Probably not, because you are circumventing the purpose and features of the language.


If you are interested in writing client-side applications with PHP, you have to use PHP-GTK. I don't know how flexible is that. In any case, you should try it to see what it can do for you ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号