Laravel PHP 8 Upgrade Guide

This guide helps you migrate your Laravel project to a PHP 8 compatible environment using a subdomain safely and efficiently.

Step 1: Create a PHP 8 Subdomain

Create a new subdomain (e.g., php8.example.com) and point its document root to your Laravel application directory. This allows isolated testing without affecting the live site.

Step 2: Copy Project Files

Copy all files from the live Laravel project to the new subdomain directory. Make sure file ownership and permissions are maintained.

Step 3: Backup Vendor Directory

Rename the existing vendor folder to vendor_backup as a rollback option in case of compatibility issues.

Security Tip: Never delete the old vendor directory until the new setup is fully validated.

Step 4: Download PHP 8-Compatible Vendor

Download and extract the compatible vendor package:

Download Vendor ZIP

Place the new vendor folder into your Laravel root. Set the PHP version to 8.0 in the subdomain configuration.

Step 5: Set Permissions

Ensure correct write permissions for Laravel cache and logs:

chmod -R 775 storage/framework
chmod -R 775 storage/logs
chmod -R 775 bootstrap/cache
Security Tip: Never assign 777 unless absolutely necessary. Use 775 with proper group ownership.

Step 6: Compatibility Testing

Access php8.example.com in your browser. Fix any errors, warnings, or deprecated functions based on PHP 8 compatibility. Test all major functions.

Step 7: Flash Build

If everything works, send the new URL to the Flash development team and request a new Flash build using the new base URL.

Step 8: QA Testing

Hand over the new build to the QA team. Use tools like Fiddler or HTTP Toolkit to test requests. Debug issues using Laravel logs (storage/logs/laravel.log).

Step 9: Client Release

Once the new PHP 8 version is stable and bug-free, pass it to the client for final testing via Sreelekshmi (CRM).