Skip to main content

PHP installation and configuration by repository (manually)

Use this workflow with Add New PHP agent wizard to ensure you have all the steps covered for installing and configuring PHP with manual installation. Using the wizard is the simplest way to deploy a new agent.

Before you begin

Make sure you have everything you need before you start.

  • The agent will need to be able to reach your Contrast instance. It can be a local/on-premise instance or a hosted instance. A proxy can be configured if the environment has limited network access.

  • It must use supported technologies and system requirements

  • Understand the order of precedence

  • You will also need access to a command line interface (with a chosen directory for downloading the agent) and your organization's instance of Contrast

Start the PHP agent wizard

  1. Open the agent wizard:

    • Northstar: From the left navigation, select Administration > Agent management. Then, select Add agent at the top of the view.

    • Classic: Use either of these options:

      • From the header, select Add New and then, select the Application card.

      • Select Administration > Agent management. Then, select Add agent at the top of the view.

  2. Select Language-specific.

  3. Under Select a language, select PHP.

Install the agent

  1. Under Select application deployment method, select Install manually.

  2. Under the Installation method, select Debian, RPM, AL2023, or APK.

  3. Under Install PHP agent, install the agent package using the commands provided to register it into your system.

Configure PHP

Follow the instructions in the wizard to configure PHP and ensure necessary extensions are enabled.

Configure the agent

Under Configure the agent, select a configuration option. The agent requires a connection token or an API configuration to communicate with Contrast. You can use a connection token (recommended) or you can download the configuration as a YAML file.

  1. Register the application (Optional).

    When you register an application, you can assign it to groups for access control and assign tags and metadata to the application by entering the application name, tags, and metadata, and selecting Register application.

  2. Use Connection Token (Recommended).

    This configuration method uses a single variable to specify authentication values.

    Copy the code displayed in the wizard and set the variable in a location where the agent has access to it.

  3. If you prefer to configure the agent using a YAML file, you can download contrast_security.yaml from the configuration editor, and place the file in a supported YAML file location instead.

    Raise your permissions to write the configuration file to /etc/contrast, and then copy the code displayed in the wizard.

    Note

    The environment variables need to be set before the agent starts up, and in a location where the agent has access to it. Environment variables can be set within the same process or system-wide.

Verify the agent deployment

  1. Interact with your application as you normally would. For example, interact with your application's web interface or send API commands.

  2. Select Administration, then Agent management to verify that your agent appears in the list.

  3. Verify that you see the name of your application in the list.