Laravel shared hosting, index.php not pointing to root but staying at public_htmls

laravel htaccess public_html
laravel change public folder to root
how to remove public from url in laravel using htaccess
how to upload laravel 5.6 project to cpanel
upload laravel project on subdomain cpanel
laravel routes not working on shared hosting
how to redirect your laravel website from the /public folder to the main domain
laravel public folder path

I have been working on deploying my Laravel app on a shared hosting using cpanel. However, I an getting this error:

[08-Sep-2018 07:38:43 UTC] PHP Fatal error:  require(): Failed opening required '/home/daankraa/public_html/../../supersax/vendor/autoload.php' (include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in /home/daankraa/public_html/index.php on line 24

From what I can see here is that it doesn't want to switch to the root directory, but keeps looking for:

/home/daankraa/public_html/../../supersax/vendor/autoload.php in public_html.

I have tried the dots to move up a directory, but it doesn't want to. How can I fix this?

Thanks in advance!

Daan

1) Copy .htaccess from public folder to root

2) rename server.php to index.php

server.php file would be in root

Simple :)

Hot to redirect your site to open the Laravel public folder?, Learn how to redirect your domain from Laravel default index to the Laravel in your public_html folder (root directory for the primary domain), but you do not cPanel hosting account or test your developer`s skills on our Laravel Hosting packages. Shared Hosting · Reseller Hosting · VPS Hosting · Dedicated Servers  Shared hosting is cheap as dirt and clients who don’t know the role of the underlying hosting solution in the app performance prefer shared hosting to save project costs. Similarly, developers generally install and deploy Laravel to shared hosting without considering the problems it causes for the end users.

Move you all content from public to root directory and index.php file of public folder modified according like:

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

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

From local to shared hosting, I have uploaded laravel to a folder above the public_html as: and you won't need to change any of the entry points for Laravel. As long as your index.php is in the public_html directory you are Easiest solution is to tell your web server to use the public folder that ships with Laravel as the root of the site  Upload laravel project to shared hosting issue Posted 4 years ago by [email protected] i have uploaded my laravel project to a shared hosting server, but i have problem to run it.

index.php

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylor@laravel.com>
 */

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
    return false;
}

require_once __DIR__.'/public/index.php';

uploading app on bluehost shared server, Now I have read that shared hosting is not recommended and so on, but i do want to give it a try on bluehost my index.php file is pointing to my laravel folder​. Laravel in Shared Hosting Posted 1 year ago by afoysal I am trying to install a Laravel application in Shared Hosting following this tutorial where my server's PHP version is 7.1.17 and my Laravel version is 5.6.15.

Deploying Laravel 5 applications on shared hosting without the use , Upload the laravel50.zip to the root directory – not the public_html. Extract the Navigate to the public_html folder and locate the index.php file. Right click Since we are using a shared hosting, we can not do this without the use of SSH. This can test.mydomain.com points to public_html/test. But does  For a quick version of the guide (many of you might already read about it), read my post on medium, "The simple guide to deploy Laravel 5 application on shared hosting" Requirements. Before trying to deploy a Laravel application on a shared hosting, you need to make sure that the hosting services provide a fit requirement to Laravel. Basically

Laravel public folder, The public_html directory is also called web root folder or document ro. folder of the public_html, and do not want the sub folder to appear as a part of the URL​  In this tutorial, I’d like to show you a very simple method to deploy Laravel 5 applications, safe & secure. First, let say in your hosting server (VPS, or shared hosting…whatever), you have

How to change my document root folder using an .htaccess file?, cPanel is the most popular web hosting control panel. It's the Here we'll create an index.php file in the public_html folder. The root directory and files of the subdomain will not be removed. So whenever visitors go to yourdomain.org, they'll be pointed to your primary domain instead, yourdomain.com. Isn’t it better to host Laravel on VPS, instead of shared servers. You can scale VPS, but you cannot scale shared servers. There are also issues regarding performance and security with shared hosting. However, if you don’t have sysadmin skills then hosting Laravel on it could prove to be difficult.

Comments
  • Did you move the index.php from the public folder into the root? Is that why index.php is in public_html?
  • Is /home/daankraa/public_html/ the path to the laravel project?
  • If so then the path should be something like: /home/daankraa/vendor/autoload.php
  • I dont have any server.php in my root.
  • check your application root folder
  • If server.php is not there then create index.php in root i am pasting index.php file code
  • check new answer if you don't have server.php
  • add index.php in your application root folder