Laravel is a PHP framework that is used to develop a website system. Laravel also simplifies the website development process with the help of several excellent features, such as Template Engine, Routing, and Modularity.
Before uploading Laravel files to hosting using the Plesk control panel, make sure your website files have been created or the website is finished. Here are the steps to upload Laravel to the Plesk control panel:
1. Laravel Frameword directory structure
First, please adjust the directory file structure on the Laravel Framework that you want to upload:
2. Creating a Laravel folder
Next, please create a folder with the name laravel, then move the files and folders other than the public folder to the Laravel folder, so that the folder structure becomes like the following image:
3. Editing the index.php file
Please edit the index.php file in the public folder. Then you change the script section as follows:
require __DIR__.'/../vendor/autoload.php'; $app = require_once __DIR__.'/../bootstrap/app.php';
Then change it to the following:
require __DIR__.'/../laravel/vendor/autoload.php'; $app = require_once __DIR__.'/../laravel/bootstrap/app.php';
Then please also add the following script in the index.php file
$app->bind('path.public', function() { return __DIR__; });
4. Uploading files to Plesk
Next, please upload the file to the Plesk control panel. Before uploading, please compress it into a zip file for the Laravel folder and fill the files in the public folder first. Then please upload the zip file that has been created to your Plesk control panel.
For the laravel zip file, please upload it to the Plesk control panel home directory, according to the following image and wait for the upload process to complete.
5. Then extract the laravel zip file
6. Access to httpdocs folder
After that, please access the httpdocs folder, and then upload the zip file of the files in the public folder to the httpdocs folder.
Then please extract the file:
Once you've reached this stage, you can try accessing the website. If the website displays properly, then the Laravel upload to the hosting is complete. But if you encounter an error, please check the Hosting Log menu again.
Hope this helps and Thank you.