Good day!

Thank you in advance for any help in solving, for me, an important problem!

I'll be brief.

Configuration:

  • x64
  • apache 2.4
  • php 7.1 TS

You must use js code in php. Under the implementation, it was decided to use the v8js extension. Link to PECL A compiled php with all extensions was downloaded and connected to apache.

  • When you start the web server in the logs everything is fine.
  • echo phpinfo (); shows that the extension is connected. phpinfo ()

Problem:

  1. PHP notifies that a class is not defined.

Class not defined

  1. List of downloaded extensions

PHP function to determine the loaded extensions

At number 38 our v8js flaunts.

List of downloaded extensions

  1. Issuing a list of expansion features

Function to display a list of extension functions

Returns an empty array. But when passing names of other extensions to the argument, the function returns a complete list of all commands.

Command for output

Function to display a list of extension functions

Questions:

  1. Why didn't the extension actually load? As if there is only a wrapper. (Expansion weighs ~ 200 kb)
  2. What ways you can still check the functionality of the extension? (logs, errors)
  3. Why is it so hard?)

    1 answer 1

    In general, the v8js extension could not be connected. Decided in a different way, namely through exec (node.exe arg). Established node. Through the php exec function, the js script executed the node to which it passed its arguments. Thanks to all!