使用根索引文件访问laravel公用文件夹

Laravel Version - 5.8.

I have to deploy my Laravel project on Shared Hosting without using php artisan serve command. So for that reason, I have renamed my root file server.php file to index.php.

Will there be any security consequences or bug, if I rename the file server.php to index.php?

you don't need to rename server.php to index.php. Just move the Public/index.php to the root of the folder and change the necessary path inside the index.php after moving. It will work for sure.

If you using cPanel, you can change webroot to public very simple don't need to rename server.php. If not you can using .htaccess to redirect all request to public folder like this :

# public_html/.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect All Requests To The Subfolder
    RewriteRule ^ /public

</IfModule>