1
我在一個Docker容器中使用WordPress圖像(https://hub.docker.com/_/wordpress/)運行WordPress安裝。我的問題是,我不能通過wp_mail()
或PHP mail()
發送郵件。Docker-Compose Wordpress:wp_mail()不起作用
當我嘗試撥打mail()
-功能時,出現「內部服務器錯誤」。
我該怎麼辦?我需要外部郵件服務器嗎?
我的搬運工,compose.yml:
wordpress:
image: wordpress
container_name: shk_wordpress
links:
- mariadb:mysql
environment:
- WORDPRESS_DB_PASSWORD=admin
ports:
- "8000:80"
volumes:
- ./app:/var/www/html
- ./theme/:/var/www/html/wp-content/themes/shk-theme
mariadb:
image: mariadb
container_name: shk_mariadb
environment:
- MYSQL_ROOT_PASSWORD=admin
- MYSQL_DATABASE=wordpress
volumes:
- ./database:/var/lib/mysql
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: shk_phpmyadmin
environment:
- PMA_ARBITRARY=1
- MYSQL_USER=root
- MYSQL_PASSWORD=admin
- MYSQL_ROOT_PASSWORD=admin
ports:
- "9000:80"
links:
- "mariadb:mysql"
你有任何錯誤記錄?這可能是因爲你的碼頭圖像沒有打開正確的端口25 –