1

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.

1
  • You should install something like apache or nginx to host it. Commented Dec 11, 2020 at 9:17

1 Answer 1

3

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>
Sign up to request clarification or add additional context in comments.

5 Comments

Thank you for the answer @Fahim Ahmed. I got the idea how it works.
@Malca you are welcome . Still if you have any issue uploading you can ask me.
How about php artisan queue:work ?. I run the command during development, to send email to user. I'm using smtp.gmail.com for MAIL_HOST during development.
you can check out the official documentation for the queue:work laravel.com/docs/8.x/queues & also stackoverflow.com/questions/27601634/…
Thanks @Fahim Ahmed, i will read it and tried which solution suit with my project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.