[Prerequisites] The Lamp environment with composer installed has been built normally.
You can run the Laravel project downloaded from github for the time being Set up to use.
Let's access GitHub and download a suitable Laravel project for the time being [project name testlaravel]
I get an error like this when I try to launch serve for a DL testlaravel project.
/var/www/html/testlaravel$ php artisan serve
I get this error ↓
PHP Warning: require(/var/www/html/testlaravel/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/testlaravel/artisan on line 18
Warning: require(/var/www/html/testlaravel/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/testlaravel/artisan on line 18
PHP Fatal error: require(): Failed opening required '/var/www/html/testlaravel/vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/testlaravel/artisan on line 18
Fatal error: require(): Failed opening required '/var/www/html/testlaravel/vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/testlaravel/artisan on line 18
Install composer because the Laravel project cannot be started because Composer is not included.
/var/www/html/testlaravel# composer install
Let's launch the testlaravel project as soon as the composer installation is complete
/var/www/html/testlaravel# php artisan serve
It does get up, but I always get a 500 server error here.
The .env file is not created in laravel as a cause of the error here A server error has occurred due to the fact that APP_key has not been created.
First, let's create an .env file. Enter the following in the command
cp .env.example .env
At this stage, the env file has not been created yet, so let's create APP_KEY.
php artisan key:generate
Enter vi .env and if the .env file is created successfully, you are done. ↓ This is the guy
APP_NAME=
APP_ENV=
APP_KEY=
APP_DEBUG=
APP_URL=
LOG_CHANNEL=
DB_CONNECTION=
DB_HOST=
DB_PORT=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
(Omitted below)
If you launch the testalaravel project again and the usual page appears, it is a success.
Recommended Posts