Homebrew
Online installation
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Copy the code
Domestic online installation
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
Copy the code
A message indicating the end of installation
==> nginx
Docroot is: /opt/homebrew/var/www
The default port has been set in /opt/homebrew/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /opt/homebrew/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
❯
Copy the code
Mysql
search
brew search mysql
Copy the code
The installation
The brew install [email protected]Copy the code
Installation Result Prompt
= > Pouring [email protected]_big_sur.bottle.2.tar. Gz = = > / opt/homebrew/Cellar/[email protected]/5.7.32 / bin/mysqld --initialize-i ==> Caveats 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 -uroot [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 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 have Launchd start [email protected] now and restart at login: Brew Services start [email protected] Or, if you don't want/need a background service you can just run: / opt/homebrew/opt/[email protected] / bin/mysql server start = = > the Summary 🍺 / opt/homebrew/Cellar/[email protected]/5.7.32: 319 files, 233.7 MBCopy the code
Homebrew installing PHP
Brew Search PHP brew install [email protected] To enable PHP in Apache add the following to httpd.conf and restart Apache: LoadModule php7_module/usr/local/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: /usr/local /etc/php.7.3/[email protected] is keg-only, which means it was not symlinked into /usr/local, Because this is an alternate version of another formula. If you need to have [email protected] first in your PATH, run: Echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/. ZSHRC echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/. ZSHRC For compilers to find [email protected] you may need to set: Export LDFLAGS=" -l /usr/local/opt/[email protected]/lib" export CPPFLAGS="-I/usr/local/opt/[email protected]/include" To have launchd start [email protected] now and restart at login: Brew Services start [email protected] Or, if you don't want/need a background service you can just run: Php-fpm ==> Summary 🍺 /usr/local/cellar /[email protected]/7.3.28_1: 521 files, 77.3MB ==> Caveats ==> [email protected] To enable PHP in Apache add the following To httpd.conf and restart Apache: LoadModule php7_module/usr/local/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: /usr/local /etc/php.7.3/[email protected] is keg-only, which means it was not symlinked into /usr/local, Because this is an alternate version of another formula. If you need to have [email protected] first in your PATH, run: Echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/. ZSHRC echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/. ZSHRC For compilers to find [email protected] you may need to set: Export LDFLAGS=" -l /usr/local/opt/[email protected]/lib" export CPPFLAGS="-I/usr/local/opt/[email protected]/include" To have launchd start [email protected] now and restart at login: Brew services start [email protected] Or, if you don't want/need a background service you can just run: php-fpmCopy the code
Homebrew MySQL installation
Brew search mysql brew install [email protected] ll /opt/homebrew/opt/[email protected]/bin echo 'export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"' >> ~/. ZSHRC mysql mysql --version CD [email protected] Switch to sudo su / mysqLD_safe --skip-grant-tables & / mysqLD_safe --skip-grant-tables The following operations are performed on the mysql command-line: show databases; use mysql; Update user set authentication_string=PASSWORD(" custom PASSWORD ") where user='root'; update user set plugin="mysql_native_password"; Mysql_native_password flush PRIVILEGES; quit;Copy the code
Source code installation Redis
mkdir redis && cd redis
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install
sudo ./install_server.sh
Copy the code
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Mmmmm... the default config is missing. Did you switch to the utils directory?
Copy the code
Install Redis using HomeBrew
~/apps/redis ❯ brew install redis
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/redis-6.2.3.big_sur.bottle.tar.gz
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # (100.0%)Pouring redis-6.2.3.big_sur.bottles.tar.gz ==> Caveats To have launchd start redis now and restart at login: brew services start redis Or, if you don't want/need a background service you can just run: Redis server/usr/local/etc/redis. Conf = = > the Summary 🍺 / usr/local/Cellar/redis / 6.2.3:13 files, 2.0 MBCopy the code
Install the Phpredis extension
git clone https://www.github.com/phpredis/phpredis.git cd phpredis phpize && ./configure && make && sudo make install If you have more than one PHP, /configure --with-php-config=/usr/local/php-config --enable-redis-igbinary=no --enable-redis-lzf=no --enable-redis-zstd=no PHP --ini Brew services start [email protected] reload nginx: sudo nginx -s reload restart php-fpmCopy the code
Install nginx
~/apps/redis/phpredis develop ? 3 ❯ brew Install nginx 18:51:53 ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/nginx-1.21.0.big_sur.bottle.tar.gz # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # = = > 100.0% Pouring Nginx-1.21.0.big_sur.bottle.tar. gz ==> 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 = = > the Summary 🍺 / usr/local/Cellar/nginx / 1.21.0:25 files, 2.2 MBCopy the code
Install the Swoole extension
Pecl install swoole Openssl Enable sockets supports? [no] : yes enable openssl support? [no] : yes --with-openssl-dir=/usr/local/opt/[email protected]... .Copy the code
Install the PHlcon extension
https://gitee.com/mirrors/cphalcon/tree/v3.4.4 CD cphalcon/build/installCopy the code
Installing the MQ Extension
pecl install amqp
Copy the code
Install the composer
brew install composer
Copy the code