Malca
Malca

Reputation: 123

How to deploy laravel project on windows server

I am new to laravel and still learning.

At first, I develop a laravel project on my own computer. As i know, when run php artisan serve command and open XAMPP, then the laravel project will open on http://127.0.0.1:8000/ .

I want to deploy the project on window server. Do i need to run php artisan serve on server continuously, so that the laravel project can be running on server side and accessible to public?

Any help will be grateful. Thank you.

Upvotes: 1

Views: 8952

Answers (1)

Fahim Ahmed
Fahim Ahmed

Reputation: 139

Well you can do that with git. Push your project on git & pull it on your windows server.

Beside you can do a manual things like zip your project upload to your server & then unzip them.Create a database on the server. After that edit your .env file and change the details of your database

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your database name you just created on the server
DB_USERNAME=yourdatabase username...............
DB_PASSWORD=your database password .............

After that check if there is .htaccess file or not if not then create one & paste the below code

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
   Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
</IfModule>

Upvotes: 3

Related Questions