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

Awa's avatar
Level 1

How can I run an independent php project inside my laravel 5.x application?

I am working on a Laravel website for PHP tutorials. The tutorials on this website have little demos including simple independent PHP projects with their own pages, database tables, forms and the like. What I have done so far is place the PHP project folder in my Laravel public folder and tried to execute the code from the public folder of my Laravel application. But only the CSS and javascript seems to be working. Other functions like form submission and database connectivity don't seem to work. How do I make the PHP code execute independently in my Laravel application?

0 likes
2 replies
mithilesh999's avatar

I think you should make a sub domain and put you other project into that subdomain and provide a link to you current laravel project.

Snapey's avatar

If the file exists in its own right e.g. public/lessons/lesson1.php then you should be able to execute this code directly without worrying about the framework

Unfortunately though this means that you also cannot use ANY of the framework. You can pull in classes manually into those files if you get the path right.

Please or to participate in this conversation.