There is a need to use php - interpreter for processing php pages with php code in Qt C ++ project. I start php.exe, I write the text there, I receive an output. It works, but rather slowly. Processing ~ 300 pages takes 30 seconds. Are there any libraries to connect to your project, so that the processing takes place when the function is called, and not when an external application is launched?

  • Tried to parallelize? - D-side
  • This will certainly speed up the work, however, and complicate the logic. But I would like to know right away, maybe there is a more "correct" way? - Alexander
  • That's right - do not use php, but I think you do not like it. Therefore, you can use dll with php instead of running the exe file. It will save some time. - KoVadim
  • If it is possible to use Visual Studio 2015, then there is a plugin, I do not remember the name, like the php tool. - Duracell
  • As far as I understand, @Duracell - php tool is a plugin for autocompletion, syntax highlighting and debugging capabilities. This is not what I need. - Alexander

1 answer 1

Try FastCGI with php-fpm . Similar to how PHP works with nginx and read servers with FastCGI support.

  • nginx doesn't like it doesn't work with php, it stupidly proxies, that is, it sends a request to php-fpm or some other interpreter, and receives an answer in the form of some html (in a rather coarse representation), the pages that it sends to its http server port (having generated headers, bodies and footers). So you are right and in this case you can simply request and receive. But you can keep the server, which will generate the information and the program to save this data in the cache, with the possibility of periodic updates cache. - Naumov
  • > nginx doesn’t seem to work with php - a question of terminology. Directly - no (unlike LUA, for example, or Perl (with perl-module)). But using the FastCGI protocol - yes. Actually, I wrote about it. - Monah Tuk