How to create executable program in PHP?

Is it possible for me to create a program for my company that is executable, only with PHP and MySQL? Or I will need other languages like C, Java, etc. In case the program is internal only.

Author: Maniero, 2017-06-21

3 answers

Yes, it is possible. It has a huge list of PHP compilers that generate executables. Many don't even exist anymore. The level of quality of them is variable, and in practice "no one" uses. (.NET)

  • https://github.com/facebook/hhvm (but are already porting to Hack)
  • Why do you have so many? Because none lends :) one tries to fix the defect of the other. I just don't give details because it's not the focus.

    Want to make an "enterprise *" application? At the very least think of hack that was created for this, but not so much. Don't actually use a hammer just because you think screws look like nails, so it would be a good solution. Choose one language suitable for the problem, PHP is a language of script . And someone has negated the answer because I say this, it seems "fla-flu" from Facebook where the person does not want to see the obvious.

    If you only have a hammer all the problems look like nails

    Actually if what you're doing isn't a backend web, don't even think of PHP. If you are thinking of an application where web is clearly not the best solution, you have already chosen the wrong path. And most applications are not suitable for web. Be again the problem of the hammer and nails. the person only knows how to use the hammer, so he thinks that every problem is a nail, that is, it must be web, even when it does not give any significant advantage and brings disadvantages. That's what I saw these days about the use of modinhas, even those that last decades and are extremely popular, and it overlaps the need of the business by the will or (in)ability of the developer .

    For what PHP was created, i.e., sites and applications that need to be web even, as long as not very complex, there does not need executable.

    As an add-on, do not use PHP-GTK.

     15
    Author: Maniero, 2020-05-27 16:47:12

    PHP is an interpreted language, not a compiled one. Its purpose is not to generate desktop applications, but to preprocess HTML.

    It is even possible to build a desktop application with PHP (see examples in the other answers), but it seems to me a baita of a gambiarra. If your goal is to create a desktop application, it is best to use a language/framework that is geared towards it.

    Another thing is that we don't quite know what you want to do. If you have a backend with PHP and MySQL and a web front-end, turning this into "executable PHP" is throwing away the entire front-end and remaking it. For example, when they suggest you use PHP-GTK, you would have to redo the entire user interface with GTK and throw away anything HTML, CSS, JS. Is that really what you want? More likely – and simple – is that you just want to wrap a web front-end as a desktop application. For this it has several tools, such as electron and nw.

     9
    Author: bfavaretto, 2017-06-22 14:51:24
    locked . Comments on this answer have been disabled, but it is still accepting other interactions. Learn more .

    Quick Response

    1-Take PHP for Desktop and put a Wordpess with the plugin Sqlite, works up to the latest version 5.xx and ready, you will have a fantastic core as a skeleton.

    2 - use Python to serve PHP scripts locally, simple.httpServer, then through pip install pyexec to generate the executable in the chosen folder of php scripts, it is so easy to use that there is no need for further explanations, it basically consists of serving PHP with the server of Python itself, in this way you manipulate text, shell, bat etc, infinite possibilities, from to control even the cooler.

    Do not talk about technologies that do not dominate

    Is not only possible, it is extremely easy. I have no time for forums, but due to such ignorance and nonsense said on this page, I felt obliged to deny these DEVS ("current Xuxa PC programmers now call themselves Devs").

    I created not only a script, but a complete hybrid operating system using PHP, PYTON, and SQLITE with packaging for Linux Debian with less than 300 MB running everything from PHP for Desktop Tom Czarek, the problem with physical access and low-level language, was solved with PHP triggering Python, better than the most advanced of the sad Chromebooks, because there are no problems with video drives, common in systems of this type, and that also affects PHP for Desktop, and then the latter, just use Pywebview.

    Forgive the pimp language, it would need much more than a comment field to explain 25 years of work in technologies that few give value, or know how to use the right way or its full potential, I am not homesick nor do I twist for this or that language, but when you realize that you can do almost anything with only Python and PHP, for those who want to truly master a language, this is the holy grail, because if you dedicate yourself to different frameworks and technologies, is to condemn yourself to be average for the rest of your life, time is worth much more than it.

    You won't hear anything more absurd than PHP being a language for the web, so Rasmus Lerdorf thought, damn time, I'll put this function shell(shell_exec() & exec()) of garnish, maybe one day it will serve something, the interpretation of CGI then, it serves to make bread.

    When a person says that PHP does not serve to make robust software, or is some fan who works for free for frameworks, or has no idea how a computer interprets commands. Be yes some applications that may be more suitable than PHP for the sake of ease and development time, but not for lack of ability of PHP to perform similar task.

    We have to learn to give more value to men like Rasmus Lerdorf and to systems like Linux, more than half of this forum would not have to pay for an OS license if the software monopoly was like the web is today for Google.

    If you have difficulty, put a skeleton ready to see how it works, have a good day.

     -7
    Author: New Darma, 2021-01-12 19:49:17