2009年9月20日 星期日

Apache+PHP on Mac







想在Mac上面裝apache+php簡直比吃飯還容易只要到System preference裡面設定即可
首先,到System Preference裡的Sharing


進去之後,直接將Web Sharing打開就可以了使用Apache,簡單到暴…


打開 http://localhost 就可以看到,而 http://localhost/~yourname 是系統內某位使用者的網頁,如果要放置網頁,只需要放置到自家目錄的 Sites目錄下面就可以了

而php的部份,apache預設是把php disable的,我們需要將php加入 http.conf 這個設定檔

sudo vim /etc/apache2/http.conf


將LoadModule php5......... 這行前面的#拿掉,緊接著

cd /etc
sudo cp php.ini.default php.ini

之後如果對php有任何特殊的需求請到php.ini裡面修改

最後,回到System Prefrence->Sharing,把Web sharing取消再打勾(重啟Apache的動作),你的Apache就有php可以用了

Perfect


如果想加裝Mysql的人…可以參考MAMP

Reference:
http://www.devarticles.com/c/a/Apache/Using-Apache-and-PHP-on-Mac-OS-X/
http://foundationphp.com/tutorials/php_leopard.php

2009年9月17日 星期四

安裝好後卡在「Do you Already own a MAC」

在Aspire one上裝好Mac後,卻進不去,卡在「Do you Already own a MAC」的頁面上,按下一步卻又跳到最前面去,沒完沒了

結果…好像是網卡方面的問題,把以下的步驟作過一遍,跳過這個步驟即可

1) during boot press f8
2) at promt boot write: -s (to enter in single user mode)
3) when all is ready, go to promt root and write this: /sbin/fsck -fy (enter)
4) When is finished you will receive this message:"File system was modified."
5) unmount all
smile.gif write on promt : /sbin/mount -uw / (enter)
6) now set your root password, on prompt wirte: passwd root (enter)
7) now the system will ask you to insert the new password, insert them and then press enter, rewrite and repress enter.
8) Now write on promt: touch /Volumes/NAME!/var/db/.AppleSetupDone (remember DOT before AppleSetupDone) and then press enter
9) on promt write: reboot (enter) (the system will reboot now)
10) Now don't touch nothing during boot, at login page, insert like user: root, like password, them that you have choose.

Reference:
http://www.insanelymac.com/forum/lofiversion/index.php/t69878.html