CakePHP4で簡易ブログサイトを作ってみるコーナーです。
271 views
composer create-project --prefer-dist cakephp/app:4.* cakeblog
mysqlでcakeblogdbというデータベースを作成する。
create database cakeblogdb;
config/app_local.phpを編集する。11,12,14行目。
'Datasources' => [
'default' => [
'host' => 'localhost',
/*
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
//'port' => 'non_standard_port_number',
'username' => 'root',
'password' => '',
'database' => 'cakeblogdb',
/*
* If not using the default 'public' schema with the PostgreSQL driver
* set it here.
*/
//'schema' => 'myapp',
/*
* You can use a DSN string to set the entire configuration
*/
'url' => env('DATABASE_URL', null),
],
http://localhost/cakeblog/にアクセスして以下の画面が表示されることを確認する。
Page 11 of 15.
すぺぺぺ
本サイトの作成者。
プログラムは趣味と勉強を兼ねて、のんびり本サイトを作っています。
フレームワークはdjango。
ChatGPTで自動プログラム作成に取り組み中。
https://www.osumoi-stdio.com/novel/