There is an idea of ​​using a bunch of two languages ​​for one project and different tasks.

1.PHP will interact with the user. Receive data from him and partially process. Answer for displaying content. It is possible to access another language sometimes.

2.PYTHON.Demona, workers and others that will work aside. With the user will not have to deal mainly.

How adequate is this bundle / does it have a place to live?

  • The PHP part is also quite possible to write in Python (which I recommend). - andreymal
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

3 answers 3

There is nothing wrong with that. Often it is necessary to be friends with different services and platforms.

For this, microservice architecture is used.

It is worth deciding on the way of interaction

For php / python, the best option would be the REST API.

Still possible options:

  1. SOAP
  2. interaction through a common database (one of the variants of this approach is by reference )
  3. Through files (this approach is justified if the key logic is tied to processing and transferring files, but still it is worth thinking a little more before using this link)

You can use Celery to implement python demons . Rather convenient and simple wrapper for demonization

    The bunch is very bad, because:

    1. the author must constantly keep up to date code for both languages;
    2. The most powerful potential of the chosen programming language will not be used: reusability of the code, since You can lay out ready-made data structures for the engines of both systems.

      Why not? Firstly, it is an experience that can come in handy over time. Secondly, no matter how much the speed of PHP 7 is praised, it still remains the “collector” of the site pages: at least, besides this, it still knows a lot, but it collects the pages simply as a virtuoso. Now Python, its versatility in comparison with PHP is beyond doubt + a huge number of ready-made libraries, + it can work with many application APIs, and without dancing with a tambourine: most likely, someone has already confused and wrote the library. Try the same for PHP.