---
# System prepended metadata

title: Mac 啟動 php
tags: [Mac, php]

---

# Mac 啟動 php
###### tags: `Mac` `php`
## 起動
```
$ sudo php-fpm
```

如果啟動有錯依照指示配置
```
ERROR: failed to open configuration file '/private/etc/php-fpm.conf': No such file or directory (2)

$ cp /private/etc/php-fpm.conf.default /private/etc/php-fpm.conf

ERROR: failed to open error_log (/usr/var/log/php-fpm.log): No such file or directory (2)

$ vim /usr/local/etc/php-fpm.conf
```

修改php-fpm.conf文件中
```
error_log = /usr/local/var/log/php-fpm.log
pid = /usr/local/var/run/php-fpm.pid
```

## 停止
```
$ killall php-fpm
```



