Install Port
</>复制代码
https://guide.macports.org/
Path
You can also add the following line to your ~/.bash_profile:
</>复制代码
export PATH=/opt/local/bin:$PATH // use the port command first , don"t use system command
then
</>复制代码
source ~/.bash_profile
This will add /opt/local/bin to the executable path and make your port command available to the shell.
</>复制代码
port version
Version 2.3.3
PS:
If you are use in zsh , just edit ~/.zshrc like these
Install PHP</>复制代码
sudo port install php56 php56-fpm php56-mysql
PHP Configuration file setup
Set up your PHP configuration files. For development purposes use:
</>复制代码
$ cd /opt/local/etc/php56
$ sudo cp php.ini-development php.ini
or for a production server:
</>复制代码
$ cd /opt/local/etc/php56
$ sudo cp php.ini-production php.ini
php-fpm do the same thing
Select PHP version</>复制代码
$ sudo port select php php56
$ php -v
Nginx
</>复制代码
$ sudo port install nginx
cd /opt/local/etc/nginx , edit nginx.conf :
</>复制代码
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /Users/Lluvio/www;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /Users/Lluvio/www;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ .php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ .php$ {
root /Users/Lluvio/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /Users/Lluvio/www$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache"s document root
# concurs with nginx"s one
#
#location ~ /.ht {
# deny all;
#}
}
Then
</>复制代码
$ sudo port load nginx
Now , we can open url http://localhost to see the welcome page~
Mysql</>复制代码
$ sudo port load mysql56-server
$ sudo port select mysql mysql56
$ sudo -u _mysql /opt/local/lib/mysql56/bin/mysql_install_db // init mysql
$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.6.25 Source distribution
Copyright (c) 2000, 2015, 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" for help. Type "c" to clear the current input statement.
If you have another problem , click here
</>复制代码
Doc: https://trac.macports.org/wiki/howto/MySQL
End
In the end , we could do port installed to see what we are installed,may something we will be lost
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/21091.html
Install Port https://guide.macports.org/ Path You can also add the following line to your ~/.bash_profile: export PATH=/opt/local/bin:$PATH // use the port command first , dont use system command then...
摘要:闲话少叙,直接开始安装依赖复制以下内容,回车直接安装编译,,所需的依赖创建用户和组注意此处的组创建和用户创建在后面编译安装中需要,当然可以根据个人习惯自己命名想要的组名和用户名编译安装根据个人习惯去 闲话少叙,直接开始 yum安装依赖 复制以下内容,回车直接安装编译php,nginx,mysql所需的依赖 shyum install -y kenel-devel gcc gcc...
摘要:闲话少叙,直接开始安装依赖复制以下内容,回车直接安装编译,,所需的依赖创建用户和组注意此处的组创建和用户创建在后面编译安装中需要,当然可以根据个人习惯自己命名想要的组名和用户名编译安装根据个人习惯去 闲话少叙,直接开始 yum安装依赖 复制以下内容,回车直接安装编译php,nginx,mysql所需的依赖 shyum install -y kenel-devel gcc gcc...
阅读 2056·2021-11-22 14:45
阅读 2734·2021-10-12 10:11
阅读 841·2021-09-22 10:02
阅读 1392·2019-08-30 15:55
阅读 1225·2019-08-30 15:54
阅读 3339·2019-08-30 15:54
阅读 1321·2019-08-29 17:16
阅读 3182·2019-08-28 17:55