Laravel applications<\/a> using the composer create-project command. This command is used to bootstrap new applications based on existing frameworks and content management systems.<\/p>\r\n\r\n\r\n\r\nFirst, change the directory to the Apache root directory and create a new Laravel application named laravelapp using the following command:<\/p>\r\n\r\n\r\n\r\n
cd \/var\/www\/html
\r\ncomposer create-project laravel\/laravel laravelapp --prefer-dist<\/code><\/p>\r\n\r\n\r\n\r\nOnce the installation is finished, you should see the following output:<\/p>\r\n\r\n\r\n\r\n
\r\nCreating a \"laravel\/laravel\" project at \".\/laravelapp\"
\r\nInstalling laravel\/laravel (v7.6.0)
\r\n- Installing laravel\/laravel (v7.6.0): Loading from cache
\r\nGenerating optimized autoload files
\r\n> Illuminate\\Foundation\\ComposerScripts::postAutoloadDump
\r\n> @php artisan package:discover --ansi
\r\nDiscovered Package: facade\/ignition
\r\nDiscovered Package: fideloper\/proxy
\r\nDiscovered Package: fruitcake\/laravel-cors
\r\nDiscovered Package: laravel\/tinker
\r\nDiscovered Package: nesbot\/carbon
\r\nDiscovered Package: nunomaduro\/collision
\r\nPackage manifest generated successfully.
\r\n31 packages you are using are looking for funding.
\r\nUse the `composer fund` command to find out more!
\r\n> @php artisan key:generate --ansi
\r\nApplication key set successfully.
\r\n<\/code><\/p>\r\n\r\n\r\n\r\nNext, change the directory to the laravelapp directory and run the following command to verify that all components were successfully installed:<\/p>\r\n\r\n\r\n\r\n
cd laravelapp
\r\nphp artisan<\/code><\/p>\r\n\r\n\r\n\r\nYou should see the following output:
\r\nLaravel Framework 7.11.0
\r\nUsage:
\r\ncommand [options] [arguments]
\r\nOptions:
\r\n-h, --help Display this help message
\r\n-q, --quiet Do not output any message
\r\n-V, --version Display this application version
\r\n--ansi Force ANSI output
\r\n--no-ansi Disable ANSI output
\r\n-n, --no-interaction Do not ask any interactive question
\r\n--env[=ENV] The environment the command should run under
\r\n-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
\r\n<\/code>
Next, change the ownership of the laravelapp directory and give proper permissions to the storage directory with the following command:<\/p>\r\n\r\n\r\n\r\nchown -R www-data:www-data \/var\/www\/html\/laravelapp
\r\nchmod -R 775 \/var\/www\/html\/laravelapp\/storage<\/code><\/p>\r\n\r\n\r\n\r\n