Drupal 在 Godaddy 上的 php5.ini 設定檔記錄

我是使用Godaddy虛擬主機最高階的方案
把Drupal網站丟到Godaddy之前,必需先評估網站的屬性
一般只供使用者瀏覽,不大會更新資料,後台不會有太多帳號進入維護才適合
我自己本身有一個購物站,發現非常的不穩,或許是購物站要多帳號連入,佔php的資源太多了才會如此吧!
Godaddy的主機似乎有變穩定,速度也有變快

Drupal6在Godaddy設定的時候,發生某些 mail 的功能無法作用的解法

原本有設定Godaddy的Mail,再透過SMTP模組解決
後來找出問題是 DNS 的關係
Domain 的一定要指向  Godaddy 的主機才行
Godaddy 並不支援SMTP模組設定給其他的伺服器,只能設定在自家DNS內的E-MAIL
這點有需求用額外的SMTP送信使用者,需特別留意

寄件時會出現的錯誤狀況
warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/content/4xx7/xxx7/html/sql/home_test/includes/mail.inc on line 192.

這個討論串有解答
http://drupal.org/node/84883
01.修改mail.inc

mime_header_encode($message['subject']),str_replace("\n", ' ', mime_header_encode($message['subject'])),
02.修改unicode.inc
chunk_size = 400


Drupal7在Godaddy的設定呢?

我只改了 includes/unicode.inc

Index: includes/unicode.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/unicode.inc,v
retrieving revision 1.29
diff -u -p -r1.29 unicode.inc
--- includes/unicode.inc 28 Dec 2007 12:02:50 -0000 1.29
+++ includes/unicode.inc 28 Aug 2008 10:06:24 -0000
@@ -278,17 +278,7 @@ function truncate_utf8($string, $len, $w
  */
 function mime_header_encode($string) {
   if (preg_match('/[^\x20-\x7E]/', $string)) {
-    $chunk_size = 47; // floor((75 - strlen("=?UTF-8?B??=")) * 0.75);
-    $len = strlen($string);
-    $output = '';
-    while ($len > 0) {
-      $chunk = drupal_truncate_bytes($string, $chunk_size);
-      $output .= ' =?UTF-8?B?'. base64_encode($chunk) ."?=\n";
-      $c = strlen($chunk);
-      $string = substr($string, $c);
-      $len -= $c;
-    }
-    return trim($output);
+    $string = '=?UTF-8?B?'. base64_encode($string) ."?=";
   }
   return $string;
 }

參考來源:https://drupal.org/node/300387


底下的設定檔可做為參考實用


php5.ini 
cgi.fix_pathinfo = 1
cgi.check_shebang_line = 0
;register_argc_argv = false
default_charset= "UTF-8"

; Enable GZIP compression at the default level
zlib.output_compression = On
zlib.output_compression_level = 6

; Disable PHP magic quotes
;magic_quotes_gpc = Off
;magic_quotes_runtime = Off
;magic_quotes_sybase = Off

register_globals = off
allow_url_fopen = on

max_upload_filesize = 6M
upload_max_filesize=6M
memory_limit=48M
max_execution_time=30

expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

date.timezone="Europe/Paris"

allow_call_time_pass_reference = on

; Load PDO MySQL extension
extension=pdo.so
extension=pdo_mysql.so

;APC
extension="apc.so"
apc.enabled=1
apc.shm_segments=1
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.enable_cli=1

; Only uncomment zend optimizer lines if your application requires Zend Optimizer support
[Zend]
;zend_optimizer.optimization_level=15
;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
;zend_extension=/usr/local/Zend/lib/Optimizer-3.3.3/ZendExtensionManager.so
;ZEND GUARD (because we use PHP 5.3)
;zend_extension=/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so
;zend_extension_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3/ZendExtensionManager_TS.so
; -- Be very careful to not to disable a function which might be needed!
; -- Uncomment the following lines to increase the security of your PHP site.
;disable_functions = "highlight_file,ini_alter,ini_restore,openlog,passthru,
; phpinfo, exec, system, dl, fsockopen, set_time_limit,
; popen, proc_open, proc_nice,shell_exec,show_source,symlink"


其它參考資料

可以善速度?
http://drupal.arxic.com/node/17

PHP5.ini 設定檔來源
http://www.gibni.com/alternative-php-cache-apc-godaddy-hosting

http://drupal.org/node/708448
http://www.zyxware.com/articles/1830/how-does-the-emailing-system-drupal-mail-work-in-drupal-6
http://api.drupal.org/api/drupal/includes%21mail.inc/function/drupal_mail/6


2013/08/08記錄
register_globals = off
allow_url_fopen = off

expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
memory_limit = 256M
extension=uploadprogress.so
apc.rfc1867 = 1
mail.add_x_header = on
magic_quotes = off
magic_quotes_gpc = off
mbstring.internal_encoding = UTF-8
extension=openssl.so

; Only uncomment zend optimizer lines if your application requires Zend Optimizer support

;[Zend]
;zend_optimizer.optimization_level=15
;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
;zend_extension=/usr/local/Zend/lib/Optimizer-3.3.3/ZendExtensionManager.so
;zend_extension_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3/ZendExtensionManager_TS.so


; -- Be very careful to not to disable a function which might be needed!
; -- Uncomment the following lines to increase the security of your PHP site.

;disable_functions = "highlight_file,ini_alter,ini_restore,openlog,passthru,
;      phpinfo, exec, system, dl, fsockopen, set_time_limit,
;                     popen, proc_open, proc_nice,shell_exec,show_source,symlink"
張貼留言
技術提供:Blogger.