mac问题小笔记

这篇博客记录了在Mac操作系统中遇到的nginx配置问题及解决方案。首先通过安装gettext库来解决依赖问题,然后对configure文件进行编辑,修改特定行以适应Mac环境。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值