因此,我在PHP项目开发环境中使用Laradock
。将电子邮件发送到mailtrap时出现问题,并且出现此错误:
sh: 1: /usr/sbin/sendmail: not found
该如何解决? 或者在Laradock中,除了最佳实践和方法以外,还有没有其他测试方法?
我已经尝试在php-fpm dockerfile apt-get install -y sendmail && \
中安装sendmail,然后重新构建容器,似乎日志中已经安装了sendmail,然后重新启动容器,它仍然有相同的错误:
sh: 1: /usr/sbin/sendmail: not found
我的php-fpm / Dockerfile
...
# always run apt update when start and after add new source list, then clean up at end.
RUN set -xe; \
apt-get install -y sendmail && \
apt-get update -yqq && \
pecl channel-update pecl.php.net && \
apt-get install -yqq \
apt-utils \
#
#--------------------------------------------------------------------------
# Mandatory Software's Installation
#--------------------------------------------------------------------------
#
# Mandatory Software's such as ("mcrypt", "pdo_mysql", "libssl-dev", ....)
# are installed on the base image 'laradock/php-fpm' image. If you want
# to add more Software's or remove existing one, you need to edit the
# base image (https://github.com/Laradock/php-fpm).
#
# next lines are here becase there is no auto build on dockerhub see https://github.com/laradock/laradock/pull/1903#issuecomment-463142846
libzip-dev zip unzip && \
docker-php-ext-configure zip --with-libzip && \
# Install the zip extension
docker-php-ext-install zip && \
php -m | grep -q 'zip'
...
我希望邮件发送到我的邮箱,使用Wampserver一次成功