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

PK_06's avatar
Level 1

Deployment

Hi, Everyone!

I have a problem, deploying my project. Our current server is windows, with wamp server. And I want to deploy it without using

php artisan serve

because I want it running just like the normal web apps. Can anyone tell me the best and safest way?

I already used some suggestions over the internet. Like renaming server.php to index.php and moving .htaccess file from public folder to root directory. It seems working fine, but one thing is it exposing all files in browser such as .env which is not right thing.

I do really appreciate your help. Thank you in advance! Godbless!

0 likes
4 replies
KGu's avatar

please check your php version of window

mvd's avatar

Hi PK_06,

You need to set your document_root in the vhost to the public folder. Now only the public files are accessible in the browser.

<VirtualHost *:443>
    DocumentRoot "C:/wamp/www/yourwebsites/public"
    ServerName yourwebsite.com
.....
.....

This article shows how to setup vhosts in Wamp, https://john-dugan.com/wamp-vhost-setup/

PK_06's avatar
Level 1

@KGU - I think PHP version doesn't matter. I just wanted to serve my app without using artisan. The idea is allowing to override some configurations to redirect all requests in example: "project/public". Plus cleaning URL by removing "public" path.

Thank you.

PK_06's avatar
Level 1

@MVD - Oh, I forgot this to include. I already tried this way. But unfortunately, didn't work. Plus it only destroys our centralized web application. I assume that we are using shared hosting? Not sure. Maybe because our domain name we are accessing here inside the company is different from the outside.

By the way thank you Sir. I appreciate this.

Please or to participate in this conversation.