简体   繁体   中英

Laravel showing index.php

Server Details: windows server 2012 R2 Apache server 2.4 As IIS server works 8080 and Apache works on 8181 port PHP 7.4 Mysql Database

We need to deploy the Laravel project on 8181 port.

We have run the composer successfully. After that save the Laravel project on htdocs of Apache24 folder. In htdocs we created Laravel folder into that we keep all the Laravel project file. so the path is c:/Apache24/htdocs/Laravel/public/index.php

In url it also shows the path like http://ip address:8181/Laravel/public/index.php. It shows the landing page of website. After that when click on register page it shows the register controller name after index.php like below

http://ip address:8181/Laravel/Laravel/public/index.php/register

This shows the extension of file as well as public folder, which is not standard Laravel pratice

You have to use artisan command in terminal or cmd for running laravel project.

php artisan serve 

when use this artisan command, laravel runs on port 8000 as default but if you want run project on custom port, you can use port flag in artisan commad

php artisan serve --port=8181 

You have to change some configuration

In your public directory all files cut and copy at your Laravel folder. And you have to change some configuration in your index.php file

require __DIR__.'/vendor/autoload.php';

and

$app = require_once __DIR__.'/bootstrap/app.php';

And just url like this

http://ip address/Laravel/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM