Nisha Patel
Problem
I am trying to run my laravel project to our active localhost server. This server serve our PHP projects to local and in online.
Sample link: (10.0.any.any/apps)
Running php artisan serve which runs on port 127.0.0.1:8000 works but it does not connect to our local database so I decided to serve the laravel project to our local server. It means that I will no longer use php artisan serve command because our local server will automatically do the work. How can I do that?
I also tried moving .htaccess file from public folder to the root directory but it gave me errors. Thanks for the help.
Solution
First thing copy index.php file from public directory to the root directory
Then after the root directory index.php, set the proper public path
Copy .htaccess from public to the root directory
In the .env file, set the APP_URL
Answered by: >Roberts_ac
Credit: >StackOverflow
Blog Links:
>How to add a Parsing PHP file in order to get an array of parameters?
>How to correct WordPress site errors after upgrading to PHP 8.2?
>How does Perl match a string containing a dot in PHP?
>How to use PHP to display MySQL results in an HTML table?