php.ini 內有很多設定值,如果無法更法 php.ini 而需要更改某些設定值的話,可以透過 PHP 程式或 .htaccess 來實現。
PHP
PHP:
以上程式碼會開啟 magic_quotes_gpc。
.htaccess
用 .htaccess 來實現更加方便,因為整個目錄內也會生效,在 .htaccess 加入:
php_value magic_quotes_gpc 1
以上使用了 php_value 來設定 magic_quotes_gpc,並定義它的值為 1 (即開啟)。
這個方法是有限制的,例如 safe_mode 及 safe_mode_exec_dir 這類 functions 就不可以修改了。
It seems that you are wrong
Name Default Changeable
magic_quotes_gpc “1″ PHP_INI_PERDIR
PHP_INI_PERDIR:Entry can be set in php.ini, .htaccess or httpd.conf
From: http://cn.php.net/manual/en/ini.php#ini.list
Comment by fcicq — May 20, 2007 @ 11:37 pm
我之前報讀過PHP課程 , 但始終還是很多不明
而且只教了 12 小時的入門課程。
如果你有興趣私人教授 , 希望能add 我的 msn 開價
xylonchan@gmail.com
我真的很想學會寫程式 , 開發自己的網站。希望你能聯絡我
Comment by Xylonchan — May 21, 2007 @ 8:23 pm
那麼如果想開啟 mb_substr() 功能,應該怎麼寫呢?
Comment by Ian — July 19, 2007 @ 7:16 pm