docker run -d --name php-fpm \  
-p 9000:9000 \
-v /data/docker/php-fpm/www.conf:/data/php-fpm/etc/php-fpm.d/www.conf \
-v /data/docker/nginx/html:/var/www/html \
-v /data/docker/php-fpm/log:/data/php-fpm/log \
php:7.4-fpm  

nginx use php via sock:

location ~ \.php$ {  
        root           html;
        fastcgi_pass   172.17.0.1:9000;  # 使docker网络连接
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        include        fastcgi_params;
    }

发表回复

您的电子邮箱地址不会被公开。

Captcha Code