| Server IP : 178.128.106.170 / Your IP : 216.73.217.12 Web Server : nginx/1.18.0 System : Linux Live-Team 5.10.0-44-amd64 #1 SMP Debian 5.10.257-1 (2026-05-27) x86_64 User : ( 1000) PHP Version : 7.3.33-14+0~20230902.114+debian11~1.gbp764b27 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/share-management/ |
Upload File : |
# Installation Guide for Laravel Project
Welcome to the Laravel project! Follow the steps below to set up the development environment and get the project up and running.
## Prerequisites
Before you begin, ensure you have the following installed on your system:
1. **PHP**: Version 8.1 or higher.
2. **Composer**: Dependency manager for PHP.
3. **MySQL**: Database server.
4. **Node.js** and **npm**: For front-end package management.
5. **Git**: Version control system.
6. **Laravel Installer** (optional): To create and manage Laravel projects.
## Step 1: Clone the Repository
```bash
git clone https://github.com/your-username/your-project-name.git
```
Move into the project directory:
```bash
cd your-project-name
```
## Step 2: Install Dependencies
Run the following command to install PHP dependencies:
```bash
composer install
```
Then, install Node.js dependencies:
```bash
npm install
```
## Step 3: Set Up Environment Variables
Copy the `.env.example` file to `.env`:
```bash
cp .env.example .env
```
Update the following environment variables in the `.env` file:
```env
APP_NAME=YourAppName
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_password
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
```
## Step 4: Generate Application Key
Run the following command to generate an application key:
```bash
php artisan key:generate
```
## Step 5: Run Migrations and Seeders
Run the migrations to create the database tables:
```bash
php artisan migrate
```
If there are seeders available, run them to populate the database with initial data:
```bash
php artisan db:seed
```
## Step 6: Install and Configure Snappy PDF
This project uses the **snappy-pdf** package to generate PDF files. Follow the steps below to set it up properly.
### Install the Package
```bash
composer require barryvdh/laravel-snappy
```
### Install WKHTMLTOPDF
**Snappy** requires `wkhtmltopdf` to be installed on your system. Download and install it from [https://wkhtmltopdf.org/downloads.html](https://wkhtmltopdf.org/downloads.html).
Make sure `wkhtmltopdf` is available in your system's `PATH` or specify its path in the `.env` file:
```env
SNAPPY_PDF_BINARY=/usr/local/bin/wkhtmltopdf
SNAPPY_IMAGE_BINARY=/usr/local/bin/wkhtmltoimage
```
### Publish the Configuration File
Run the following command to publish the configuration file for Snappy:
```bash
php artisan vendor:publish --provider="Barryvdh\Snappy\ServiceProvider"
```
### Verify Installation
Run the following command to ensure Snappy is working correctly:
```bash
php artisan tinker
```
In the Tinker console, run:
```php
\Barryvdh\Snappy\Facade\SnappyPdf::loadHTML('<h1>Test PDF</h1>')->download('test.pdf');
```
If the file downloads successfully, Snappy is configured correctly.
## Step 7: Start the Development Server
Run the following command to start the Laravel development server:
```bash
php artisan serve
```
By default, the application will be available at [http://127.0.0.1:8000](http://127.0.0.1:8000).
## Optional Commands
### Run Tests
If the project has tests configured, you can run them using:
```bash
php artisan test
```
### Clear Cache and Config
Sometimes, you may need to clear the cache and recompile configuration files:
```bash
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
```
## Troubleshooting
If you encounter any issues, try the following steps:
1. Check if all dependencies are installed correctly.
2. Verify that the `.env` file is configured properly.
3. Clear the cache and configuration using the optional commands listed above.
If you still encounter issues, check the error logs in `storage/logs/laravel.log`.
## Notes
- **Database**: Ensure your MySQL server is running and you have created the database specified in the `.env` file.
- **Permissions**: Set the correct permissions for the `storage` and `bootstrap/cache` directories.
```bash
chmod -R 775 storage
chmod -R 775 bootstrap/cache
```
## Conclusion
You have successfully installed and set up the Laravel project. Happy coding!