Runtime dependencies
In order to successfully install, configure, and deploy P4 Code Review, the following dependencies are required:
- A recommended operating system, see Recommended operating systems
- An Apache server with the modules required by P4 Code Review installed, see Apache web server
-
A supported version of PHP with the modules required by P4 Code Review installed, see PHP.
-
A supported P4 Server deployment, and the ability to connect to it from the system hosting P4 Code Review, see P4 Server requirements
"P4 Server deployment" can refer to a running
p4d
or a proxy, replica, edge server, or commit server. - P4 Server Extensions or Triggers to notify P4 Code Review about P4 Server events, see P4 Server event notification.
- curl or
wget
for P4 Code Review worker operation, see Worker dependencies - If Security-enhanced Linux (SELinux) is installed it must be configured correctly, see Security-enhanced Linux (SELinux)
There is a risk of P4 Code Review missing data updates if P4 Code Review has been shut down while P4 Server is running and users are executing P4 Server commands.
When P4 Code Review is offline, workflow triggers will fail which could cause P4 Server to stop working.
Optional dependencies:
- LibreOffice: required to view office-type documents. For more information, see LibreOffice.
- zip: command-line archiving tool: Required to download zip archives of files and folders. For more information, see Zip.
- P4 AS SSO: enables P4 Code Review to authenticate with SSO when the P4 Server is configured for P4 AS, see P4 AS SSO.
- Sendmail or equivalent: required to use P4 Code Review email notifications. For more information, see P4 Code Review email notifications.
Recommended operating systems
Perforce recommend that P4 Code Review is installed on one of the following operating systems:
- Ubuntu 22.04 LTS, and 24.04 LTS latest stable release should be used.
- RHEL 8 and 9 latest stable release with PHP libraries installed from the Remi repository. See PHP.
- Rocky Linux 8 and 9 latest stable release with PHP libraries installed from the Remi repository. See PHP.
- Amazon Linux 2: latest stable release with PHP libraries installed from Amazon Linux Extras. See PHP.
You cannot install P4 Code Review on a Windows machine.
Other Linux distributions
P4 Code Review has not be tested on Linux distributions that are not on our recommended list. Because of this, our Support team may not be able to help you to the same extent as they would for the recommended operating systems.
P4 Code Review will probably run on any Linux distribution based on RHEL 8 or 9. P4 Code Review includes binary versions of P4 API for PHP, the Perforce extension for PHP. This P4 API for PHP dependency typically sets the limit to what Linux distributions you can install P4 Code Review on.
You might be able to get P4 Code Review running on another platform if you build P4 API for PHP yourself and satisfy the other runtime dependencies. Instructions on how to obtain and build P4 API for PHP from source can be found in the P4 API for PHP Release notes.
P4 API for PHP does not support threaded operation. If you compile P4 API for PHP from source, ensure that the version of PHP you compile for is non-threaded.
Apache web server
P4 Code Review requires Apache HTTP Server 2.4 or newer:
The following notes are applicable for RHEL 8 and RHEL 9:
RHEL 8: Use the Remi repository configuration package (remi-release-8.rpm) to give P4 Code Review access to PHP 8 and to LibreOffice which is part of the optional package install. Use the epel-release-latest-8.noarch.rpm repository configuration package to give P4 Code Review access to EPEL packages.
RHEL 9: Use the Remi repository configuration packages (remi-release-8.rpm and remi-release-9.rpm) to give P4 Code Review access to PHP 8 and to LibreOffice which is part of the optional package install. Use the epel-release-latest-8.noarch.rpm and epel-release-latest-9.noarch.rpm repository configuration package to give P4 Code Review access to EPEL packages.
P4 Code Review 2020.2 and later: these versions of P4 Code Review uses the Remi repository for RHEL 8 and RHEL 9. This provides PHP 8.x installed in the standard file system structure. This means that the old httpd24-httpd version of Apache is no longer needed, and the standard system version of Apache is being used again.
The SCL Apache site configuration file was installed at this location for P4 Code Review 2019.1 to 2020.1:
/opt/rh/httpd24/root/etc/httpd/conf.d/perforce-swarm-site.conf
If this exists when P4 Code Review is upgraded to 2020.2 and later, this file is copied to /etc/httpd/conf.d/perforce-swarm-site.conf if there is no file at the destination. It is also re-written to change references from /var/log/httpd24 to /var/log/httpd
If a site configuration file for P4 Code Review already exists in /etc/httpd, the copy and re-write is not performed.
After upgrade, httpd24-httpd is disabled.
To avoid seeing the Apache HTTP server Linux test page when you start the Apache server, comment out the content of the welcome.conf file located in the /etc/httpd/conf.d/ directory.
To avoid loading the Apache HTTP server example configuration instead of the P4 Code Review configuration when the Apache server starts, rename the autoindex.conf file located in the /etc/httpd/conf.d/ directory to z-autoindex.conf or similar. This is required because Apache runs the first conf file it finds in the /etc/httpd/conf.d/ directory (alphabetical order) and that must be the perforce-swarm-site.conf file.
P4 Code Review also requires the following Apache modules:
- Ubuntu: mod_phpx for interacting with PHP (usually installed with PHP)
- RHEL: php-fpm for interacting with PHP (usually installed with PHP)
-
mod_rewrite URL rewriting engine
For more information, see Apache Module mod_rewrite.
Where x
is the version of PHP you are running, for example 8.1. For a list of supported PHP versions, see PHP.
Only the prefork
MPM Multi-Processing Module, a component of the Apache web server that is responsible for binding to network ports, accepting requests, and dispatch operations to handle the request. is supported. Use of the worker or event MPMs is not supported and is likely to cause problems because P4 API for PHP does not support threaded operation.
For more information on the prefork MPM, see Apache MPM prefork.
PHP
P4 Code Review 2025.2 supports PHP 8.1, 8.2, 8.3, and 8.4. For more information about PHP, see the PHP website.
From versions 2025.1 and above, P4 Code Review no longer supports PHP 7 or older versions.
P4 Code Review no longer supports PHP 8.0 version.
- PHP must be non-threaded because P4 API for PHP does not support threaded operation.
RHEL 8: Use the Remi repository configuration package (remi-release-8.rpm) to give P4 Code Review access to PHP 8 and to LibreOffice which is part of the optional package install. Use the epel-release-latest-8.noarch.rpm repository configuration package to give P4 Code Review access to EPEL packages.
RHEL 9: Use the Remi repository configuration packages (remi-release-8.rpm and remi-release-9.rpm) to give P4 Code Review access to PHP 8 and to LibreOffice which is part of the optional package install. Use the epel-release-latest-8.noarch.rpm and epel-release-latest-9.noarch.rpm repository configuration package to give P4 Code Review access to EPEL packages.
Required PHP extensions
P4 Code Review requires the following PHP extensions:
If you install P4 Code Review from a package, all of these PHP extensions are automatically pulled in as dependencies on all platforms.
-
iconv (character encoding converter)
For more information, see iconv.This is typically enabled by default with most PHP distributions
-
JSON (JavaScript Object Notation)
For more information, see JavaScript Object Notation.This is typically enabled by default with most PHP distributions, although recent distributions are making this optional.
-
Session (session handling)
This is typically enabled by default with most PHP distributions
-
P4 API for PHP version 2019.1 or later (the Perforce PHP Extension)
This release of P4 Code Review contains the latest version of P4 API for PHP with the P4 Code Review package and tarball installations.
P4 Code Review package and tarball installations: two versions of P4 API for PHP are supplied for PHP 8 version supported by P4 Code Review. They are located in the p4-bin/bin.linux26x86_64 directory.
- perforce-php8x.so compatible with systems using SSL 1.0.2
- perforce-php8x-ssl1.1.1.so compatible with systems using SSL 1.1.1
- perforce-php8x-ssl3.so compatible with systems using SSL 3.0.0 (by default, Ubuntu 22.04 and 24.04 uses SSL 3.0.0)
Where x is the version of PHP 8.
P4 Code Review no longer supports PHP 8.0 version.
If the perforce.ini file is not pointing at the correct version of P4 API for PHP and you connect to an SSL enabled P4 Server:
- The P4 Code Review web-page will not load and you might see a Connection Reset error.
- There might be an undefined symbol: SSLeay message in the Apache error log
Upgrading P4 Code Review:
- P4 Code Review package: the latest P4 API for PHP version is installed automatically.
- P4 Code Review tarball installation: you must configure P4 Code Review to use the version of P4 API for PHP in the new P4 Code Review tarball. For swarm tarball upgrade instructions, see Upgrading a tarball installation.
-
php-xml (DOM API for XML manipulation, the P4 Code Review RSS feed will not work if it is not installed)
-
php-mbstring (multi-byte character strings, the P4 Code Review RSS feed will not work if it is not installed)
-
php-redis (PHP extension for Redis, the P4 Code Review cache will not work if it is not installed)
-
php-gd (PHP extension for creating the blur images used for image icons on comments. If php-gd is not installed, images attached to comments display the file extension name instead of a blur or thumbnail image.)
Recommended PHP extension
P4 Code Review greatly benefits from the following PHP extension:
-
Imagick (integrates ImageMagick into PHP to improve P4 Code Review's ability to preview graphics formats that web browsers typically cannot display and create to comment attachment thumbnails)
-
Open the ImageMagick policy.xml file for editing:
-
Disable lines with the pattern below for the following <filetype>s: PS, PS2, EPS, PDF, or XPS:
-
Save the policy.xml file.
-
Restart Apache for the changes to become active.
For more information about Imagick, see Image Processing (ImageMagick).
Installation instructions for Imagick.
If you see an error similar to the one below for PS, PS2, EPS, PDF, or XPS files, the imagick policy.xml file needs to be edited. For example, the error for a PDF file will be similar to:
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408
If you see the error above:
/etc/ImageMagick-6/policy.xml
<policy domain="coder" rights="none" pattern="<filetype>" />
Building PHP from source (not recommended)
If you build PHP from source, the following dependencies are required:
- openssl
- mcrypt
- zlib
- gettext
- curl
- apxs (Apache extension tool)
See the source PHP documentation for details on how to include these modules in your PHP build. There is normally a --with-xxxx option that defines where the dependency is loaded from.
For example for apxs, zlib, and openssl:
./configure --with-apxs2=<path_to_apxs> --with-zlib=<path_to_zlib_library> --with-openssl
P4 Server requirements
P4 Server 2020.2 and later: any new file being shelved that has the same content as an existing shelved file refers to the existing archive file instead of creating a duplicate archive file. No P4 Server or P4 Code Review configuration is required for this feature.
This P4 Server feature automatically reduces the space required for the P4 Code Review-managed shelved review changelists. P4 Code Review creates these changelists for its own internal use. P4 Server only updates new shelves, it does not retrospectively update your existing shelves.
For more information on the P4 Code Review-managed changelists, see
P4 Code Review should work with newer versions of the P4 Server, but this is not tested.
P4 Code Review works with any supported versions of the P4 Server (Standard Maintenance). This release of P4 Code Review is tested against and supports the following P4 Server versions:
- 2023.2
- 2024.1
- 2024.2
- 2025.1
Download Helix Core Server from the Perforce website.
-
P4 Code Review does not support P4 Servers configured to use P4AUTH, see Centralized authorization server (P4AUTH) in the P4 Server Administration Documentation.
-
P4 Code Review does not support the P4 MFA Authenticator.
P4 Server automated user requirements for P4 Code Review
P4 Code Review requires an automated user with at least admin privileges in the P4 Server to enable P4 Code Review to run against the P4 Server. The P4 Code Review admin user also needs to be a standard user type. This can be an existing user, or a new user created specifically to support P4 Code Review.
P4 Code Review does take up a license but if you are paying for the licenses you can request a background user for P4 Code Review. This is a normal user that is provided so you can use P4 Code Review without consuming one of your paid licenses. To access the request form for the background user, see Helix Core Request for Background User.
If P4 AS is configured for your P4 Server, the user account running P4 Code Review must not use the P4 AS.
For more information about setting up P4 Server, see Install the server and Upgrade the server in P4 Server Administration Documentation.
P4 Code Review and P4 Server installation considerations
Before installing P4 Code Review and P4 Server you should consider the following:
-
To ensure that all characters, including Unicode characters, are displayed and handled correctly by P4 Code Review, configure your P4 Server in Unicode mode. For information on configuring your P4 Server in Unicode mode, see Set up and manage Unicode installations in the P4 Server Administration Documentation.
-
For a small system, you can run P4 Code Review and P4 Server on the same machine.
-
For larger systems, we recommend that P4 Code Review and P4 Server are run on separate machines. The machines should be close to each other to maximize network performance.
-
The P4 Code Review and P4 Server machines do not need to have the same operating system. For example, P4 Server could be on a Windows server and P4 Code Review could be on a RHEL server.
P4 Code Review needs to know about a number of P4 Server events to operate correctly. To enable this to happen, P4 Server Extensions (recommended) or P4 Server Triggers are installed on the P4 Server machine and they need to talk to P4 Code Review. In either case, performance can be negatively affected if network lag between P4 Code Review and the P4 Server is high.
You cannot install P4 Code Review on a Windows machine.
P4 Server event notification
P4 Code Review needs to know about a number of P4 Server events to operate correctly, this can be done by using P4 Server Extensions (recommended) or P4 Server Triggers. P4 Code Review installs include the P4 Code Review P4 Server extension file and trigger scripts required for P4 Code Review to get the events it needs from your P4 Server.
Triggers are still supported, but we recommend you use P4 Server Extensions. P4 Server Extensions are easier to install and maintain than Triggers.
Use one of the following:
-
Recommended: P4 Server Extensions, see P4 Server Extensions dependencies
-
P4 Server Triggers, see Trigger dependencies
P4 Server Extensions dependencies
If you are using the P4 Code Review P4 Server extension, P4 Code Review P4 Server Triggers must not be installed.
P4 Server Extensions must be installed on your P4 Server to complete your P4 Code Review installation. The P4 Code Review Extensions script is included with the P4 Code Review product download and is copied to your P4 Server during configuration.
To install the P4 Code Review P4 Server extension you need:
A compatible version of P4 Server for P4 Server Extensions:
-
Linux: P4 Server 2021.2 and later. If you are using an earlier version of P4 Server, you must use triggers.
-
Windows: P4 Server 2021.2 and later. If you are using an earlier version of P4 Server, you must use triggers.
Trigger dependencies
If you are using P4 Code Review P4 Server Triggers, the P4 Code Review P4 Server extension must not be installed.
We recommend you use P4 Server Extensions, P4 Server Extensions are easier to install and maintain than triggers. See P4 Server Extensions dependencies.
P4 Code Review triggers must be installed on the P4 Server to complete the P4 Code Review installation.
The P4 Code Review triggers require perl 5.08+
. To download Perl, see the Perl Download page.
On the Windows platform, we have tested P4 Code Review against Strawberry Perl. There are two Perl modules that are also required which may not be part of a minimal Perl installation.
-
HTTP::Tiny is required to make calls to the P4 Code Review server. If this is not present, then the trigger will attempt to use the command line curl program. This module is standard on Strawberry Perl on Windows, and available as a package with the version of Perl provided on Ubuntu 22.04.
IO::Socket::SSL is required if the P4 Code Review server is configured to use SSL and HTTP::Tiny is present. This is provided as standard by Strawberry Perl, and available on Linux.
If the HTTP::Tiny
module is not available the triggers require the use of curl
. This must be installed for the triggers to function. On RHEL, for example, this can be done using the yum
package installer using yum install curl
.
P4 Code Review triggers also require the following perl modules to be installed:
- Windows:
- JSON is required to exchange data between the browser and the server and is included by default with Strawberry Perl.
- Ubuntu:
- JSON is required to exchange data between the browser and the server and must be installed.
- libjson-perl is required to manipulate JSON formatted data and must be installed.
- RHEL:
- JSON is required to exchange data between the browser and the server and must be installed.
- perl-JSON is required to manipulate JSON formatted data and must be installed.
P4 Code Review package installation on the same machine as P4D
If P4 Code Review is installed from a package on the same machine as P4D, the triggers require the following perl modules to be installed:
- Ubuntu:
- Perl 5.08+
- libio-socket-ssl-perl is required if the P4 Code Review server is configured to use SSL.
- libjson-perl is required to manipulate JSON formatted data and must be installed.
- RHEL:
- Perl 5.08+
- perl-IO-Socket-SSL is required if the P4 Code Review server is configured to use SSL.
- perl-JSON is required to manipulate JSON formatted data and must be installed.
Worker dependencies
P4 Code Review uses short-lived workers to process the P4 Code Review queue, new workers are regularly spawned by a recurring task.
One of the following must be installed to ensure new workers are regularly spawned:
- curl, download from the curl download page
- wget, download from the wget download page
For more information about P4 Code Review workers, see Set up a recurring task to spawn workers.
Redis server
P4 Code Review requires Redis to manage its caches. P4 Code Review caches data from the P4 Server to improve the performance of common searches in P4 Code Review and to reduce the load on the P4 Server.
Redis is included with the P4 Code Review package and Tarball installations:
- P4 Code Review package: Redis is automatically installed on the P4 Code Review machine and P4 Code Review is automatically configured to use Redis.
- P4 Code Review Tarball installation: see the Redis installation and configuration section for instructions about installing Redis.
When P4 Code Review starts it verifies the Redis cache, during this time you cannot log in to P4 Code Review. The time taken to verify the Redis cache depends on the number of users, groups, and projects P4 Code Review has. Start-up time can be improved by persisting the memory cache. You can persist the memory cache by disabling background saves and enabling append saves in the redis-server.conf file, see Redis server configuration file.
Optional:
If you prefer to use your own Redis server, you must edit the Redis server connection configurable in P4 Code Review. For information on setting your Redis server connection, see Use your own Redis server.
Supported P4 Visual Client (P4V)
P4 Code Review 2022.3 or later only works with P4 Visual Client (P4V) 2021.3 or later.
Supported P4 AS (HAS)
P4 Code Review works with any supported versions of P4 AS (Standard Maintenance).
Supported web browsers
The following browsers are supported for use with P4 Code Review:
- Apple Safari, latest stable version
- Google Chrome, latest stable version
- Mozilla Firefox, latest stable version
- Microsoft Edge, latest stable version
Other web browsers might also work, including prior, development or beta builds of the above web browsers, but are not officially supported.
- JavaScript and cookies must be enabled in the web browser for P4 Code Review to operate.
- Mobile web browsers are not supported by P4 Code Review.
Workflow prerequisites
For P4 Code Review 2019.2 and later, the workflow feature is enabled by default.
If you are upgrading from an earlier version you will need to update your triggers, see Upgrading P4 Code Review.
The workflow feature requires:
-
Workflow must be enabled, see the workflow system configurable.
-
Your swarm-trigger.conf file must be configured correctly, see Using triggers to push events to P4 Code Review.
-
Your P4 Server trigger table must contain the workflow trigger lines, see Using triggers to push events to P4 Code Review.
Optional dependencies
LibreOffice
P4 Code Review can display previews of office-type documents when LibreOffice is installed on the P4 Code Review server. Installation is not required, but when LibreOffice is installed P4 Code Review automatically detects its presence.
For more information about LibreOffice, see LibreOffice.
Zip
You can download a ZIP archive of files/folders when the zip command-line tool is installed on the P4 Code Review server.
For more information about installing and configuring Zip, see Zip archive.
P4 AS SSO
P4 Code Review support for SSO using P4 AS with P4 Server requires P4 Server 2019.1 or later
For more information about configuring P4 Code Review to authenticate with P4 AS, see Single Sign-On PHP configuration.
P4 Code Review email notifications
Sendmail or an equivalent is required to use P4 Code Review email notifications. By default, the configuration in php.ini relies on SendMail being installed. For more information about configuring email for P4 Code Review, see Email configuration.
Security-enhanced Linux (SELinux)
P4 Code Review supports SELinux on RHEL and Amazon Linux 2. SELinux is an advanced access control mechanism that improves security for Linux distributions.
SELinux operates in one of three modes:
- enforcing: this mode blocks and logs any actions that do not match the defined security policy.
- permissive: this mode logs actions that do not match the defined security policy but these actions are not blocked.
- disabled: in this mode SELinux is off, actions are not blocked and are not logged.
To check the mode SELinux is operating in, view the /etc/selinux/config
file with vi or a similar editor:
root $ vi /etc/selinux/config
For instructions on configuring SELinux:
-
RHEL: See SELinux configuration.
-
Amazon Linux 2: See SELinux configuration.
If you see a P4 Code Review configuration error similar to the error shown below, SELinux has not been correctly configured for P4 Code Review. Check you have configured SELinux on REHL or Amazon Linux 2 correctly.
Choose the installation process
Once you have reviewed the Runtime dependencies and know that you can satisfy them, there are a number of ways to install P4 Code Review.
We recommend the package installation method to install P4 Code Review whenever possible, see Install and configure P4 Code Review from a package (recommended). Package installs ensure that all of the P4 Code Review dependencies are installed and this is the easiest way to install P4 Code Review. For a list of recommended operating systems for P4 Code Review, see Recommended operating systems.
Choose one of the following installation methods (we recommend the package installation method whenever possible):
-
P4 Code Review RPM or Debian packages (recommended):
- Follow the steps provided in Install and configure P4 Code Review from a package (recommended).
- If you installed P4 Server Extensions in the previous step, skip this step and go to step 3:
Configure P4 Server for P4 Code Review, see Installing Triggers.
- Review the post-install configuration options to customize your P4 Code Review installation, see Post-install configuration options.
- Validate that P4 Code Review is working correctly before using it in production, see Validate your P4 Code Review installation.
You are all set to start using P4 Code Review. Enjoy!
To get started with P4 Code Review, see the Quickstart chapter.
-
P4 Code Review Docker container:
- Follow the steps provided in Run Swarm using a Docker container.
- If you installed P4 Server Extensions in the previous step, skip this step and go to step 3:
Configure P4 Server for P4 Code Review, see Installing Triggers.
- Review the post-install configuration options to customize your P4 Code Review installation, see Post-install configuration options.
- Validate that P4 Code Review is working correctly before using it in production, see Validate your P4 Code Review installation.
You are all set to start using P4 Code Review. Enjoy!
To get started with P4 Code Review, see the Quickstart chapter.
-
P4 Code Review.tgz (Tarball):
- Follow steps provided in the Install and configure P4 Code Review manually from a Tarball.
- Configure Redis, see Redis configuration.
- Configure Apache, see Apache configuration.
- Configure PHP, see PHP configuration.
- Configure P4 Code Review, see P4 Code Review configuration.
-
Configure the P4 Server to notify P4 Code Review about P4 Server events, see Configuring P4 Server event notification.
- Set up a recurring task to spawn workers, see Set up a recurring task to spawn workers.
- Review the post-install configuration options to customize your P4 Code Review installation, see Post-install configuration options.
- Validate that P4 Code Review is working correctly before using it in production, see Validate your P4 Code Review installation.
You are all set to start using P4 Code Review. Enjoy!
To get started with P4 Code Review, see the Quickstart chapter.