Macos-docker php-fpm how to start?

Source: Internet
Author: User
Tags php error docker ps docker run
Dockerfile is this part: https://github.com/docker-library/php/blob/f016f5dc420e7d360f7381eb014ac6697e247e11/7.0/fpm/ Alpine/dockerfile

Post-Build execution
sudo docker run-d-P 9000:9000--name php7-fpm Daocloud.io/xxx/php7-fpm-alpine:first

Daocloud.io/xxx/php7-fpm-alpine:first is a built-in mirror

Then sudo docker PS shows that the scene is already running

I have a local nginx reboot run
Turn off local PHP-FPM execute the above boot container command after accessing PHP file
No 502 errors were reported, but the error File was not found.

System is Mac, what's the problem?
I tried it on--------yes.
sudo docker run-d-P 9000:9000-v/usr/local/www:/var/www/html--name php7-fpm Daocloud.io/xxx/php7-fpm-alpine:first

/usr/local/www is my local nginx access directory

Reply content:

Dockerfile is this part: https://github.com/docker-library/php/blob/f016f5dc420e7d360f7381eb014ac6697e247e11/7.0/fpm/ Alpine/dockerfile

Post-Build execution
sudo docker run-d-P 9000:9000--name php7-fpm Daocloud.io/xxx/php7-fpm-alpine:first

Daocloud.io/xxx/php7-fpm-alpine:first is a built-in mirror

Then sudo docker PS shows that the scene is already running

I have a local nginx reboot run
Turn off local PHP-FPM execute the above boot container command after accessing PHP file
No 502 errors were reported, but the error File was not found.

System is Mac, what's the problem?
I tried it on--------yes.
sudo docker run-d-P 9000:9000-v/usr/local/www:/var/www/html--name php7-fpm Daocloud.io/xxx/php7-fpm-alpine:first

/usr/local/www is my local nginx access directory

Hello, the WWW directory will also be mapped into the PHP-FPM instance Oh. Because the FPM way, Nginx passed to PHP-FPM is just a request object Oh, does not contain PHP file OH.

So you're going to map the WWW directory to the PHP-FPM instance <和nginx实例一样的路径> , too.

Amount
Need to ensure: Nginx See the path and PHP-FPM see the same path. Because Nginx is to pass the path to PHP-FPM.
Have skipped the pit, out of the Pit method: Find your php-fpm.conf, look inside the configuration of the Error_log path, find this error_log, inside will see can not find. PHP error.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.