新入mac 環境

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

mysql> create table MyClass(
> 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/include

sudo find / -name evp.h

udo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include /usr/include

To 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!

保存收工。





發佈了4 篇原創文章 · 獲贊 4 · 訪問量 11萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章