iT邦幫忙

2021 iThome 鐵人賽

DAY 8
0

同理 apt-get install -y libzip-dev 完後可以安裝zip...

apt-get install libcurl4-openssl-dev 完後可以安裝 docker-php-ext-install curl

然後還需要 apt-get install unzip

把原本的cake資料夾刪掉再試一次composer,就可以成功安裝cake了

再接著設定URL Rewriting的部分

<Directory />
	Options FollowSymLinks
	AllowOverride All
#	Require all denied
</Directory>

<Directory /usr/share>
	AllowOverride None
	Require all granted
</Directory>

<Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride All
	Require all granted
	Allow from all
</Directory>

接著再輸入

a2enmod rewrite
service apache2 restart

https://ithelp.ithome.com.tw/upload/images/20210926/20127692Dp7SicEXaV.png

可喜可賀~~~

不過database顯示unable to connect

先進到 myc/config/app_local.php

改成以下這樣試試

'Datasources' => [
        'default' => [
            'host' => 'mysql',
            /*
             * 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' => 'secret',

            'database' => 'cake',
						'encoding' => 'utf8mb4',
            'timezone' => 'UTC',
            /*
             * 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),
        ],

https://ithelp.ithome.com.tw/upload/images/20210926/20127692bFNmL1PVt7.png

太棒惹~
接下來的問題是這個container該如何可以被ssh從外部code連接到呢?


上一篇
[DAY10]製作容器(九)
下一篇
[DAY12]測試SSH連線
系列文
Docker、docker-compose、network使用多個容器進行網頁開發13
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言