/var/www/html/usr/local/etc/php/usr/local/etc/php-fpm.dFPM镜像需配合NGINX使用,NGINX配置参考以下配置
server {
listen 8001;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /var/www/html;
index index.html index.htm index.php;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /var/www/html;
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
docker run -d \
--name php \
-p 80:9000 \
ponycool/php-fpm-7.4:latest
./build.sh
或者
make docker
Blog: https://www.mayanpeng.cn
Email: pony#ponycool.com(将#替换为@)
Git: https://github.com/PonyCool
DockerHub:https://hub.docker.com/u/ponycool
docker pull ponycool/php-fpm-7.4:latest