This version of PHP Interpreter (Zend) is adapted for KasperskyOS. The PHP Interpreter operates in FastCGI mode.
The PHP Interpreter for KasperskyOS is based on the PHP-8.2. Please refer to README.md for more information about the original PHP Interpreter not related to this project.
The PHP Interpreter for KasperskyOS has the following limitations:
- Currently, subprocess creation isn't available in KasperskyOS Community Edition. All client requests to the PHP Interpreter are processed sequentially: a new request is executed only when a previous request has finished processing.
For additional details on KasperskyOS, including its limitations and known issues, please refer to the KasperskyOS Community Edition Online Help.
- Install KasperskyOS Community Edition SDK. You can download the latest version of the KasperskyOS Community Edition for free from os.kaspersky.com. The minimum required version of KasperskyOS Community Edition SDK is 1.2. For more information, see System requirements.
- Copy project sources files to your home directory. All files that are required to build the PHP Interpreter for KasperskyOS and examples of KasperskyOS-based solutions are located in the following directory:
./kos
- Set the environment variable
SDK_PREFIX
to/opt/KasperskyOS-Community-Edition-<version>
, whereversion
is the version of the KasperskyOS Community Edition SDK that you installed. To do this, run the following command:$ export SDK_PREFIX=/opt/KasperskyOS-Community-Edition-<version>
Run the following script to build the PHP Interpreter for KasperskyOS:
./kos/php/cross-build.sh
The PHP Interpreter for KasperskyOS is built using the CMake build system, which is provided in the KasperskyOS Community Edition SDK.
To install the PHP Interpreter for KasperskyOS to the KasperskyOS Community Edition SDK, run the following script with root privileges:
./kos/php/install.sh
To remove the PHP Interpreter for KasperskyOS from the KasperskyOS Community Edition SDK, run the following script with root privileges:
./kos/php/uninstall.sh
When you develop a KasperskyOS-based solution, use the recommended structure of project directories to simplify usage of CMake scripts.
To include the PHP Interpreter in your KasperskyOS-based solution, follow these steps:
- Add the
find_package()
command to the./CMakeLists.txt
root file to find and load thephp
package.For more information about thefind_package (php REQUIRED)
./CMakeLists.txt
root file, see the KasperskyOS Community Edition Online Help. - Add the
Fpm
program to a list of program executable files defined in the./einit/CMakeLists.txt
file as follows:For more information about theset (ENTITIES Fpm ...)
./einit/CMakeLists.txt
file for building theEinit
initializing program, see KasperskyOS Community Edition Online Help. - Specify a list of IPC channels that connect the
Fpm
program toVfsNet
andVfsRamFs
programs in the./einit/src/init.yaml.in
template file. For more information about theinit.yaml.in
template file, see KasperskyOS Community Edition Online Help. - Create a solution security policy description in the
./einit/src/security.psl.in
template file. For more information about thesecurity.psl.in
template file, see KasperskyOS Community Edition Online Help. - Add PHP and nginx configuration files to the directory
./resources
.
./kos/examples/fpm
—Version of the FastCGI Process Manager (FPM) adapted for use on KasperskyOS../kos/examples/web_server
—KasperskyOS-based dynamic web server.
The test suite for the original PHP Interpreter is used to test the PHP Interpreter for KasperskyOS, but testing systems are different. The testing system for KasperskyOS consists of two programs: php.Server
and php.Client
. The php.Client
program parses PHPT files and sends a request, which contains a PHP script, to the php.Server
program. The php.Server
program executes the request and returns а result to the php.Client
using аn HTTP response. The php.Client
compares the received response with the expected result.
To run the tests, execute the following script:
./kos/tests/cross-build.sh
If you want to save test results to a file, go to the directory ./kos/tests
and run the following command:
./cross-build.sh > log.txt
This product includes PHP software, freely available from http://www.php.net/software/.
Only KasperskyOS-specific changes can be approved. See CONTRIBUTING.md for detailed instructions on code contribution.
This project is licensed under the terms of the PHP License. See LICENSE for more information.