MAC Osx PHP安装指导
php.ini的位置
Mac OS X中没有默认的php.ini文件,但是有对应的模版文件php.ini.default,位于/private/etc/php.ini.default 或者说 /etc/php.ini/default ,可以自行拷贝一份进行修改。
sudo cp /private/etc/php.ini.default /private/etc/php.ini
mac编译apache时出现 checking whether the C compiler works... no 的解决办法
在MAC下编译apache时执行 ./configure 出现如下错误。
checking for gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc
checking whether the C compiler works... no
configure: error: in /Users/hufeiyan/ws/httpd-2.2.26': configure: error: C compiler cannot create executables See
config.log' for more details
查看config.log有如下描述:(config.log文件在apache的文件夹下)
configure:4480: result: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc
configure:4709: checking for C compiler version
configure:4718: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc --version >&5
./configure: line 4720: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc: No such file or directory
configure:4729: $? = 127
configure:4718: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc -v >&5
./configure: line 4720: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc: No such file or directory
configure:4729: $? = 127
configure:4718: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc -V >&5
./configure: line 4720: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc: No such file or directory
configure:4729: $? = 127
configure:4718: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc -qversion >&5
./configure: line 4720: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc: No such file or directory
configure:4729: $? = 127
configure:4749: checking whether the C compiler works
configure:4771: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK conftest.c >&5
./configure: line 4773: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc: No such file or directory
configure:4775: $? = 127
configure:4813: result: no
解决办法:
在命令行执行如下命令:
sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
其中/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/
是固定写法,/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
可以在config.log中找到
如何解决:sorry,i cannot run apxs.possible reasons follow
.在编译安装php5.2的时候出现下面错误:sorry,i cannot run apxs.possible reasons follow:
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
解决方法:根据英文提示我们可以看到如下几点:perl没有安装,指定正确的apxs路径
于是进行如下操作:
yum install perl* 之前是yum install perl
终端输入:find / -name apxs
得到的路径是:/usr/sbin/apxs
于是修改--with-apsx2=/usr/sbin/apxs指定到正确路径
最后正确执行
configure: error: xml2-config not found. Please check your&nb
安装php时的报错
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
安装完之后查找xml2-config文件是否存在
[root@XKWB3403 php-5.3.8]# find / -name "xml2-config"
/usr/bin/xml2-config
重新安装libxml2和libxml2-devel包
brew install libxml2
如果还是报错。就执行下边的命令:
首先进入php的安装文件的目录:
cd /path/php
;
然后使用下边的命令:
./configure --with-libxml-dir=/usr/local/Cellar/libxml2/2.9.3/
没有特殊情况的话,会出现下边的成功提示:
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
Thank you for using PHP.
更新brew
调用brew update
如果出现下边的错误:
Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. For example, upgrading
to OS X El Capitan has been known to do this. Some versions of the
"InstantOn" component of Airfoil or running Cocktail cleanup/optimizations
are known to do this as well.
You should probably change the ownership and permissions of /usr/local
back to your user account.
sudo chown -R $(whoami):admin /usr/local
在终端中运行sudo chown -R $(whoami):admin /usr/local
后,然后运行brew update
.
MAC Osx PHP安装指导的更多相关文章
- mac osx下django-admin.py出现的问题
mac osx 下面用django-admin.py创建项目的时候,没创建成功出现django-admin.py编辑文件,这主要的原因是mac osx下面django-admin.py被重命名为dja ...
- mac osx 上面部署Django项目 apache+mysql+mod_wsgi
1.安装Xcode command line tools 首先,编译mysql和Homebrew需要用到Xcode command line tools,所以首先安装command line tool ...
- Webstorm 10 for mac osx 注册机,序列号,kegen
小菜最近get到mac体验机会,早就耳闻mac非常适合做开发,于是迫不及待的安装各种开发工具,不知不觉,轮到前端开发神器webstorm了,看了一下官网的价格,心拔凉拔凉的. 果断搜索注册机,搜到的结 ...
- Mac OSX网络诊断命令
作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 下面是一些Mac OSX下常用的网络诊断命令.它们能帮助我们发现网络问题.文中提到 ...
- Mac OSX上的软件包管理工具,brew 即 Homebrew
brew 即 Homebrew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件, 只需要一个命令, 非常方便. brew类似ubuntu系统下的apt-get的功能. 安装 ...
- Install Ansible on Mac OSX
from: https://devopsu.com/guides/ansible-mac-osx.html and : https://devopsu.com/guides/ansible-post- ...
- 更新Mac OSX XCode后Git 不能使用提示Can't start Git: /usr/bin/git
更新Mac OSX XCode后Git 不能使用提示Can't start Git: /usr/bin/git 解决办法: 终端运行 sudo xcodebuild -license 同意协议就好了.
- Mac OSX下卸载Nodejs
有时手贱看到新版本就升级,升级后发现一堆模块不能用了,心情好慢慢调,但也有调不好的时候,只能卸载重装低版本的node了. 我的机器环境如下 1. Mac OSX 10.10.3 2. node为0.1 ...
- Installing Hadoop on Mac OSX Yosemite Tutorial Part 1.
Installing Hadoop on Mac OSX Yosemite Tutorial Part 1. September 23, 2014 Marek 68 Comments Install ...
随机推荐
- Windows server 2012 添加中文语言包(英文转为中文)(离线)
Windows server 2012 添加中文语言包(英文转为中文)(离线) 相关资料: 公司环境:亚马孙aws虚拟机 英文版Windows2012 中文SQL Server2012安装包,需要安装 ...
- DDR的前世与今生(一)
作者:一博科技 DDR SDRAM全称为Double Data Rate SDRAM,中文名为"双倍数据率SDRAM".DDR是在原有的SDRAM的基础上改进而来,严格的说DDR应 ...
- JavaScript Array对象
介绍Js的Array 数组对象. 目录 1. 介绍:介绍 Array 数组对象的说明.定义方式以及属性. 2. 实例方法:介绍 Array 对象的实例方法:concat.every.filter.fo ...
- 史上最详细git教程
题外话 虽然这个标题很惊悚,不过还是把你骗进来了,哈哈-各位看官不要着急,耐心往下看 Git是什么 Git是目前世界上最先进的分布式版本控制系统. SVN与Git的最主要的区别 SVN是集中式版本控制 ...
- 学习ASP.NET Core, 怎能不了解请求处理管道[4]: 应用的入口——Startup
一个ASP.NET Core应用被启动之后就具有了针对请求的处理能力,而这个能力是由管道赋予的,所以应用的启动同时意味着管道的成功构建.由于管道是由注册的服务器和若干中间件构成的,所以应用启动过程中一 ...
- Mysql存储引擎比较
Mysql作为一个开源的免费数据库,在平时项目当中会经常使用到,而在项目当中我们的着重点一般在设计使用数据库上而非mysql本身上,所以在提到mysql的存储引擎时,一般都不曾知道,这里经过网上相关文 ...
- JAVA面试题
在这里我将收录我面试过程中遇到的一些好玩的面试题目 第一个面试题:ABC问题,有三个线程,工作的内容分别是打印出"A""B""C",需要做的 ...
- java中的移位运算符:<<,>>,>>>总结
java中有三种移位运算符 << : 左移运算符,num << 1,相当于num乘以2 >> : 右移运算符,num >& ...
- ASP.NET MVC 5 系列 学习笔记 目录 (持续更新...)
前言: 记得当初培训的时候,学习的还是ASP.NET,现在回想一下,图片水印.统计人数.过滤器....HttpHandler是多么的经典! 不过后来接触到了MVC,便立马爱上了它.Model-View ...
- 关于Java中进程和线程的详解
一.进程:是程序的一次动态执行,它对应着从代码加载,执行至执行完毕的一个完整的过程,是一个动态的实体,它有自己的生命 周期.它因创建而产生,因调度而运行,因等待资源或事件而被处于等待状态,因完成任务而 ...