php - Page is not working in cpanel using Laravel 5.6
Get the solution ↓↓↓I created the Laravel Project in a local machine and I created the database also. In the local machine, a project is working without any issues but I uploaded my project file into the shard server Cpanel inside the public_html folder and I access the URL it's saying This page isn’t working, HTTP ERROR 500.
Cpanel PHP version is 7.0 Laravel version is 5.6
But I moved the content file inside the public folder to root folder (public_html) and I changed the path in index.php file
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
And server.php file also I change the path Like this.
if ($uri !== '/' && file_exists(__DIR__.'/public_html'.$uri)) {
return false;
}
require_once __DIR__.'/public_html/index.php';
And My htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php70” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-alt-php70 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Please help to fix this issues.
Answer
Solution:
You should put all the public folder files inside public_html folder and the rest of your project files inside another folder which you can name it laravel. Then you shoud change your index.php file like this:
require __DIR__.'/../laravel/vendor/autoload.php';
$app = require_once __DIR__.'/../laravel/bootstrap/app.php';
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: err_ossl_pem_no_start_line
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.