Create an account    
 home  
 
Web www.thaihealth.net
  You are here:> home>topics> Basic PHP > การปรับแต่งphpภายหลังติดตั้งบน linux ©
php&MySQL: การปรับแต่งphpภายหลังติดตั้งบน linux
Posted on Wednesday, October 01 @ 10:41:28 GMT+7 by admin

Basic PHP

การปรับแต่งphp.ini

เมื่อวานนี้ได้กล่าวถึง การติดตั้ง phpแบบเหงื่อไม่ตกมาก คราวนี้เราลองมาดูว่าเมื่อเราลงเสร็จจะปรับแต่งอย่างไร อันดับแรก นี่คือไฟล์ /etc/php.ini ที่เราอยากให้เป็น


[PHP]

; Language Options
engine                          = On
short_open_tag                  = On
asp_tags                        = Off
precision                       = 14
y2k_compliance                  = Off
output_buffering                = Off
output_handler                  =
unserialize_callback_func       =
zlib.output_compression         = On
implicit_flush                  = Off
allow_call_time_pass_reference  = Off

; Safe Mode
safe_mode                       = On
safe_mode_gid                   = Off
safe_mode_include_dir           = ".:/usr/share/pear"
safe_mode_exec_dir              =
;open_basedir                   =
safe_mode_allowed_env_vars      = PHP_
safe_mode_protected_env_vars    = LD_LIBRARY_PATH
disable_functions               =

; Font Colors
highlight.string                = #CC0000
highlight.comment               = #FF9900
highlight.keyword               = #006600
highlight.bg                    = #FFFFFF
highlight.default               = #0000CC
highlight.html                  = #000000

; Misc
expose_php                      = Off

; Resource Limits
max_execution_time              = 30
memory_limit                    = 8M

; Error handling and logging
error_reporting                 = E_ALL
display_errors                  = Off
display_startup_errors          = Off
log_errors                      = On
track_errors                    = Off
html_errors                     = Off
error_log                       = syslog
warn_plus_overloading           = Off

; Data Handling
;arg_separator.output           = "&" ; Default is "&".
;arg_separator.input            = ";&" ; Default is "&".
variables_order                 = "GPCS"
register_globals                = Off
register_argc_argv              = On
post_max_size                   = 8M

; Magic Quotes
magic_quotes_gpc                = Off
magic_quotes_runtime            = Off
magic_quotes_sybase             = Off
auto_prepend_file               =
auto_append_file                =
default_mimetype                = "text/html"
default_charset                 = "iso-8859-1"
;always_populate_raw_post_data  = On

; Paths and Directories
;include_path                   = ".:/usr/share/pear"
doc_root                        =
user_dir                        =
extension_dir                   = /usr/lib/php4
enable_dl                       = Off
; cgi.force_redirect            = On
; cgi.redirect_status_env       =

; File Uploads
file_uploads                    = Off
;upload_tmp_dir                 =
upload_max_filesize             = 1M

; Fopen wrappers
allow_url_fopen                 = Off
;from                           = "anonymous@domain.com"

; Dynamic Extensions
;extension                      = imap.so
;extension                      = ldap.so
;extension                      = mysql.so
;extension                      = pgsql.so

; PHP Accelerator extension
;zend_extension="/usr/lib/php4/
php_accelerator_1.3.3r1.so"

[Syslog]
define_syslog_variables         = Off
;sendmail_path                  =

[SQL]
sql.safe_mode                   = Off

[ODBC]
odbc.allow_persistent           = Off
odbc.check_persistent           = On
odbc.max_persistent             = -1
odbc.max_links                  = -1
odbc.defaultlrl                 = 4096
odbc.defaultbinmode             = 1

[MySQL]
mysql.allow_persistent          = Off
mysql.max_persistent            = -1
mysql.max_links                 = -1
mysql.default_port              =
mysql.default_socket            = /var/lib/mysql/mysql.sock
mysql.default_host              =
mysql.default_user              =
mysql.default_password          =

[PostgresSQL]
pgsql.allow_persistent          = Off
pgsql.auto_reset_persistent     = Off
pgsql.max_persistent            = -1
pgsql.max_links                 = -1

