Back to dashboard

<?>

PHP Compatibility Checker 2

Universal PHP Compatibility Checker — Documentation

Version 2.0.0
PROJECT DOCUMENTATION

About the application

PHP Compatibility Checker 2 is a local development tool for checking PHP projects against multiple PHP versions. It supports WAMP, XAMPP and custom PHP environments.

The application discovers PHP projects and scans their source files. It performs syntax validation and configured static compatibility checks using the available PHP command-line executables. Results are presented in the dashboard and can be saved as standalone HTML reports.

The configured target versions are PHP 8.3, 8.4, 8.5 and 8.6. A target version is only checked with its own PHP executable when that executable is installed and detected by the application.

Contents

1. Requirements

PHP 8.6 may not be installed in your environment. If no matching executable is detected, that version is reported as unavailable rather than being treated as successfully tested.

2. Installation

  1. Create a folder for the checker inside your web root.
  2. Copy all application files into that folder.
  3. Open config.php and review the environment settings.
  4. Configure the correct projects root and PHP binary root.
  5. Make sure the reports directory exists and is writable by the web server.
  6. Start your web server and open the checker in your browser.

Example WAMP installation

C:\wamp64\www\PHP-Checker\
http://localhost/PHP-Checker/

Example XAMPP installation

C:\xampp\htdocs\PHP-Checker\
http://localhost/PHP-Checker/

Custom installation

If you use another PHP environment, place the checker in a directory accessible through your web server and configure the custom paths in config.php.

Change the URL if you use a different folder name, port or virtual host.

3. Project structure

PHP-Compatibility-Checker-2/
├── index.php
├── config.php
├── functions.php
├── scanner.php
├── compatibility.php
├── help.html
├── style.css
└── reports/
    └── .htaccess
File / folder Purpose
index.php Main dashboard, scan selection and request handling.
config.php Application settings, server environment, project paths, PHP versions and scan limits.
functions.php Shared helper functions, path validation, security, PHP executable detection and report utilities.
scanner.php Discovers project folders and supported PHP files.
compatibility.php Runs PHP syntax validation and static compatibility checks.
help.html Browser-readable application documentation.
style.css Responsive dark neon dashboard styling.
reports/ Stores generated HTML reports.
reports/.htaccess Disables directory listing and blocks selected sensitive file types when supported by Apache.

4. Configuration

Open config.php and verify the environment settings. The application supports automatic detection and manual configuration.

Server mode

The server_mode setting supports the following values:

Value Description
auto Automatically detects the available server environment.
wamp Uses the configured WAMP installation.
xampp Uses the configured XAMPP installation.
custom Uses manually configured project and PHP directories.

PHP target versions

The configured target versions determine which PHP versions the application attempts to detect and use for compatibility checks.

'php_versions' => ['8.3', '8.4', '8.5', '8.6'],

Example WAMP paths

'wamp_root' => 'C:/wamp64',
'wamp_projects_root' => 'C:/wamp64/www',
'wamp_php_root' => 'C:/wamp64/bin/php',

Example XAMPP paths

'xampp_root' => 'C:/xampp',
'xampp_projects_root' => 'C:/xampp/htdocs',
'xampp_php_root' => 'C:/xampp/php',

Custom PHP paths

'custom_root' => 'C:/MyPHP',
'custom_projects_root' => 'C:/MyProjects',
'custom_php_root' => 'C:/MyPHP/bin',

These are example paths. Replace them with the actual directories on your computer.

Other configurable settings

Incorrect paths can prevent the application from detecting projects or PHP executables. Always verify your configuration before starting a scan.

5. Supported environments

WAMP

WAMP installations commonly store projects in the www directory and PHP versions below the WAMP PHP binary directory. Configure the WAMP root, projects root and PHP binary root.

XAMPP

XAMPP installations commonly store projects in the htdocs directory. The PHP executable is normally located in the XAMPP PHP directory. Configure the XAMPP paths in the application settings.

Custom PHP

Custom environments can use independently installed PHP executables. Configure the custom project directory and PHP binary directory so the application can locate the required files.

The checker does not install PHP versions. You must install the PHP versions you want to test and make their command-line executables available to the application.

6. Scanning projects

Use the full scan option on the dashboard to scan the configured projects root and its allowed project directories.

The full scan:

The projects root depends on the selected server environment. For WAMP this is commonly the www directory. For XAMPP this is commonly the htdocs directory. Custom environments use the configured custom projects directory.

7. Individual folder scan

Use the individual folder scan option to check only one project or subfolder instead of scanning the complete projects root.

Enter a path relative to the configured projects_root.

RadioDJ
RadioDJ\members
Scripts Outlet Shop
MyProject\admin

The selected folder and its allowed subdirectories are scanned. Other projects are not included.

Absolute paths, paths containing parent-directory traversal such as ..\, and folders outside the configured projects root are rejected when outside-root scanning is disabled.

To scan all configured projects, use the full scan option instead.

8. Compatibility checks

The checker performs the following configured checks:

Results are shown per file and target PHP version. A target that is not installed cannot be validated using its own PHP executable.

Static compatibility checks are intended to identify potential problems. Findings may require manual inspection and runtime testing.

9. HTML reports

After a scan, the checker saves a standalone HTML report in the configured reports directory.

The report can include:

Reports can be opened in a browser and kept as a record of a project's compatibility scan. The report directory and filename prefix can be configured in config.php.

10. Security and scan limits

Do not expose this development tool publicly without reviewing and strengthening its access controls and server configuration. The local-only setting should remain enabled for normal local use.

11. Troubleshooting

No PHP executable detected

Verify the configured PHP binary root and confirm that the expected PHP version directory contains a valid php.exe executable. Also check the configured PHP executable paths.

PHP version is unavailable

The target PHP version may not be installed, may be located outside the configured binary root, or may not be accessible to the web server. Check the executable path and test the executable from the command line.

No projects detected

Check the configured projects root and verify that it exists and contains project directories or supported PHP files.

Report cannot be saved

Check that the reports directory exists and that the web server process has permission to write to it.

Selected folder is rejected

Enter a relative folder path beneath the configured projects root. Do not enter a drive letter, an absolute path or parent-directory segments.

Some files are skipped

Check the configured excluded directories, excluded files, allowed file extensions, maximum file size and maximum file count.

Scan takes a long time

Large projects may contain many PHP files. Consider scanning one project or subfolder at a time, or review the configured scan limits.

Access denied

Verify the local-only access setting and open the checker through the local web server. Direct access through an unsupported network connection may be rejected.

12. Limitations

Static compatibility analysis cannot guarantee that an application will behave correctly at runtime. A successful syntax check only confirms that the selected PHP executable can parse the checked file.

Static findings may require manual review. Runtime behavior can also depend on PHP extensions, configuration, database versions, external services, application data and environment-specific settings.

The checker does not automatically install PHP versions, repair incompatible source code, or guarantee that all deprecated functions and version-specific incompatibilities will be detected.

For reliable verification, test the complete application on each intended PHP runtime in a suitable development or staging environment.