PHP is still one of the most used languages for backend development, especially for applications built with Laravel, WordPress, Symfony and custom PHP frameworks.
After working with PHP for many years, I have seen PHP change a lot. Old PHP projects and modern PHP projects can look completely different.
With newer PHP versions, the focus is not only on adding new syntax. The language is also becoming cleaner, safer and better for modern application development.
PHP 8.6 continues this direction.
Before upgrading an existing Laravel or PHP project, I normally don't directly update the production server. First I check the current PHP version, Laravel version, packages and application code.
For example:
php -vThen I check the installed Composer packages:
composer showI also check the PHP version required by the project in composer.json.
This is important because upgrading PHP can expose old code or packages that were working correctly on the previous version.
Why PHP upgrades are important
Many developers continue using an old PHP version because the existing application is working.
I understand this approach because upgrading a large application can take time.
But staying on an old version forever creates another problem.
You may miss:
- Security updates
- Performance improvements
- New language features
- Better type handling
- Better developer tooling
- Framework compatibility
- Package compatibility
For a small project, upgrading PHP can be relatively easy.
For a large ERP, SaaS or multi-tenant application, I prefer doing the upgrade step by step.
Check Laravel compatibility first
If the application is using Laravel, PHP compatibility should be checked together with the Laravel version.
For example, don't think only about:
PHP 8.x → PHP 8.6Think about the complete stack:
PHP
Laravel
Composer
Laravel packages
Database drivers
Redis
Queue workers
Supervisor
Nginx
PHP-FPM
Cron jobs
Docker images
CI/CDA PHP upgrade is not always only a PHP change.
One package can also create problems after the upgrade.
Check Composer dependencies
Before upgrading, I usually run:
composer outdatedThis gives a good idea about old dependencies.
I also check whether packages have PHP version restrictions.
Sometimes the application itself supports the new PHP version, but one old third-party package does not.
That is why dependency checking should happen before changing the server.
Don't ignore deprecated code
Older PHP applications can contain code that has been deprecated for a long time.
The application may still work, but the next PHP version can make those issues more visible.
This is one reason I prefer checking logs after upgrading.
For Laravel applications, I normally test:
- Login
- Registration
- API authentication
- Database queries
- File uploads
- Queue jobs
- Scheduled commands
- Emails
- Payment gateways
- Third-party APIs
- Reports
- CSV/Excel imports
- Large data processing
For an ERP or SaaS application, I also check background workers because sometimes the web application works but queue workers fail.
Test CLI separately
One common mistake is checking only the PHP version used by the browser.
For example:
php -vand PHP-FPM can use different configurations.
For Laravel applications, CLI PHP is important because commands like these run through CLI PHP:
php artisan migrate
php artisan queue:work
php artisan schedule:run
php artisan cache:clearSo after an upgrade, I always verify CLI and PHP-FPM configuration.
Check extensions
PHP projects normally depend on extensions such as:
mbstring
openssl
pdo
pdo_mysql
curl
xml
zip
gd
intl
bcmath
redisThe exact extensions depend on the project.
You can check installed extensions using:
php -mIf one required extension is missing, the application can fail even though PHP itself is installed correctly.
Don't upgrade directly on production
This is probably the most important point from my experience.
If the project is important, don't make the first PHP upgrade directly on production.
I prefer this approach:
Local
↓
Development/Staging
↓
Testing
↓
ProductionFirst upgrade the development environment.
Run the application and test the important features.
Then test the same version on staging.
Only after that, plan the production upgrade.
Keep a rollback plan
Before changing PHP on a production server, I always want a rollback option.
At minimum, I want:
- Database backup
- Application backup
- Composer lock file
- Server configuration backup
- Current PHP package information
- Current deployment version
If something goes wrong, rollback should be simple instead of trying to fix everything directly on production.
PHP is becoming better for modern applications
One thing I like about modern PHP is that the language is much more structured compared with old PHP code.
Today we commonly use:
declare(strict_types=1);Typed properties, return types, enums, attributes and better static analysis tools make large PHP applications easier to maintain.
Tools like PHPStan, Pest, PHPUnit and Rector also help developers maintain larger codebases.
For me, modern PHP development is not only about writing PHP code.
It is about having a complete development process around the code.
My approach for a large Laravel application
If I have to upgrade a large Laravel application, my basic process is:
- Check the current PHP version.
- Check Laravel version.
- Check Composer dependencies.
- Check PHP extensions.
- Check deprecated code.
- Create a backup.
- Upgrade the local environment.
- Run automated tests.
- Test important application features manually.
- Test queues and scheduled jobs.
- Test APIs and third-party integrations.
- Deploy to staging.
- Monitor logs.
- Plan production deployment.
- Keep rollback ready.
This may take more time, but it is much safer than changing PHP directly on a live server.
Final thoughts
PHP has changed a lot during the years.
If you are maintaining an old PHP or Laravel application, upgrading PHP should not be treated as just installing a new PHP package.
First understand the complete application stack.
Check dependencies, extensions, Laravel compatibility, queues, cron jobs and third-party integrations.
Then upgrade step by step.
For small applications, the upgrade may be simple.
For large SaaS, ERP or multi-tenant applications, proper testing and rollback planning are much more important.
I personally prefer smaller and controlled upgrades instead of waiting several years and then doing one very large upgrade.