==== 安裝 homebrew ====
OS X 的套件管理工具: http://brew.sh/index_zh-tw.html
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==== apache ====
* 查看 apache 版本
# httpd -v
* 開啟 apache
# sudo apachectl start
(開啟網址 http://localhost 測試,看到 "It Work!" 代表正常)
* 編輯 conf
# sudo vim /etc/apache2/http.conf
* 取消註解這行 Include /private/etc/apache2/extra/httpd-vhosts.conf
# sudo vim /private/etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *>
DocumentRoot "/Library/WebServer/Documents/www_test"
ServerName test
<Directory "/Library/WebServer/Documents/www_test">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
* 修改 hosts
# vim /etc/hosts
加上 127.0.0.1 test
* 建立測試內容
# mkdir /Library/WebServer/Documents/www_test
# echo "Hello World!" > /Library/WebServer/Documents/www_test/index.html
* 重開 apache
# sudo apachectl restart
* 測試
開啟網址 http://test ,看到 "Hello World!" 代表成功了!
!!! [待驗證] 請注意你網頁目錄的權限(從父層到子層,每一層 apache 都要可以存取才行) !!!
==== PHP ====
查看 php 版本
# php -v
開啟 php
# vim /etc/apache2/httpd.conf
取消註解以下這行
LoadModule php5_module libexec/apache2/libphp5.so
# sudo apachectl restart
開啟 rewrite 模組
# sudo vim /etc/apache2/httpd.conf
取消註解 LoadModule rewrite_module libexec/apache2/mod_rewrite.so
建立 php.ini
# sudo cp /etc/php.ini.default /etc/php.ini
# vim /etc/php.ini
==== MariaDB ====
** 請注意,如果你先裝了 mysql ,要再裝 mariaDB 的時候會無法安裝
** 因為他們的服務名稱都是 mysql
** 所以只能先移除 mysql
# brew uninstall mysql
# rm -rf /usr/local/var/mysql (一定要做,不然有可能之後 mariadb 會怪怪的)
先更新 brew
# brew update
安裝 mariaDB
# brew install mariadb
啟動
# mysql.server start
設定密碼
# mysqladmin -u root password '11111'
開啟 mysql
# mysql -u root -p11111
看到 mysql 指令列代表安裝成功!!
==== mysql ====
安裝
# brew install mysql
開啟
# mysql.server start
設定密碼
# mysqladmin -u root password '11111'
開啟 mysql
# mysql -u root -p11111
看到 mysql 指令列代表安裝成功!!
==== phpMyAdmin ====
1. 下載 phpMyAdmin
https://www.phpmyadmin.net/
2. 設定 /etc/hosts 及 apache virtual hosts
3. 複製 phpMyAdmin/config.sample.inc.php --> config.inc.php
4. 把 localhost 改為 127.0.0.1
==== composer github auth.json ====
1. 先登入 github
2. 在 [Settings] -> [Personal access tokens] 建立一個 token ,並複製
3. 執行指令
# composer config --global github-oauth.github.com 你的token
(會自動建立 ~/.composer/auth.json)
==== Laravel ====
# sudo composer global require "laravel/installer=~1.1"
# sudo composer create-project laravel/laravel www_teacher_more --prefer-dist
# sudo chmod -R 755 storage
OS X 的套件管理工具: http://brew.sh/index_zh-tw.html
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==== apache ====
* 查看 apache 版本
# httpd -v
* 開啟 apache
# sudo apachectl start
(開啟網址 http://localhost 測試,看到 "It Work!" 代表正常)
* 編輯 conf
# sudo vim /etc/apache2/http.conf
* 取消註解這行 Include /private/etc/apache2/extra/httpd-vhosts.conf
# sudo vim /private/etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *>
DocumentRoot "/Library/WebServer/Documents/www_test"
ServerName test
<Directory "/Library/WebServer/Documents/www_test">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
* 修改 hosts
# vim /etc/hosts
加上 127.0.0.1 test
* 建立測試內容
# mkdir /Library/WebServer/Documents/www_test
# echo "Hello World!" > /Library/WebServer/Documents/www_test/index.html
* 重開 apache
# sudo apachectl restart
* 測試
開啟網址 http://test ,看到 "Hello World!" 代表成功了!
!!! [待驗證] 請注意你網頁目錄的權限(從父層到子層,每一層 apache 都要可以存取才行) !!!
==== PHP ====
查看 php 版本
# php -v
開啟 php
# vim /etc/apache2/httpd.conf
取消註解以下這行
LoadModule php5_module libexec/apache2/libphp5.so
# sudo apachectl restart
開啟 rewrite 模組
# sudo vim /etc/apache2/httpd.conf
取消註解 LoadModule rewrite_module libexec/apache2/mod_rewrite.so
建立 php.ini
# sudo cp /etc/php.ini.default /etc/php.ini
# vim /etc/php.ini
date.timezone = "Asia/Taipei"
==== MariaDB ====
** 請注意,如果你先裝了 mysql ,要再裝 mariaDB 的時候會無法安裝
** 因為他們的服務名稱都是 mysql
** 所以只能先移除 mysql
# brew uninstall mysql
# rm -rf /usr/local/var/mysql (一定要做,不然有可能之後 mariadb 會怪怪的)
先更新 brew
# brew update
安裝 mariaDB
# brew install mariadb
啟動
# mysql.server start
設定密碼
# mysqladmin -u root password '11111'
開啟 mysql
# mysql -u root -p11111
看到 mysql 指令列代表安裝成功!!
==== mysql ====
安裝
# brew install mysql
開啟
# mysql.server start
設定密碼
# mysqladmin -u root password '11111'
開啟 mysql
# mysql -u root -p11111
看到 mysql 指令列代表安裝成功!!
==== phpMyAdmin ====
1. 下載 phpMyAdmin
https://www.phpmyadmin.net/
2. 設定 /etc/hosts 及 apache virtual hosts
3. 複製 phpMyAdmin/config.sample.inc.php --> config.inc.php
4. 把 localhost 改為 127.0.0.1
==== composer github auth.json ====
1. 先登入 github
2. 在 [Settings] -> [Personal access tokens] 建立一個 token ,並複製
3. 執行指令
# composer config --global github-oauth.github.com 你的token
(會自動建立 ~/.composer/auth.json)
==== Laravel ====
# sudo composer global require "laravel/installer=~1.1"
# sudo composer create-project laravel/laravel www_teacher_more --prefer-dist
# sudo chmod -R 755 storage
文章標籤
全站熱搜
