Laravel is a modern PHP framework designed for building robust web applications. While Softaculous can automate installation, you may sometimes need to install Laravel manually, for example, if you want a specific version or are working on an unmanaged server.

 

Why Install Laravel Manually?

  • Greater control over version selection.

  • Works on unmanaged VPS or dedicated servers.

  • Useful for developers who want custom setups.

 

Steps to Install Laravel Manually

  1. Log in to Your Account via SSH.

    • Use an SSH client to connect to your hosting account.

  2. Install Laravel Using Composer.

    • Laravel uses Composer, a PHP dependency manager.

    • Navigate to your home directory:

      Bash
      
      cd ~
      
       
    • Run the following command (replace project with your desired project name):

      Bash
      
      composer create-project laravel/laravel project
      
       
    • This installs Laravel in /home/username/project.

  3. Set Up Artisan Alias (Optional).

    • Artisan is Laravel’s command‑line interface.

    • To run Artisan by simply typing artisan, add an alias:

      echo 'alias artisan="php /home/username/project/artisan"' >> ~/.bashrc
      source ~/.bashrc
      

       

  4. Make Laravel Publicly Accessible.

    • Copy the contents of the public directory to your public_html folder:

      Bash
      
      cp -r ~/project/public/* ~/public_html
      

       

    • Alternatively, copy to a subdirectory (e.g., public_html/laravel):

      Bash
      
      cp -r ~/project/public/* ~/public_html/laravel
      
       
    • In this case, your site will be accessible at http://example.com/laravel.

  5. Update index.php Paths.

    • Open public_html/index.php in a text editor.

    • Update the following lines to include the correct project directory:

      require __DIR__.'/../project/vendor/autoload.php';
      require __DIR__.'/../project/bootstrap/app.php';
      
       
  6. Verify Installation.

    • In your browser, go to http://example.com.

    • You should see the Laravel welcome page.

Notes

  • Laravel is compatible with all ruachost.com accounts.

  • Always use strong admin and database passwords.

  • Keep Laravel updated to prevent vulnerabilities.

  • Consider enabling automatic backups for added protection.

  • Repeat steps 4–6 if you modify any public site files in the project directory.

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution