改成ubuntu的image
docker run -it --name cont3-cakephp \
--network cake-app --restart=always \
-e PMA_HOST=mysql -e TZ=UTC+8 -p 8082:80 \
ubuntu/apache2:2.4-20.04_beta
成功~
再來安裝php7.4
apt update
apt install php7.4 php7.4-cli \
php7.4-json php7.4-common php7.4-mysql\
php7.4-zip php7.4-gd php7.4-mbstring \
php7.4-intl php7.4-xml php7.4-pdo
php -v
安裝composer,https改成http才能下載
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
composer -v
安裝cakephp
composer create-project --prefer-dist cakephp/app:~4.0 myCake
修改etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Allow from all
</Directory>
去瀏覽器檢查了一下,咦!?
好像是css的檔案放置的url沒有被正確地找到,重新用個資料夾安裝也一樣,明天再來看看怎麼會這樣~~