發表文章

目前顯示的是 1月, 2011的文章

[Ubuntu]安裝Apache2 + PHP5 + MySQL + phpMyAdmin 【Ubuntu】安裝Apache2 + PHP5 + MySQL + phpMyAdmin

安裝MySQL-Server $ sudo apt-get install mysql-server 安裝Apache HTTP Server $ sudo apt-get install apache2 安裝PHP for Apache HTTP Server $ sudo apt-get install php5 安裝MySQL for Apache HTTP Server $ sudo apt-get install libapache2-mod-auth-mysql $ sudo apt-get install php5-mysql 安裝phpMyAdmin$ sudo apt-get install phpmyadmin裝完後必須先新增一個mysql的帳號$ mysqladmin -u root password [密碼] PS. 這裡新增的root跟系統的root是不同的,如果遺漏第二個步驟會發生錯誤 => #1045 - Access denied for user 'root'@'localhost' (using password: YES) 安裝完畢後套件會自動在/var/www下建立連結,網址列輸入http://127.0.0.1/phpmyadmin即可進入 資料庫預設目錄:/var/lib/mysql 網頁預設目錄:/var/www Apache設定檔:/etc/apache2/apache2.conf -- 後紀: when I going this step : {安裝phpMyAdmin$ sudo apt-get install phpmyadmin裝完後必須先新增一個mysql的帳號$ mysqladmin -u root password [密碼]} it's occur false...{Access denied balabala..} so google and find ... { Q: Ubuntu 下安装phpmyadmin 却无法使用 A: 安装phpmyadmin命 令:sudo apt-get install phpmyadmin 默认安装在 /usr/share/phpmyadmin 作个链接到 /var/www/ 目录下,命令为:sudo ln -s /usr/...

[HTML] shortcut icon

http://www.dotblogs.com.tw/puma/archive/2008/08/24/5188.aspx

[php] use recursice to read all file in directory

<? function open_dir($dir){ $d = dir($dir); while($row = $d->read()){ if($row != '.' && $row != '..'){ $path = $dir.'/'.$row; echo $path."\n"; if(is_dir($path)){ open_dir($path); } } } } $dir = getcwd(); open_dir($dir); ?>

[php] trim() 去掉 \r \n 等不必要字元

This function returns a string with whitespace stripped from the beginning and end of str. Without the second parameter, trim() will strip these characters: * " " (ASCII 32 (0x20)), an ordinary space. * "\t" (ASCII 9 (0x09)), a tab. * "\n" (ASCII 10 (0x0A)), a new line (line feed). * "\r" (ASCII 13 (0x0D)), a carriage return. * "\0" (ASCII 0 (0x00)), the NUL-byte. * "\x0B" (ASCII 11 (0x0B)), a vertical tab. reference: http://php.net/manual/en/function.trim.php

[php] Maximum execution time of 30 seconds exceeded

error: Maximum execution time of 30 seconds exceeded 解: 修改php.ini max_execution_time(time) //單位秒 or 在code加上 set_time_limit(時間) //0為無限制 以上

[php] 網頁即時更新php運算

在前方加上 ob_end_clean(); 在echo 之後加上 flush(); ex: echo "good"; flush(); 即可

[php] 記憶體超出限制

solution : ini_set('memory_limit', '-1'); OR ini_set('memory_limit', '128M');