sudo apachectl stop
sudo rm /usr/sbin/httpd
sudo rm -r /etc/apache2/
通过以下命令更新brew镜像源
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
brew update
qujingdeMacBook-Pro:homebrew-core qujing$ brew -v
Homebrew 1.6.6
Homebrew/homebrew-core (git revision 5c61; last commit 2018-12-16)
如上图已经更新成功
执行安装nginx
qujingdeMacBook-Pro:homebrew-core qujing$ brew install nginx
Updating Homebrew...
==> Installing dependencies for nginx: openssl
==> Installing nginx dependency: openssl
==> Downloading https://www.openssl.org/source/openssl-1.0.2q.tar.gz
######################################################################## 100.0%
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.2q --openssldir=/usr/local/etc/openssl no-ssl2 no-ssl3 no-zlib shared enable-cms darwin64-x86_64-cc enable-ec_nistp_64_gcc_128
==> make depend
==> make
==> make test
==> make install MANDIR=/usr/local/Cellar/openssl/1.0.2q/share/man MANSUFFIX=ssl
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall openssl`
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
==> Summary
? /usr/local/Cellar/openssl/1.0.2q: 1,786 files, 12MB, built in 6 minutes 7 seconds
==> Installing nginx
==> Downloading https://nginx.org/download/nginx-1.15.7.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/nginx/1.15.7 --sbin-path=/usr/local/Cellar/nginx/1.15.7/bin/nginx --with-cc-opt=-I/usr/local/opt/pcre/include -I/usr/local/opt/openssl/include --with-ld-opt=-L/usr/lo
==> make install
==> Caveats
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /usr/local/etc/nginx/servers/.
To have launchd start nginx now and restart at login:
brew services start nginx
Or, if you don't want/need a background service you can just run:
nginx
==> Summary
? /usr/local/Cellar/nginx/1.15.7: 8 files, 1.4MB, built in 9 minutes 25 seconds
时间挺长的耐心等待就好。
sudo chown root:wheel /usr/local/Cellar/nginx/1.15.7/bin/nginx
qujingdeMBP:~ qujing$ sudo chmod u+s /usr/local/Cellar/nginx/1.15.7/bin/nginx
然而如图
问题得以解决
qujingdeMacBook-Pro:1.15.7 qujing$ sudo chmod 777 /usr/local/Cellar/nginx/1.15.7/bin/nginx
之后莫名就好了 期间改过环境变量无果 过了几天再次试了下居然解决了
参考了该文章操作sudo niginx command not found 的解决&&解释 https://www.jianshu.com/p/4741c0c82edc
https://blog.csdn.net/pythondafahao/article/details/79826290
https://blog.csdn.net/fuyundage/article/details/79516286
https://blog.csdn.net/maxsky/article/details/53930406
该服务不需要开发使用不需要开机启动控制
sudo nginx #打开 nginx
nginx -s reload|reopen|stop|quit #重新加载配置|重启|停止|退出 nginx
nginx -t #测试配置是否有语法错误
qujingdeMacBook-Pro:bin qujing$ nginx -t
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
// 安装之后,常用的配置路径有:
// 配置文件路径:/usr/local/etc/nginx/nginx.conf
// 服务器默认路径:/usr/local/var/www
localhost:8080 应该是能看到 :Welcome to nginx!
测试nginx 站点是否正确 $ sudo nginx -t
重新加载 nginx 服务 $ sudo nginx -s reload
关闭 nginx 服务 $ sudo nginx -s stop
$ vim /usr/local/etc/nginx/nginx.conf
在server 的 location 配置中添加 index.php
location / {
root html;
index index.html index.htm index.php;
}将被注释的php 部分 取消(将代码前面的‘#’删除)
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}修改上一步范围内的 fastcgi_param 参数
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
参考部分链接https://blog.csdn.net/fg_411/article/details/80055123
安装跟上时代步伐,跟进mysql8。
osx 系统直接官网下载即可安装时最后一步出现选项为了保证兼容性需要作出妥协。
随机密码 daka447Qroot
如果需要添加软连接
sudoln-fs/usr/local/mysql/bin/mysql /usr/local/bin/mysql
[qujing@qujingdeMacBook-Pro:] /usr/local/mysql-8.0.12-macos10.13-x86_64 $ ls
LICENSE README bin data docs include keyring lib man share support-files
[qujing@qujingdeMacBook-Pro:] /usr/local/mysql-8.0.12-macos10.13-x86_64 $ pwd
/usr/local/mysql-8.0.12-macos10.13-x86_64
注意目录改成对应的
以上意思就强制执行-f 软连接-s 是把
我没有进行操作
终端中进行连接
[qujing@qujingdeMacBook-Pro:] ~ $ mysql-uroot-p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.12 MySQL Community Server -GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;'or '\h'forhelp. Type '\c'to clearthe current input statement.
mysql>
连接成功
brew换源教程
https://blog.csdn.net/u010275932/article/details/76080833
php安装脚本
http://coolestguidesontheplanet.com/upgrade-php-on-osx/
[qujing@qujingdeMacBook-Pro:] /usr/local/etc/php/7.2 $ brew cleanup
Warning: Skipping wget: most recent version 1.20 not installed
Warning: Skipping libpng: most recent version 1.6.35 not installed
Warning: Skipping libunistring: most recent version 0.9.10 not installed
Warning: Skipping icu4c: most recent version 63.1 not installed
Warning: Skipping composer: most recent version 1.8.0 not installed
Warning: Skipping glib: most recent version 2.58.1 not installed
Warning: Skipping webp: most recent version 1.0.1 not installed
Warning: Skipping php: most recent version 7.3.0 not installed
Warning: Skipping unixodbc: most recent version 2.3.7 not installed
Warning: Skipping php@5.6: most recent version 5.6.39 not installed
Error: Permission denied @ dir_initialize - /usr/local/opt/nginx
[qujing@qujingdeMacBook-Pro:] /usr/local/etc/php/7.2 $ sudo brew cleanup
Password:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
[qujing@qujingdeMacBook-Pro:] /usr/local/etc/php/7.2 $ brew upgrade php
Updating Homebrew...
==> Upgrading 1 outdated package:
php 7.2.5 -> 7.3.0
==> Upgrading php
==> Installing dependencies for php: brotli, c-ares, jansson, jemalloc, libev, libevent, nghttp2, openldap, curl-openssl, unixodbc, freetds, libpng, glib, icu4c, libpq, readline, sqlite, tidy-html5 and webp
==> Installing php dependency: brotli
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/brotli-1.0.7.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring brotli-1.0.7.mojave.bottle.tar.gz
? /usr/local/Cellar/brotli/1.0.7: 25 files, 2.2MB
==> Installing php dependency: c-ares
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/c-ares-1.15.0.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring c-ares-1.15.0.mojave.bottle.tar.gz
? /usr/local/Cellar/c-ares/1.15.0: 72 files, 482.6KB
==> Installing php dependency: jansson
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/jansson-2.12.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring jansson-2.12.mojave.bottle.tar.gz
? /usr/local/Cellar/jansson/2.12: 11 files, 157.5KB
==> Installing php dependency: jemalloc
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/jemalloc-5.1.0.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring jemalloc-5.1.0.mojave.bottle.tar.gz
? /usr/local/Cellar/jemalloc/5.1.0: 16 files, 1.7MB
==> Installing php dependency: libev
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libev-4.24.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libev-4.24.mojave.bottle.tar.gz
? /usr/local/Cellar/libev/4.24: 12 files, 432.0KB
==> Installing php dependency: libevent
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libevent-2.1.8.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libevent-2.1.8.mojave.bottle.tar.gz
? /usr/local/Cellar/libevent/2.1.8: 846 files, 2.2MB
==> Installing php dependency: nghttp2
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/nghttp2-1.35.1.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring nghttp2-1.35.1.mojave.bottle.tar.gz
? /usr/local/Cellar/nghttp2/1.35.1: 26 files, 2.7MB
==> Installing php dependency: openldap
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/openldap-2.4.46.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openldap-2.4.46.mojave.bottle.tar.gz
==> Caveats
openldap is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have openldap first in your PATH run:
echo 'export PATH="/usr/local/opt/openldap/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/openldap/sbin:$PATH"' >> ~/.bash_profile
For compilers to find openldap you may need to set:
export LDFLAGS="-L/usr/local/opt/openldap/lib"
export CPPFLAGS="-I/usr/local/opt/openldap/include"
==> Summary
? /usr/local/Cellar/openldap/2.4.46: 327 files, 6.5MB
==> Installing php dependency: curl-openssl
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/curl-openssl-7.62.0.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring curl-openssl-7.62.0.mojave.bottle.tar.gz
==> Caveats
curl-openssl is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have curl-openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/curl-openssl/bin:$PATH"' >> ~/.bash_profile
For compilers to find curl-openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/curl-openssl/lib"
export CPPFLAGS="-I/usr/local/opt/curl-openssl/include"
For pkg-config to find curl-openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/curl-openssl/lib/pkgconfig"
==> Summary
? /usr/local/Cellar/curl-openssl/7.62.0: 444 files, 3.3MB
==> Installing php dependency: unixodbc
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/unixodbc-2.3.7.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring unixodbc-2.3.7.mojave.bottle.tar.gz
? /usr/local/Cellar/unixodbc/2.3.7: 46 files, 1.8MB
==> Installing php dependency: freetds
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/freetds-1.00.109.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring freetds-1.00.109.mojave.bottle.tar.gz
? /usr/local/Cellar/freetds/1.00.109: 2,098 files, 12.9MB
==> Installing php dependency: libpng
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libpng-1.6.35.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libpng-1.6.35.mojave.bottle.tar.gz
? /usr/local/Cellar/libpng/1.6.35: 26 files, 1.2MB
==> Installing php dependency: glib
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/glib-2.58.1.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring glib-2.58.1.mojave.bottle.tar.gz
? /usr/local/Cellar/glib/2.58.1: 435 files, 18.4MB
==> Installing php dependency: icu4c
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/icu4c-63.1.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring icu4c-63.1.mojave.bottle.tar.gz
==> Caveats
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).
If you need to have icu4c first in your PATH run:
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile
For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
For pkg-config to find icu4c you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
==> Summary
? /usr/local/Cellar/icu4c/63.1: 254 files, 68.4MB
==> Installing php dependency: libpq
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libpq-11.1.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libpq-11.1.mojave.bottle.tar.gz
==> Caveats
libpq is keg-only, which means it was not symlinked into /usr/local,
because conflicts with postgres formula.
If you need to have libpq first in your PATH run:
echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.bash_profile
For compilers to find libpq you may need to set:
export LDFLAGS="-L/usr/local/opt/libpq/lib"
export CPPFLAGS="-I/usr/local/opt/libpq/include"
For pkg-config to find libpq you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/libpq/lib/pkgconfig"
==> Summary
? /usr/local/Cellar/libpq/11.1: 2,567 files, 27.3MB
==> Installing php dependency: readline
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/readline-7.0.5.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring readline-7.0.5.mojave.bottle.tar.gz
==> Caveats
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
==> Summary
? /usr/local/Cellar/readline/7.0.5: 46 files, 1.5MB
==> Installing php dependency: sqlite
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/sqlite-3.26.0.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring sqlite-3.26.0.mojave.bottle.tar.gz
==> Caveats
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.
If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile
For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
For pkg-config to find sqlite you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"
==> Summary
? /usr/local/Cellar/sqlite/3.26.0: 11 files, 3.7MB
==> Installing php dependency: tidy-html5
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/tidy-html5-5.6.0.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring tidy-html5-5.6.0.mojave.bottle.tar.gz
? /usr/local/Cellar/tidy-html5/5.6.0: 14 files, 2.6MB
==> Installing php dependency: webp
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/webp-1.0.1.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring webp-1.0.1.mojave.bottle.tar.gz
? /usr/local/Cellar/webp/1.0.1: 39 files, 2.1MB
==> Installing php
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/php-7.3.0.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring php-7.3.0.mojave.bottle.tar.gz
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set php_ini /usr/local/etc/php/7.3/php.ini system
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set php_dir /usr/local/share/pear system
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set doc_dir /usr/local/share/pear/doc system
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set ext_dir /usr/local/lib/php/pecl/20180731 system
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set bin_dir /usr/local/opt/php/bin system
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set data_dir /usr/local/share/pear/data system
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set cfg_dir /usr/local/share/pear/cfg system
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set www_dir /usr/local/share/pear/htdocs system
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set man_dir /usr/local/share/man system
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set test_dir /usr/local/share/pear/test system
==> /usr/local/Cellar/php/7.3.0/bin/pear config-set php_bin /usr/local/opt/php/bin/php system
==> /usr/local/Cellar/php/7.3.0/bin/pear update-channels
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html
The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/7.3/
To have launchd start php now and restart at login:
brew services start php
Or, if you don't want/need a background service you can just run:
php-fpm
==> Summary
? /usr/local/Cellar/php/7.3.0: 521 files, 76.5MB
==> Caveats
==> openldap
openldap is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have openldap first in your PATH run:
echo 'export PATH="/usr/local/opt/openldap/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/openldap/sbin:$PATH"' >> ~/.bash_profile
For compilers to find openldap you may need to set:
export LDFLAGS="-L/usr/local/opt/openldap/lib"
export CPPFLAGS="-I/usr/local/opt/openldap/include"
==> curl-openssl
curl-openssl is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have curl-openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/curl-openssl/bin:$PATH"' >> ~/.bash_profile
For compilers to find curl-openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/curl-openssl/lib"
export CPPFLAGS="-I/usr/local/opt/curl-openssl/include"
For pkg-config to find curl-openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/curl-openssl/lib/pkgconfig"
==> icu4c
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).
If you need to have icu4c first in your PATH run:
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile
For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
For pkg-config to find icu4c you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
==> libpq
libpq is keg-only, which means it was not symlinked into /usr/local,
because conflicts with postgres formula.
If you need to have libpq first in your PATH run:
echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.bash_profile
For compilers to find libpq you may need to set:
export LDFLAGS="-L/usr/local/opt/libpq/lib"
export CPPFLAGS="-I/usr/local/opt/libpq/include"
For pkg-config to find libpq you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/libpq/lib/pkgconfig"
==> readline
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
==> sqlite
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.
If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile
For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
For pkg-config to find sqlite you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"
==> php
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html
The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/7.3/
To have launchd start php now and restart at login:
brew services start php
Or, if you don't want/need a background service you can just run:
php-fpm
[qujing@qujingdeMacBook-Pro:] /usr/local/etc/php/7.2 $
启动php
php-fpm -D
host设置
qujingdeMacBook-Pro:nginx qujing$ sudo vim /etc/hosts
qujingdeMacBook-Pro:nginx qujing$