個人心情和 Linux / FreeBSD 等技術

2009/01/20

Fedora 9下tarball安裝PHP(with mysql)

OS: Fedora 9

PHP版本:5.2.6

1.安裝相關的相依性套件

# yum -y install mysqlclient14 mysqlclient14-devel freeradius-mysql

mysql-server mysql-devel pcre-devel libc-client-devel cyrus-imapd-devel

gd-devel openldap-devel freetype-devel

##備註:安裝過程有缺檔案快速查詢方式,到別台已經裝好的電腦上利用 locate 找出

該檔案絕對路徑和使用 rpm -qf 做反查套件。


2.把 php 解壓縮到 root 家目錄

# tar -jxvf php-5.2.6.tar.bz2 -C /root/

3.編譯前先啟動 mysql,並在 runlevel 3 和 5 自動啟用

# service mysqld start && chkconfig --level 35 mysqld on

4. 開始配置 php

# cd php-5.2.6

# ./configure --prefix=/usr/local/php5 --with-mysql --with-apxs2

=/usr/local/apache2/bin/apxs ( 這裡由於apahce2也是自己編譯的,使用

系統預設 apache 的人要注意路徑 ) --with-regex=php --enable-shared

--with-gd=/usr --enable-gd-native-ttf -with-zlib --with-freetype-dir=/usr

--with-ldap=/usr

5. 編譯並安裝

# make && make install

6. 檢查自己的 apache modules 資料夾下有無 libphp5.so 並檢查 httpd.conf

是否已經載入模組。 沒有的自行加入下一行

LoadModule php5_module modules/libphp5.so

要注意 modules資料夾位置 , 寫法是相對於 ServerRoot 的位置 ,

我的 apache ServerRoot 是在 /usr/local/apache2, 實際上 libphp5.so

絕對位置在 /usr/local/apache2/modules/libphp5.so )

如有修改 httpd.conf 的話要做 apachectl restart

(使用rpm安裝的 apache 可用 service httpd restart )

##備註:我測試 2.2.9 和 2.2.11 版的 apachectl 工具上偶而會出現

restart 無效的情況,可嘗試 apachectl stop 後再 apachectl start

7. 設定 mysql 資料庫

# mysqladmin -u root password '123456' //設定root密碼123456

# mysqladamin -u -h localhost password '123456' -p

# mysql -p

8. 拷貝php.ini 到 /usr/local/php5下 ,並確認 register_globals 關閉

# cd /root/php-5.2.6/ ; cp php.ini-dist /usr/local/php5/lib/php.ini

# vi /usr/local/php5/lib/php.ini

register_globals=off

9. 到 apache 的 DocumentRoot 資料夾下建立一個 test.php

測試頁面,內容如下

<?php
phpinfo();
?>

10. 瀏覽器測試

http://打入你的ip/test.php

成功的話就會看到 php 的頁面

2008/12/20

今天上課的心得

今天快下課前老師做了一件事情,把 Grub boot loader 在 MBR 的

前 446 bytes 給毀損(當然事前有備份),來做急救和修復的動作

結果是 MBR 的最後末 2 bytes check code檢查完後應該要丟給

Stage1 boot loader,但是由於前 446 bytes 毀損了,畫面只會停

止很久然後都沒吐出任何錯誤訊息。另外老師還把 initrd 給砍掉了,

還修改了 fstab :>最後是怎麼修復的? 把之前做好的 Fedora 9 Live

USB 裡面的 initrd0.img 拷貝成該 initrd 的名字,再重開。

不過前提是,你的系統要和 live USB 核心版本相同,或是較舊,不

然重開就會吐出 /lib/modules/$(uname -r)/modules.dep not found

的錯誤訊息。


os.還蠻有趣的一向實驗 , 佳寰要不要跟我拿 binary 檔呀? 猜測

是 C 寫的,等你來反組譯 XD

2008/12/16

Not Coming Back

晚上一點整,聽著這首 Not Coming Back 有著無限感觸 ...

youtube



lyric

I don't believe in any longer bus
it got my motor wrong
for more than tears she cry
then you know
that it's much to much

so walk from the sky
let it rain on me
I got this sorrow fall down
so we can wash be clean
and you know
that it was much to much

not coming back again
no more advice from my so called friends
and I am coming back no more

driving away
you raise the real bill here
that you fade away
you start to deal this feel
that you know
babe babe
come on

I've been down
with the love almost flown
when I got backup
I got nothing to show
show for you
that it was much to much

I'm not coming back again
no more advice from my so called friends
and I am coming back no more

you fooled me for the last time
I walked away
for you to make up
you might take more staring now
it's telling me out from inside
and you gotta know

I'm not coming back again
no more advice for so call friends
and I'm not coming back any more
I am coming back no more

babe,I was pouring around
I won't be back to kiss you goodnight
I won't be back and you don't feel right
I should've known you make fool at me
Now I was known to know
I won't be back again
I won't be back.babe,I won't be back
I won't be back
you don't feel right
I should know
I should know
I should know you fool on me
Now I was known to know Now,
Now I won't be back again

2008/12/12

Windows Live Space 改版了?



今天用的時候發現變成25G了,看起來我還能拿來存新的漫畫...