Configure Error: Please specify the install prefix of iconv with --with-iconv=<DIR> 解决: ./configure --without-iconv
View Details打开终端 重启apache:sudo /usr/sbin/apachectl restart 关闭apache:sudo /usr/sbin/apachectl stop 开启apache:sudo /usr/sbin/apachectl start from:http://blog.csdn.net/nightelve/article/details/7935795
View DetailsApache和PHP已经在系统里面预装好了,只要你开启即可使用。这篇文章给大家介绍如何开启并设置好PHP开发环境。 1.开启默认Apache服务 打开终端命令行,输入如下命令就会开启Apache了.然后输入top命令查看进程是否含有http。
1 |
sudo apachectl start |
2.修改Apache配置文件 在Finder右键点击“前往文件夹”后输入“/etc/apache2/ ”然后打开httpd.conf。我们要修改开启PHP组件和虚拟目录。 去掉在168、169行的#号
1 2 |
LoadModule rewrite_module libexec/apache2/mod_rewrite.so LoadModule php5_module libexec/apache2/libphp5.so |
211行前面加上#号
1 |
#Require all denied |
修改默认目录
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
DocumentRoot "/Users/wise/site/default" <Directory "/Users/wise/site/default"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options FollowSymLinks Multiviews MultiviewsMatch Any # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted </Directory> |
虚拟目录,修改文件/etc/apache2/extra/httpd-vhosts.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
#默认目录 <VirtualHost *:80> DocumentRoot "/Users/wise/site/default" ServerName default </VirtualHost> #工具 <VirtualHost *:80> DocumentRoot "/Users/wise/site/db" ServerName db </VirtualHost> #个人项目 <VirtualHost *:80> DocumentRoot "/Users/wise/site/jinzhe" ServerName jinzhe <Directory "/Users/wise/site/jinzhe"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/wise/site/yckit" ServerName yckit <Directory "/Users/wise/site/yckit"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/wise/site/dmku" ServerName dmku <Directory "/Users/wise/site/dmku"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> #私人项目 <VirtualHost *:80> DocumentRoot "/Users/wise/site/sms" ServerName sms </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/wise/site/icrobot" ServerName icrobot <Directory "/Users/wise/site/icrobot"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/wise/site/lbdlq" ServerName lbdlq <Directory "/Users/wise/site/lbdlq"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/wise/site/baidu" ServerName baidu <Directory "/Users/wise/site/baidut"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> #公司项目 <VirtualHost *:80> DocumentRoot "/Users/wise/site/fishernuts" ServerName fishernuts <Directory "/Users/wise/site/fishernuts"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> |
3.修改HOSTS文件 在Finder右键点击“前往文件夹”后输入“/etc ”然后打开hosts。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#工具 127.0.0.1 db #个人项目 127.0.0.1 jinzhe 127.0.0.1 dmku 127.0.0.1 yckit 127.0.0.1 yckit.api #私单项目 127.0.0.1 sms 127.0.0.1 icrobot 127.0.0.1 lbdlq 127.0.0.1 baidu 127.0.0.1 jcm #公司项目 127.0.0.1 fishernuts |
4.安装MYSQL 到官网下载:http://dev.mysql.com/downloads/mysql/ 选DMG格式的就好了。他会帮你一键安装好。 复制出一份。php.ini
1 |
cp /etc/php.ini.default /etc/php.ini |
创建mysql socket(不设置这个无法连接phpmyadmin)
1 2 |
sudo mkdir /var/mysql sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock |
然后修改php.ini中的内容(原因是连接时候php默认去找/var/mysql/mysql.sock了,但是MAC版本的MYSQL改动了文件的位置,放在/tmp下了。)
1 |
mysql.default_socket = /tmp/mysql.sock |
设置别名和密码
1 2 3 |
alias mysql='/usr/local/mysql/bin/mysql' alias mysqladmin='/usr/local/mysql/bin/mysqladmin' mysqladmin -u root password "123456" |
from:http://jinzhe.net/post/32.html
View Details1. 安装PCRE Download latest PCRE. After download go to download directory from terminal. $ cd ~/Download $ tar xvzf pcre-8.12.tar.gz $ cd pcre-8.12 $ sudo ./configure --prefix=/usr/local $ sudo make $ sudo install 2. 安装Nginx Download latest nginx from Nginx.org. After download, let install $ cd ~/Download $ tar xvzf nginx-1.0.0.tar.gz $ cd nginx-1.0.0 $ sudo ./configure --prefix=/usr/local --with-http_ssl_module --with-ld-opt="-L /usr/local/lib" $ sudo make $ sudo make install 3. 运行Nginx $ cd /usr/local/sbin $ sudo ./nginx 访问http://localhost 4. 关闭Nginx $ cd /usr/local/sbin $ sudo […]
View Details就像其他Unix系统一样,Mac OS X的根目录也是/,Finder中的根目录就是硬盘目录,也就是Macintosh HD。新版本的OS X系统开始隐藏根目录,因为大多数用户不需要访问。下面为大家介绍四种快速访问根目录的方法。 1:通过“前往文件夹”快捷键组合 “前往文件夹”可能是OS X系统Finder中最常用的操作了,用户只需点击左上角的“前往”菜单,然后选择“前往文件夹…”功能。使用快捷键+Shift+G也可以快速激活“前往文件夹”功能,窗口打开后,输入“/”并回车即可。 2:将Macintosh HD快捷方式放入Finder侧边栏 对于经常要访问根目录的用户来说,将Macintosh HD快捷方式会更高效一些。在任何文件夹内(除了“我的所有文件”)右键点击标题栏,然后选择Macintosh HD。最后将Macintosh HD左侧的硬盘图标拖拽至侧边栏即可完成操作。以后需要访问根目录时,只需点击侧边栏的快捷方式即可。 3:在桌面上显示硬盘 打开Finder的“偏好设置”,在“通用”模式下在“硬盘”前面的方块内勾选即可。这样桌面上就会有Macintosh HD,双击即可访问。 4:使用命令行迅速导航 打开终端应用,然后输入下面的命令即可迅速导航至根目录。 cd / 复制代码 上面的命令是在终端中访问根目录,如果你想通过终端打开Finder的根目录,只需下面的命令即可: open / 复制代码 from:http://www.macx.cn/thread-2080254-1-1.html
View Details1. 验证/修复磁盘权限 在 应用程序/实用程序/磁盘工具.app 选择你的系统所在宗卷进行验证,如果有问题则修复(其实也可以直接点“验证并修复磁盘权限”反正修复之前必会先验证的)。 注意非系统宗卷默认是忽略权限的,自然没有验证和修复的说法。 2. 清除不需要的登录项目(就是登录的时候自动运行的程序) 系统预置 – 帐户 – 登录项目,自己看着办,把不需要登录项目减掉。 注意有一些程序即使去掉后还会自动再添加的,比如 Adobe Acrobat 的 AdobeResourceSynchronizer 等。 3. 清除不需要的应用程序 没什么好说的,一些不再用的应用程序可以删掉了,即占空间又碍眼。 4. 清除不需要的预置面板 在系统预置下面的列表中是一些第三方应用程序添加的面板,需要的可以删掉。直接点右键去掉,或者在“~/Library/PreferencePanes”里删除不需要的,可能需要重新启动或者强制清倒废纸篓。 5. 清理桌面 已经有相当多的用户报告说一个干净的桌面可以提升系统运行速度。 别把乱七八糟的东西留在桌面上,找个文件夹收拾起来,或者干脆删除了。 6. 清倒废纸篓 清倒废纸篓可以节省磁盘空间哦~~废话。 7. 如果不需要,就关掉万能辅助 很明显,开着万能辅助肯定会占用内存和处理器时间,关掉用不到的万能辅助选项吧,在系统预置-万能辅助里 8. 如果不需要,关掉蓝牙 开着蓝牙,即费内存又费电,不用的时候关掉吧。用无线MM鼠的用户请忽略。 9. 关掉语音识别 说实话,非英语用户其实开着也是浪费内存和处理器时间。 10. 关闭 Internet 共享 系统预置-共享-Internet,现在用路由器的多, Internet 共享不用就关掉吧。 11. 为启动宗卷(就是系统所在宗卷)预留足够个空闲空间 虚拟内存要用的,所以尽量保证启动宗卷上有10%的空闲空间。 12. 移除不需要的语言包 Monolingual 是个免费的移除语言包的好工具。一些你根本看不懂的语言包去掉就去掉吧,还能省空间。 注意:移除语言包是不可恢复的操作,如果出现问题,必须重装软件才能恢复。请小心决定。 13. 移除改变桌面效果的程序 最近我(指原文作者)发现一个不错的程序可以在每个月在我的桌面上放一个不同小孩,看起来很不错,但一次我在活动监视器里发现这个程序占用了大量了内存和处理器时间。 14. 清理 Dock 上不许要的应用程序 在 Dock 上只需要保留经常使用的应用程序就够了。 15. 为文件关联合适的应用程序 比如图片,如果没有特别要求,最好关联在“预览.app”上,关联在“Photoshop.app”会给每次连按图片文件造成很大的不便。 16. 检查应用程序的架构 如果你使用 Intel-based Mac ,那么用 Universal Binary 版的应用程序将比通过 Rosetta 运行 PowerPC 架构要快。 17. 关掉 Dock 的特效 18. 关掉桌面背景动画 […]
View Details