brew
http://brew.sh/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
假设你已安装好了Homebrew,安装与使用极其简单,打开终端,输入:
brew tap phinze/homebrew-cask
brew install brew-cask
然后就可以像brew一样来安装chrome等软件,例如:
brew cask install google-chrome
再也不需要以前的打开网页、找到链接、下载软件、解压包、放到程序目录,再来启动它这么复杂的步骤了。一键完成!
java
brew cask search java
brew cask info java
brew cask install java
mysql
brew install mysql
mysqladmin -u root password 'new-password'
"/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
To have launchd start mysql at login:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
> id int(4) not null primary key auto_increment ,
> name char(20) not null,
> sex int(4) not null default '0',
> degree double(16,2));
netbeans
brew cask install netbeans-php
redis brew install redis
o have launchd start redis at login:
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
Then to load redis now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Or, if you don't want/need launchctl, you can just run:
redis-server /usr/local/etc/redis.conf
php
onfigure: error: Cannot find OpenSSL's <evp.h>
解决 :
ls -l /usr/includesudo find / -name evp.h
udo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include /usr/includeTo enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/opt/php55/libexec/apache2/libphp5.so
The php.ini file can be found in:
/usr/local/etc/php/5.5/php.ini
✩✩✩✩ PEAR ✩✩✩✩
If PEAR complains about permissions, 'fix' the default PEAR permissions and config:
chmod -R ug+w /usr/local/Cellar/php55/5.5.20/lib/php
pear config-set php_ini /usr/local/etc/php/5.5/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"
PHP55 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/php55)/bin:$PATH"
To have launchd start php55 at login:
ln -sfv /usr/local/opt/php55/*.plist ~/Library/LaunchAgents
Then to load php55 now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php55.plist
1.apache
1 #LoadModule php5_module libexec/apache2/libphp5.so 去掉#
2 ServerName localhost:80
3 修改#DocumentRoot "/Library/WebServer/Documents"
4 修改下面 控制访问
Order deny,allow
# Deny from all
Allow from all
5 指定错误日志路径 ErrorLog"/private/var/log/apache2/error_log"
2.php
1 session.save_handler = files
2 session.save_path = "/tmp"
3 session.hash_function = sha512
4 加mysql 相关
pdo_mysql.default_socket=/tmp/mysql.sock
mysql.default_socket =/tmp/mysql.sock
mysqli.default_socket =/tmp/mysql.sock
5 xdebug brew install php55-xdebug
6 date.timezone =Asia/Shanghai
7 redis
//另外方法。。。[xdebug]
zend_extension="/Users/use/xdebug/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.remote_handler=dbgp
brew
http://brew.sh/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
//vim 语法 高亮 显示行号
步骤1:
cp /usr/share/vim/vimrc ~/.vimrc
先复制一份vim配置模板到个人目录下
注:redhat 改成 cp /etc/vimrc ~/.vimrc
步骤2:
vi ~/.vimrc
进入insert模式,在最后加二行
syntax on
set nu!
保存收工。