---
title: "Prepare for PHP migration with Exakat"
url: https://www.exakat.io/prepare-for-php-migration-with-exakat/
date: 2021-11-19
modified: 2025-02-14
author: "dams"
description: "Prepare for PHP migration with Exakat Exakat detects compatibility issues in your code, for each minor PHP versions since PHP 5.3. It scans the source for function apparence or disappearance,..."
categories:
  - "Code auditing"
tags:
  - "audit"
  - "Installation"
  - "migration"
word_count: 344
---

# Prepare for PHP migration with Exakat

## Prepare for PHP migration with Exakat

Exakat detects compatibility issues in your code, for each minor PHP versions since PHP 5.3. It scans the source for function apparence or disappearance, new syntax and behaviors. Here is how to prepare PHP migration with Exakat.

## init-project-done

With a local docker system and access to your code, you can use the following command line to execute Exakat. :

`docker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:latest exakat init -p sculpin -R git@github.com:sculpin/sculpin.git`

This creates a folder called 'projects' in your local directory, and initialize the project called 'sculpin' in it. In particular, it clones the code, from the github repository.

Then, run the audit itself :

`docker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:latest exakat project -p sculpin`

By default, it will run the classic 'Diplomat' report on the code. You can learn about it in the docs. Once this is done, the results is available in the projects/sculpin/diplomat report.

## Audit configuration

Now is a good time to audit different sources :

- `-p` : the name of the project. Arbitrary name, that you will remember later.
- `-R` : the locator for the source.
- `--format` : format of the [report](https://exakat.readthedocs.io/en/latest/Reference/Reports.html#list-of-reports), in a machine readable format. For example, [Perfile](https://exakat.readthedocs.io/en/latest/Reference/Reports.html#perfile)
- `-T` : the name of the [Rulesets](https://exakat.readthedocs.io/en/latest/Reference/Rulesets.html#list-of-rulesets) rulesets you want to produce. For example, [CompatibilityPHP84](https://exakat.readthedocs.io/en/latest/Reference/Rulesets.html#compatibilityphp80)

`docker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:latest exakat project -p sculpin -v`

After running the 'project' commands, it is possible to access the individual reports without running again the audit.

After running the 'project' commands, it is possible to access the individual reports without running again the audit.

Some results are produced directly to the standard output :

- PHP 8.0 compatibility`docker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:latest exakat report -p sculpin --format Perfile -T CompatibilityPHP80`
- PHP 8.0 security`docker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:latest exakat report -p sculpin --format Perfile -T Security`

Some results are writen on the disk, in the projects/sculpin/ directory, in a specific file.

- PHP compilation directives`docker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:latest exakat report -p sculpin --format Phpcompilation`

More details in the [documentation](https://exakat.readthedocs.io/en/latest/Reference/Reports.html#list-of-reports).