Ubuntu20.04 で Laravel8 を設置。 少し長いです。PHP、Composer その他ゴニョゴニョ。
まずはいつものアップデートから。
]$ sudo apt update
]$ sudo apt upgrade
apache2 インストール
]$ sudo apt install -y apache2
]$ sudo systemctl start apache2
]$ sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2022-09-18 06:43:46 PDT; 18s ago
Docs: https://httpd.apache.org/docs/2.4/
Main PID: 74721 (apache2)
Tasks: 55 (limit: 9445)
Memory: 4.8M
CGroup: /system.slice/apache2.service
├─74721 /usr/sbin/apache2 -k start
├─74727 /usr/sbin/apache2 -k start
└─74728 /usr/sbin/apache2 -k start
Sep 18 06:43:46 ubuntu systemd[1]: Starting The Apache HTTP Server...
Sep 18 06:43:46 ubuntu apachectl[74713]: AH00558: apache2: Could not reliably determine th>
Sep 18 06:43:46 ubuntu systemd[1]: Started The Apache HTTP Server.
systemctl status で状態確認。 apache2の初期リダイレクト先は
/var/www/html/index.html
PHP8 インストール
]$ sudo add-apt-repository ppa:ondrej/php
]$ sudo apt install -y php8.0 php8.0-intl php8.0-mysql php8.0-sqlite3 php8.0-gd php8.0-dom php8.0-curl
]$ php -v
PHP 8.0.23 (cli) (built: Sep 18 2022 10:24:49) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.23, Copyright (c) Zend Technologies
with Zend OPcache v8.0.23, Copyright (c), by Zend Technologies
]$ sudo systemctl restart apache2s
composer
]$ sudo apt install curl php-cli php-mbstring git unzip
]$ curl -sS https://getcomposer.org/installer | php
]$ sudo mv composer.phar /usr/local/bin/composer
]$ composer --version
Composer version 2.4.2 2022-09-14 16:11:15
Laravel
]$ composer create-project --prefer-dist laravel/laravel test_project
...
...
...
]$ cd test_project
]$ php artisan serve
INFO Server running on http://127.0.0.1:8000.
Press Ctrl+C to stop the server
2022-09-18 22:13:20 ................................................... 0s
ブラウザから確認します。
いつもの光景👍
コメント