August 2010
3 posts
5 tags
afurlan's blog -- configuring apache's userdir on... →
nginx 沒有 per-user dir 的語意,但是跟 lighttpd 一樣,都可以透過 regexp 來完成。 使用 nginx 最重要的就是了解它是如何 match location: exact match(=)→stop match(^~)→reg match(~,~*)→string match(any) 當然在設定檔中的 order 也會有影響。這應該使用 nginx 最重要的了。
Aug 8th
4 tags
在 PHP-CGI 時,對目錄特別設定 PHP 參數
在 apache httpd 的架構下,傳統是使用 mod_php,這讓 php 以 apache module 的方式存在,所以在 apache httpd 的設定檔中,以下語法是有效的: php_value php_flag display_errors off 也因此可以寫在 .htaccess 裡面,讓管理者或使用者方便控管。例如:特別在這個網頁應用程式不要顯示錯誤訊息。 但是如果是以 CGI 的方式來跑 php(cgi, fcgi, 或是很夯的 php-fpm),在 apache httpd 中就沒有這些東西可以設定。這時候如果要特別開關某些 PHP 參數,只能直接在應用程式源始碼裡面加上: ini_set('display_errors', 0); 這最直覺,如果不是集中寫在一個檔案(e.g. config.php)的話,一旦程式不只一個進入點(...
Aug 8th
7 tags
PHP CLI interactive mode with readline doesn't...
從 PHP 5.1 開始,在 php-cli 中提供了一個 php -a 的 interactive mode,當沒有 readline 的時候,php -a 就只是一個直譯器,你必須輸入完全的 syntax(<?php ...)。 當編入 readline 的時候,php -a 就是跟 ruby 的 irb 一樣強大的 interacitve shell。 你將會看到如下的使用法: php> echo 'hi'; hi php> 和大部份其它 package system 一樣,FreeBSD ports 是把 php5-readline 另外編成一個 dynamic module。 但是奇怪的是,一但編成 dynamic module 了以後,php -a 不會用 readline 模式執行。 這在 FreeBSD PR...
Aug 8th
1 note