mac nginx+php+mysql 配置
程序员文章站
2022-04-08 15:34:16
...
mac nginx 配置
1,brew 安装
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.pcre 安装(nginx rewrite 依赖该库)
cd ~/Download
tar xvzf pcre-8.33.tar.gz
cd pcre-8.12
sudo ./configure --prefix=/usr/local
sudo make
sudo make install
3.nginx 安装
tar -zvxf nginx-1.5.2.tar.gz
cd nginx-1.5.2
./configure --with-cc-opt="-Wno-deprecated-declarations"
make
make install
开机启动 nginx
Label
nginx
Program
/usr/local/nginx/sbin/nginx
KeepAlive
launchctl load -w /Library/LaunchDaemons/org.macports.nginx.plist
4,mysql 安装
brew mysql
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
5,php 安装
tar -zvxf php-5.5.19.tar.gz
cd php-5.5.19
./configure --prefix=/usr/local/php --with-mysql=/usr/local/opt/mysql/ --enable-pdo --with-pdo-mysql=/usr/local/opt/mysql --with-curl --enable-fpm --with-openssl
make
make install
cp php.ini-production /usr/local/php/etc/php.ini
vim /usr/local/php/etc/php.ini
date.timezone =PRC
开机启动php
在 /Library/LaunchDaemons/ 目录新建 org.php.php-fpm.plist 文件:
Label
php-fpm
Program
/User/wyt/module/php/sbin/php-fpm
KeepAlive
launchctl load -w /Library/LaunchDaemons/org.php.php-fpm.plist
1,brew 安装
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.pcre 安装(nginx rewrite 依赖该库)
cd ~/Download
tar xvzf pcre-8.33.tar.gz
cd pcre-8.12
sudo ./configure --prefix=/usr/local
sudo make
sudo make install
3.nginx 安装
tar -zvxf nginx-1.5.2.tar.gz
cd nginx-1.5.2
./configure --with-cc-opt="-Wno-deprecated-declarations"
make
make install
开机启动 nginx
launchctl load -w /Library/LaunchDaemons/org.macports.nginx.plist
4,mysql 安装
brew mysql
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
5,php 安装
tar -zvxf php-5.5.19.tar.gz
cd php-5.5.19
./configure --prefix=/usr/local/php --with-mysql=/usr/local/opt/mysql/ --enable-pdo --with-pdo-mysql=/usr/local/opt/mysql --with-curl --enable-fpm --with-openssl
make
make install
cp php.ini-production /usr/local/php/etc/php.ini
vim /usr/local/php/etc/php.ini
date.timezone =PRC
开机启动php
在 /Library/LaunchDaemons/ 目录新建 org.php.php-fpm.plist 文件:
launchctl load -w /Library/LaunchDaemons/org.php.php-fpm.plist
以上就介绍了mac nginx+php+mysql 配置,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。