Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CustomCMS's avatar

Old PHP Project running PHP version 7.4 with Laravel 8 integration.

First of all thank you in advance for any assistance offered.

I have started with a company that has their site build in php 7.4 with a very large codebase (procedural php and not MVC) that has been built on for 14 years. They now realize that we need to drastically improve the site and upgrade it from 7.4 to the latest version.

A new feature has now been developed using Laravel by a separate company and my company wants to know if it would be possible to run the Laravel application inside their existing php application. The Laravel app/functionality was built in Laravel 9 and I created a Laravel 8 project and pulled in only what we need to the Laravel 8 project and it works. The Laravel 8 decision was made so as to accommodate the php 7.4 currently being used.

How, if possible in any way can I move this project into the existing project and access it through a url for example www.domain.com/v2

I had a look on Stack Overflow and Laracast, but most suggest converting the existing project to Laravel, but I cannot state how large the existing project is, we would need a separate development team just to do that. Others suggest editing the .htaccess and if any route on the existing php project returns a 404 it should try load the index.php in the subfolder where the Laravel project is.

I have a bit of experience with Laravel and PHP but I have never had to take a project from development to production.

Is this the correct approach and what are my options?

Any assistance would be appreciated. Thank you

0 likes
2 replies
krisi_gjika's avatar

depending on how routing works on your old project, you can route any v2 request into a new sub folder, something like domain/v2/laravel/public. Another option is to configure the new tool as a new project/domain and slowly upgrade the old features into this new project (with latest laravel/php). I would recommend the second solution if all new features will be done in laravel and maintainability is a priority.

Snapey's avatar

laravel runs best in the root folder, and im assuming you already have an index.php there?

How about a subdomain? Eg v2.domain.com This would give you more freedom in terms of running different php version for the subdomain

Another option, but requires more courage on your part is that Laravel becomes the frontend router for the entire site, passing off 'legacy' requests to the original site. This would make it easier to gradually migrate functions to the Laravel framework.

Good article with other ideas: https://tighten.com/insights/converting-a-legacy-app-to-laravel/

Please or to participate in this conversation.