wx,dd,qq,vscode,weiyun,clash,vee,sublime,ipmsg,git,utools
sequel ace在APP STORE上安装。
设置curl代理
export https_proxy=”127.0.0.1:7890″
export http_proxy=”127.0.0.1:7890″
git config –global https.proxy ‘http://127.0.0.1:7890’
安装omyzsh
https://ohmyz.sh/#install
安装xbar
https://github.com/matryer/xbar/releases
安装brew
https://brew.sh
brew install wget telnet nginx
/opt/homebrew/etc/nginx/nginx.conf
nginx will load all files in /opt/homebrew/etc/nginx/servers/
To 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:
/opt/homebrew/opt/nginx/bin/nginx -g daemon\ off\;
http://localhost:8080
brew tap shivammathur/php
brew install [email protected] [email protected] [email protected] [email protected]
The php.ini and php-fpm.ini file can be found in:
/opt/homebrew/etc/php/5.6/
[email protected] is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.
If you need to have [email protected] first in your PATH, run:
echo ‘export PATH=”/opt/homebrew/opt/[email protected]/bin:$PATH”‘ >> ~/.zshrc
echo ‘export PATH=”/opt/homebrew/opt/[email protected]/sbin:$PATH”‘ >> ~/.zshrc
For compilers to find [email protected] you may need to set:
export LDFLAGS=”-L/opt/homebrew/opt/[email protected]/lib”
export CPPFLAGS=”-I/opt/homebrew/opt/[email protected]/include”
To start shivammathur/php/[email protected] now and restart at login:
brew services start shivammathur/php/[email protected]
Or, if you don’t want/need a background service you can just run:
/opt/homebrew/opt/[email protected]/sbin/php-fpm –nodaemonize
brew install zlib
wget https://pecl.php.net/get/memcache-2.2.7.tgz
tar zxvf memcache-2.2.7.tgz
cd memcache-2.2.7
/opt/homebrew/opt/[email protected]/bin/phpize
./configure -with-zlib-dir=/opt/homebrew/opt/zlib/ -with-php-config=/opt/homebrew/opt/[email protected]/bin/php-config
make
make install
/opt/homebrew/opt/[email protected]/bin/pecl install https://pecl.php.net/get/redis-4.3.0.tgz
/opt/homebrew/opt/[email protected]/bin/pecl install https://pecl.php.net/get/redis-5.3.7.tgz
/opt/homebrew/opt/[email protected]/bin/pecl install https://pecl.php.net/get/redis-5.3.7.tgz
/opt/homebrew/opt/[email protected]/bin/pecl install https://pecl.php.net/get/redis-6.1.0RC1.tgz
8.4只支持这个rc版的redis
/opt/homebrew/opt/[email protected]/bin/pecl install https://pecl.php.net/get/xdebug-2.5.4.tgz
vim /opt/homebrew/etc/php/5.6/php.ini
[XDebug]
zend_extension=”xdebug.so”
xdebug.mode=debug
xdebug.log_level=0
xdebug.remote_enable=on
xdebug.remote_autostart=on
xdebug.remote_host=”127.0.0.1″
xdebug.remote_port=”9156″
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php7_module /opt/homebrew/opt/[email protected]/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:
/opt/homebrew/etc/php/7.4/
[email protected] is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.
If you need to have [email protected] first in your PATH, run:
echo ‘export PATH=”/opt/homebrew/opt/[email protected]/bin:$PATH”‘ >> ~/.zshrc
echo ‘export PATH=”/opt/homebrew/opt/[email protected]/sbin:$PATH”‘ >> ~/.zshrc
For compilers to find [email protected] you may need to set:
export LDFLAGS=”-L/opt/homebrew/opt/[email protected]/lib”
export CPPFLAGS=”-I/opt/homebrew/opt/[email protected]/include”
To start shivammathur/php/[email protected] now and restart at login:
brew services start shivammathur/php/[email protected]
Or, if you don’t want/need a background service you can just run:
/opt/homebrew/opt/[email protected]/sbin/php-fpm –nodaemonize
/opt/homebrew/opt/[email protected]/bin/pecl install https://pecl.php.net/get/redis-5.3.7.tgz
/opt/homebrew/opt/[email protected]/bin/pecl install https://pecl.php.net/get/xdebug-3.1.5.tgz
vim /opt/homebrew/etc/php/7.4/php.ini
[XDebug]
zend_extension=”xdebug.so”
xdebug.mode=debug
xdebug.log_level=0
xdebug.start_with_request=yes
xdebug.client_host=”127.0.0.1″
xdebug.client_port=”9174″
xdebug.remote_handler=dbgp
在m系列上安装swoole
可能会出现:include/php/ext/pcre/php_pcre.h:25:10: fatal error: ‘pcre2.h’ file not found
brew install pcre2
ln -s /opt/homebrew/include/pcre2.h /opt/homebrew/Cellar/[email protected]/7.4.33_6/include/php/ext/pcre2.h
上面的路径看情况调整
/opt/homebrew/opt/[email protected]/bin/pecl install https://pecl.php.net/get/swoole-4.6.1.tgz
上面的安装可能会出错,特别是在apple芯片上,在这里看他们的更新日志,和去git看issue,选择一个支持的版本。
https://pecl.php.net/package-changelog.php?package=swoole
如果要支持openssl的话,需要用源码安装执行下面的配置:
./configure –enable-openssl –with-openssl-dir=/opt/homebrew/Cellar/openssl@3/3.3.1 –with-php-config=/opt/homebrew/opt/[email protected]/bin/php-config
wget https://github.com/swoole/ext-postgresql/archive/refs/tags/v4.6.1.zip
unzip v4.6.1.zip
wget https://pecl.php.net/get/swoole-4.6.1.tgz
tar -zxvf swoole-4.6.1.tgz
cd ext-postgresql
编译时,需要用到swoole的源码,且路径有些怪,报下面的错:
./swoole_postgresql_coro.h:20:10: fatal error: ‘ext/swoole/ext-src/php_swoole_cxx.h’ file not found
#include “ext/swoole/ext-src/php_swoole_cxx.h”
需要建立一个软链接,
mkdir -p ext/swoole
ln -s /Users/liyan/software/swoole-4.6.1/ext-src ext/swoole/
export PATH=”/opt/homebrew/opt/libpq/bin:$PATH”
export LDFLAGS=”-L/opt/homebrew/opt/libpq/lib”
export CPPFLAGS=”-I/opt/homebrew/opt/libpq/include”
export PKG_CONFIG_PATH=”/opt/homebrew/opt/libpq/lib/pkgconfig”
;source ~/.zshrc
/opt/homebrew/opt/[email protected]/bin/phpize
./configure –with-php-config=/opt/homebrew/opt/[email protected]/bin/php-config
vim Makefile
在include那里,把/Users/liyan/software/swoole-4.6.1/include加上,如果还有差的,也加上。
make
make install
vim /opt/homebrew/etc/php/7.3/php.ini
extension=”swoole_postgresql.so”
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /opt/homebrew/opt/[email protected]/lib/httpd/modules/libphp.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:
/opt/homebrew/etc/php/8.4/
[email protected] is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.
If you need to have [email protected] first in your PATH, run:
echo ‘export PATH=”/opt/homebrew/opt/[email protected]/bin:$PATH”‘ >> ~/.zshrc
echo ‘export PATH=”/opt/homebrew/opt/[email protected]/sbin:$PATH”‘ >> ~/.zshrc
For compilers to find [email protected] you may need to set:
export LDFLAGS=”-L/opt/homebrew/opt/[email protected]/lib”
export CPPFLAGS=”-I/opt/homebrew/opt/[email protected]/include”
To start shivammathur/php/[email protected] now and restart at login:
brew services start shivammathur/php/[email protected]
Or, if you don’t want/need a background service you can just run:
/opt/homebrew/opt/[email protected]/sbin/php-fpm –nodaemonize
/opt/homebrew/opt/[email protected]/bin/pecl install https://pecl.php.net/get/redis-6.1.0RC1.tgz
/opt/homebrew/opt/[email protected]/bin/pecl install https://pecl.php.net/get/xdebug-3.3.2.tgz
vim /opt/homebrew/etc/php/8.4/php.ini
[XDebug]
zend_extension=”xdebug.so”
xdebug.mode=debug
xdebug.log_level=0
xdebug.start_with_request=yes
xdebug.client_host=”127.0.0.1″
xdebug.client_port=”9184″
xdebug.remote_handler=dbgp
安装mysql
Upgrading from MySQL <8.4 to MySQL >9.0 requires running MySQL 8.4 first:
– brew services stop mysql
– brew install [email protected]
– brew services start [email protected]
– brew services stop [email protected]
– brew services start mysql
We’ve installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -u root
To start mysql now and restart at login:
brew services start mysql
Or, if you don’t want/need a background service you can just run:
/opt/homebrew/opt/mysql/bin/mysqld_safe –datadir\=/opt/homebrew/var/mysql
==> Summary
🍺 /opt/homebrew/Cellar/mysql/9.0.1: 324 files, 310.3MB
==> Caveats
==> mysql
Upgrading from MySQL <8.4 to MySQL >9.0 requires running MySQL 8.4 first:
– brew services stop mysql
– brew install [email protected]
– brew services start [email protected]
– brew services stop [email protected]
– brew services start mysql
We’ve installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -u root
To start mysql now and restart at login:
brew services start mysql
Or, if you don’t want/need a background service you can just run:
/opt/homebrew/opt/mysql/bin/mysqld_safe –datadir\=/opt/homebrew/var/mysql
brew install redis
brew services start redis
brew install node
npm config set https-proxy=’http://127.0.0.1:7890’
npm install n -g
具体可以参考:https://www.npmjs.com/package/n
按上面来操作,因为有权限啥的。
用n安装完版本后,要把用brew install安装的node卸载掉,不然用n切不过去。
brew uninstall node
brew install nvm
mkdir ~/.nvm
根据提示加在.zsh文件里
nvm ls
nvm ls-remote
nvm install v14.21.3
nvm use v14.21.3
#alias python3=”/usr/local/bin/python3″
alias python3=”/usr/local/opt/[email protected]/bin/python3.9″
alias pip3=”/usr/local/opt/[email protected]/bin/pip3″
# 关闭brew自动更新
export HOMEBREW_NO_AUTO_UPDATE=true
# 关闭brew自动删除没使用的包
export HOMEBREW_NO_INSTALL_CLEANUP=1
alias php56=”/opt/homebrew/opt/[email protected]/bin/php”
alias php73=”/opt/homebrew/opt/[email protected]/bin/php”
alias php74=”/opt/homebrew/opt/[email protected]/bin/php”
alias php84=”/opt/homebrew/opt/[email protected]/bin/php”
alias php56-restart=”brew services restart [email protected]″
alias php56-stop=”brew services stop [email protected]″
alias php56-start=”brew services start [email protected]″
alias php74-restart=”brew services restart [email protected]″
alias php74-stop=”brew services stop [email protected]″
alias php74-start=”brew services start [email protected]″
alias php84-restart=”brew services restart [email protected]″
alias php84-stop=”brew services stop [email protected]″
alias php84-start=”brew services start [email protected]″
alias redis-restart=”brew services restart redis”
alias redis-stop=”brew services stop redis”
alias redis-start=”brew services start redis”
alias mysql-restart=”brew services restart mysql”
alias mysql-stop=”brew services stop mysql”
alias mysql-start=”brew services start mysql”
export PATH=“/Users/liyan/script/:$PATH“
开启vim的语法:
vim ~/.vimrc
syntax on
mac系统较新,不支持一些rsa算法,导致在从一些git上拉代码时出现:
sign_and_send_pubkey: no mutual signature supported
需要加上:vim ~/.ssh/config
PubkeyAcceptedKeyTypes +ssh-rsa