Deploying a PHP IAST agent
You can deploy an IAST agent on the application server that supports Java, .NET, Node.js or PHP based applications. This section explains how to create a PHP agent type on your web server.
Deploying a PHP agent in Windows
About this task
The Windows agent is installed as a dll file that is added as an extension to your PHP project.
Procedure
- Download the ASoC PHP Windows agent, as described here.
- Extract the contents of the ZIP file.
- Locate hcl_agent-win.dll in the extracted ZIP files.
- Generate a key for the PHP agent through the ASoC user interface.
-
On your web server:
-
Locate the PHP extension directory. You can run '
php -i | findstr "extension_dir"
' in the command prompt. - Copy the downloaded hcl_agent-win.dll to the PHP extensions directory you located in step a.
-
Locate the php.ini file. You can find the location of the
php.ini file by running '
php --ini | findstr "Loaded Configuration File"
' in the command prompt. -
Add a new line '
extension=hcl_agent-win.dll
' to the end of the php.ini file you located in step c. - Save the php.ini file.
-
Add the environment variable:
IAST_ACCESS_TOKEN = [key]
. You can add it by running 'setx IAST_ACCESS_TOKEN [key]
' in the command prompt. - To make the agent available, you need to restart your web server (e.g. Apache or Nginx).
-
Locate the PHP extension directory. You can run '
Deploying a PHP agent in Linux (Ubuntu)
About this task
Procedure
- Download the ASoC PHP Ubuntu agent, as described here.
- Extract the contents of the ZIP file.
- Locate hcl_agent.deb in the extracted ZIP files.
- Generate a key for the PHP agent through the ASoC user interface.
-
On your web server:
- Open a terminal window on your Linux system.
-
Install the dpkg package by running '
apt-get update && apt-get install dpkg
' or 'apk update && apk add dpkg
'. - Navigate to the directory where the .deb file is located using the cd command.
-
Run the command '
dpkg -i hcl_agent.deb
'. Make sure that php is in this path. -
Add the environment variable: Run '
export IAST_ACCESS_TOKEN=[key]
' - To make the agent available, you need to restart your web server (e.g. Apache or Nginx)
Deploying a PHP agent in Linux (RedHat)
About this task
Procedure
- Download the ASoC PHP RedHat agent, as described here.
- Extract the contents of the ZIP file.
- Locate hcl_agent.rpm in the extracted ZIP files.
- Generate a key for the PHP agent through the ASoC user interface.
-
On your web server:
- Open a terminal window on your Linux system.
-
Install the rpm package by running
'yum install rpm'
. - Navigate to the directory where the .rpm file is located using the cd command.
-
Run the command
'rpm -i hcl_agent.rpm'
. -
Add the environment variable: Run
'export IAST_ACCESS_TOKEN=[key]'
- To make the agent available, you need to restart your web server (e.g. Apache or Nginx)