0

I am having a Blank Page issue for Laravel Project in a Sub-domain (cPanel). The root domain (https://ratul.info/) already has a Laravel application. So I was trying to upload another Laravel project in a Sub-domain (https://ecommerce.ratul.info/). Unfortunately, it was showing a White Screen with no error.

Sub-domain details

  • Subdomains: ecommerce.ratul.info
  • Document Root: /public_html/ecommerce

Files of public and index.php is in /public_html/ecommerce and other files are in /public_html/ecommerce/flipmart.

The folder structure is Public_html > ecommerce > flipmart

I have changed the path in index.php

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

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

Sub-domain is working fine. I have checked with simple HTML files.

Ratul
  • 43
  • 2
  • 8
  • the root should in the public folder in Laravel. –  Apr 22 '22 at 21:43
  • @JustJeremy I have brought the content of the public folder to the sub-domain root. – Ratul Apr 22 '22 at 21:51
  • that's your problem right there. It's not built to have index in the root. It has tons of stuff to do when it first boots. In cpanal just point your subdomain to the public folder. It will work. –  Apr 22 '22 at 22:01
  • I was deploying the project from my git repo. Then I was uploading the vendor and .env file. It was creating the issue. When I upload the file as zip everything seems fine. Thanks to @Nahid Hasan Limon – Ratul Apr 22 '22 at 22:40
  • Something on my gitignore was creating the issue. I don't know what and why. However, the issue is mitigated. – Ratul Apr 22 '22 at 22:42

1 Answers1

0

require DIR.'/flipmart/vendor/autoload.php';

$app = require_once DIR.'/flipmart/bootstrap/app.php'; is all good if Here ecommerce is your subdomain root directory and flipmart is a subfolder of ecommerce (if i am not wrong) . Also check vendor folder exist.