Doubts in Laravel - laravel

I was learning Laravel, I felt doubts regarding to the same.
Do we need APACHE server for Laravel? Because, without my LAMP server ON, I could do php artisan serve
Laravel server is working on HTTP, I wish to work it on HTTPS server.
Can someone help me in above questions?
Thanks in advance.

the php artisan serve is more for testing purpose, to start a development server, so you build you application as fast as you can to test it, but its not for running it to production.
and for your second question, with apache you can solve that, but if you still want to use it with the php artisan serve, you can use ngrok like this
cd <path-to-ngrok>
./ngrok http localhost:8000
https://ngrok.com/

Related

Is it possible deploying Laravel Sail developed project to Apache server?

I’m not too familiar with the server technologies. So my question is is it ok to deploy a project developed under Laravel Sail environment (which uses Nginx as default web server i guess) to a server which runs Apache? Will it work? Should i expect any problems?
Laravel Sail is not for production. It also doesn't use apache or nginx, but php's build in web server (php artisan serve). So please use your own, or have a look at my config.
I have modified the docker file to work with Sail and Apache for development purpose. You can take a look on Gitlab link here to have some idea for your production environment.

Laravel Restful api Production Server Configuration

This is my first time moving my Laravel RESTful api to the production server in CentOS environment using apache. To make it work I have to use
APP_URL=production_ip_address
MARKET_BASE_URI=127.0.0.1:8000
and php artisan serve or i
get cURL error 7
Is there any better way to do so if my APP_URL and MARKET_BASE_URI is same? This works on my local environment with the same URL and no issues, but Connection issues when i use the same in production environment.
use
MARKET_BASE_URI=127.0.0.1:9000
run
php artisan serve --port=9000

Difference of using php artisan serve and not using it

What is the difference of using php artisan serve and by just using localhost/myproject/public?
Some of my code is not working when I'm just using the localhost/myproject/public, but when using php artisan serve all works just fine. Why is that?
main difference is who have the role to be the web server ? Means : who have the role to intercept HTTP request and provide it to PHP compiler.
With traditional web server (apache, nginx ...)
Web service will catch request, then ask php to do traitment with.
With PHP server php artisan serve php himself have role to manage this step. that means, if error happen on your process, this will shutdown your server. Apache will not be affected by this error, so rest of application will be still available.
Now about differente way to ask php to execute some code :
For Apache you can have php-mod, who are an extension of Apache or php-fpm (describe bellow)
For Nginx or other WebService, you have php-fpm or php-fastcgi, both are way (by TCP or Unix Socket) of communcation between your web service instance (processus) and php instance (processus).
php-cli who are the php instance spawn when you do php something on your terminal
For each approch you have differente php.ini and php extension to download / activate.
That means, for exemple, if you need to use Imagick library by command line tool (php-cli) and from your web server (php-mod on Apache) you have to download and activate this library on both setup.

Access PhpStorm web server (Laravel) via LAN

I have a Laravel Project that I develop in PhpStorm. I use the build in PhpStorm web server for development and debugging. (localhost:8000) Now I need to be able to access that server from another device within the same network.
Google search and jetbrains.com have not been very helpful. I have tried this (https://intellij-support.jetbrains.com/hc/en-us/community/posts/207020155-phpstorm-and-http-server-localhost-only-) but it did not work.
Any help?
EDIT:
I found the problem. Since the web server is launched via artisan, it ignores my PhpStorm settings. I needed to change the launch parameter, like so:
php artisan serve --host=0.0.0.0 --port=8000

How to run my laravel project on vps?

Now I just finished my laravel web application and want to upload to vps (digital ocean).In local, i usually trying to use by typing php artisan serve ,then go to access http://localhost:8000/ ,and everything is fine. But on vps ubuntu, how to type to run my laravel application,I already upload my project to git and pull from vps. I follow this instruction,but this instruction is just installation.Please guide me. Thanks in advance.

Resources