[bcmath]
bcmath.scale                    = 0

[browscap]
;browscap                       = extra/browscap.ini

[Session]
session.save_handler            = files
session.save_path               = /tmp
session.use_cookies             = 1
session.name                    = PHPSESSID
session.auto_start              = 0
session.cookie_lifetime         = 0
session.cookie_path             = /
session.cookie_domain           =
session.serialize_handler       = php
session.gc_probability          = 1
session.gc_maxlifetime          = 1440
session.referer_check           =
session.entropy_length          = 0
session.entropy_file            =
;session.entropy_length         = 16
;session.entropy_file           = /dev/urandom
session.cache_limiter           = nocache
session.cache_expire            = 180
session.use_trans_sid           = 0
url_rewriter.tags               = "a=href,area=href,frame=src,input=src,form=fakeentry"

[Assertion]
;assert.active                  = On
;assert.warning                 = On
;assert.bail                    = Off
;assert.callback                = 0
;assert.quiet_eval              = 0

[Sockets]
sockets.use_system_read         = On

แต่ ประเดี๋ยวก่อน สำหรับท่านที่ต้องการ ใช้กับ phpNUKE อาจจะต้องแก้ไข เพราะ php.ini อันนี้ set ให้ปลอดภัยมาก

ข้อแรกคือ output buffering = off ให้ on เสีย แม้จะทำให้ช้านิด แต่จะแก้ปัญหาเรื่อง error เกี่ยวกับ header ได้

ข้อสอง ในกรณีที่ใช้ php-NUKE เป็น main น่าจะลองปรับแก้ output handler เป็น ob_gzhandler และปรับ output_buffering=off

หลังจากนั้นให้ restart apache ใหม่ทุกครั้งถ้ามีการปรับแก้ อ้อ เกือบลืม
การปรับแต่งapache ให้สามารถใช้ php ได้
1.เข้าดูในไฟล์ /etc/httpd/httpd.conf หรือถ้าในกรณีที่เราสร้าง apache แบบ apache profile จะอยู่ที่ /usr/local/apache2/conf/httpd.conf
2.ใส่บรรทัด LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php
บางทีก็แค่เอา # ออกก็ได้ครับ

3.restart apache


blog this


blog this

More about phpbasic
· PHP5 Release candidate is out now, try!2004-03-23 12:22:54
· How to , when new user register to put more of their informations.!2004-02-19 12:54:03
· Thaihealthnews V2.02module-need calendar function2003-11-28 01:08:26
· here is a scoop for PHP. cool!2003-10-17 19:37:55

Comment Post
1  by
on Sunday, March 16 @ 19:53:00 GMT+7
< href="http://f.jsoftj.com/">URL blocked by staff منتديا&

Read the rest of this comment...


2  by
on Saturday, March 15 @ 00:28:38 GMT+7
< href="http://www.jsoftj.com/">URL blocked by staff جي سوف

Read the rest of this comment...


3  by gaila
on Saturday, January 26 @ 07:56:44 GMT+7
< href="http://gallery.newsit.es/">URL blocked by staff free wallpaper [gallery.newsit.es]




Your Name:

[ New User ]

Subject:


Comment:

Allowed HTML:
<b> <i> <a> <em> <br> <strong> <blockquote> <tt> <li> <ol> <ul>
Security code:



T news tweak
 

       Sponsored Links
       Related Links
· More about Basic PHP
· News by admin


Most read story about Basic PHP:
 How to , when new user register to put more of their informations.!(8695)

       Article Rating
Average Score: 0
Votes: 0

Please take a second and vote for this article:

Excellent
Very Good
Good
Regular
Bad


       Options

 Printer Friendly  Printer Friendly

 Send to a Friend  Send to a Friend

News ©

เล่นเกมส์ arcade games free!

main sitethaihealth | home | forums | downloads | topics

Seo from our desk thai seo
Web site engine code is Copyright © 2003 by PHP-Nuke.Copyright 2007 Thaihealth and pattaya doctor
Page Generation: 0.186 Seconds

Theme developed by WebDesignHQ.com Modified By DoctorNUKE