nginx on macOS

by Little Bear @24 ธ.ค. 66 10:51 ( IP : 171...124 ) | Tags : nginx , macOS
brew services list
brew services restart nginx
/opt/homebrew/opt/nginx/bin/nginx -g daemon off;

brew install shivammathur/php/php@7.4
brew reinstall php@7.4

sudo lsof -i -n -P|grep php-fpm

brew services start php@8.2

แก้ไขไฟล์ opt/homebrew/etc/nginx/nginx.conf

    location / {
        root /path/to/www;
        try_files $uri $uri/ /index.php?$uri&$args;
    }

Install multiple PHP version

brew tap shivammathur/php

เลือกมาสักเวอร์ชั่น

brew install shivammathur/php/php@5.6
brew install shivammathur/php/php@7.0
brew install shivammathur/php/php@7.1
brew install shivammathur/php/php@7.2
brew install shivammathur/php/php@7.3
brew install shivammathur/php/php@7.4
brew install shivammathur/php/php@8.0
brew install shivammathur/php/php@8.1
brew install shivammathur/php/php@8.2
brew install shivammathur/php/php@8.3

Mac M1 : Config file อยู่ที่

/opt/homebrew/etc/php/7.0/php.ini
/opt/homebrew/etc/php/7.1/php.ini
/opt/homebrew/etc/php/7.2/php.ini
/opt/homebrew/etc/php/7.3/php.ini
/opt/homebrew/etc/php/7.4/php.ini
/opt/homebrew/etc/php/8.0/php.ini
/opt/homebrew/etc/php/8.1/php.ini
/opt/homebrew/etc/php/8.2/php.ini
/opt/homebrew/etc/php/8.3/php.ini

แก้ไขไฟล์ php.ini ที่ /opt/homebrew/etc/php/8.0/php-fpm.d/www.conf เปลี่ยน port จาก 9000 เป็น 9080

restart php

brew services start php@8.0

Problem

1.Can't upload jpg/pdf