I'm encountering an issue after migrating my Laravel application from one server to another. When I try to access the website, I get the following errors:
I do not have terminal access on the new server, so I can't run any artisan or composer commands. Here are the details of my setup:
I transferred all Laravel files to the new server using File Manager. I migrated the database and updated the .env file accordingly.
403 Forbidden occurs when accessing the root domain. 500 Internal Server Error appears when trying to handle custom error pages via .htaccess.
Updated the .env file to match the new database settings. Checked and changed file and folder permissions (set storage and bootstrap/cache to 775, .env to 644). Ensured the .htaccess file exists in the root Laravel directory with the following content:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
cPanel without terminal access. PHP 8.0. Apache web server.
Main Question: How can I resolve the 403 Forbidden and 500 Internal Server Error issues in Laravel after migrating to a new server without terminal access? Is there anything else I should check or configure in cPanel or the Laravel files to ensure the application works correctly?
Additional Details: I checked the Error Logs in cPanel, which indicated an issue with Collection.php related to PHP. However, I am unable to run composer or artisan commands due to lack of terminal access.
Check whether the required PHP version is compatible with the PHP version on your server.
Open the composer.json file and check the required PHP version under the require section.
If the required PHP version is higher than what you have, add "platform-check": false in the config section.
Run composer dump-autoload locally, then upload the changes using file manager.