您的位置:首页 > 运维架构 > Nginx

mac问题小笔记

2016-03-31 19:14 549 查看
You have not agreed to the Xcode license agreements的解决方案
最近使用Jenkins做iOS项目的CI时,遇到了下面的问题:

You have not agreed to the Xcode license agreements, please run xcodebuild standalone from within a Terminal window to review and agree to the Xcode license agreements.

但是按照提示在Terminal中去运行xcodebuild又没有任何问题,用xcodebuild –help发现有一个option是-license。

输入xcodebuild -license会展示一大段的license,空格键是查看更多,耐心看完之后,根据最后的提示,输入agree。注意保证agree前面没有空格,有可能空格键按得太快会打几个空格出来的。

mac查看端口占用:
sudo lsof -i -P | grep -i "listen"

Mac端口:
mac os x不允许root以外的用户使用1024以下的端口

Mac开机自动启动php-fpm
使用brew安装的php-fpm自动启动,我先是把homebrew.mxcl.php55.plist放在/Users/tangcheng/Library/LaunchAgents,但是怎么都加载不进去,查看这个plist有一个选项
  <key>UserName</key>
  <string>root</string>
我上网查,说这个选项必须是在以root启动的时候才有用,我就把homebrew.mxcl.php55.plist放到了/Library/LaunchAgents里面,还tm不行,最后放到了/Library/LaunchDaemons里面,这个文件夹里面的所有都是以root权限启动的『守护进程』,重启电脑,php-fpm就启动了

Mac下将sublime命令行启动(其他软件类似)
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime

brew php的安装
ALL_PROXY=socks5://127.0.0.1:1080 brew install autojump

To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php5_module    /usr/local/opt/php56/libexec/apache2/libphp5.so

The php.ini file can be found in:
    /usr/local/etc/php/5.6/php.ini

✩✩✩✩ Extensions ✩✩✩✩

If you are having issues with custom extension compiling, ensure that
you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:

      PATH="/usr/local/bin:$PATH"

PHP56 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.

✩✩✩✩ PHP CLI ✩✩✩✩

If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc,
~/.zshrc, ~/.profile or your shell's equivalent configuration file:

      export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"

✩✩✩✩ FPM ✩✩✩✩

To launch php-fpm on startup:
    mkdir -p ~/Library/LaunchAgents
    cp /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist

The control script is located at /usr/local/opt/php56/sbin/php56-fpm

OS X 10.8 and newer come with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH:

  PATH="/usr/local/sbin:$PATH"

You may also need to edit the plist to use the correct "UserName".

Please note that the plist was called 'homebrew-php.josegonzalez.php56.plist' in old versions
of this formula.

To have launchd start josegonzalez/php/php56 at login:
  ln -sfv /usr/local/opt/php56/*.plist ~/Library/LaunchAgents
Then to load josegonzalez/php/php56 now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
==> Summary
��  /usr/local/Cellar/php56/5.6.16: 330 files, 48.9M, built in 5 minutes 35 seconds

mac上编译php7问题:

MAC OS 上编译 PHP 时,在 configure 配置阶段出现如题所示错误。找不到 libintl.h 头文件。
解决方法如下:
1. 安装 gettext:

1brew install gettext
2. 编辑 configure 文件:
将:

1for i in $PHP_GETTEXT /usr/local /usr; do
更改为:

1for i in $PHP_GETTEXT /usr/local /usr /usr/local/opt/gettext ;do
3. 重新运行 ./configure 即可

安装mac系统出现:
 这个“安装 OS X Mavericks.app”应用程序副本不能验证。它在下载过程中可能已遭破坏或篡..
执行
date 062614102014.30
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  nginx mac