PHP Development environment configuration record _php tips

Source: Internet
Author: User
Tags apm php development environment php script time interval win32 zend
"Apache Installation"
Copy Code code as follows:

Httpd.exe-k install-n "apache2.2.15"
Httpd.exe-k start-n "apache2.2.15"

"Apache Uninstall"
Copy Code code as follows:

Httpd.exe-k stop-n "apache2.2.15"
Httpd.exe-k uninstall-n "apache2.2.15"

"Httpd.conf configuration Key"
Copy Code code as follows:

ServerRoot "d:/apm/apache2.2.15"
Listen 80
# compress content that is sent to the client gzip support
#LoadModule Deflate_module modules/mod_deflate.so
# LoadModule Cgi_module modules/mod_cgi.so
# fastcgi
LoadModule Fcgid_module modules/mod_fcgid.so
LoadModule Rewrite_module modules/mod_rewrite.so
DocumentRoot "D:/apm/apache2.2.15/htdocs"
# Support PHP Scripts
# fastcgi mode to comment on this row
# directly in the virtual host can configure each site to use different versions of PHP or different CGI
#Include conf/extra/httpd-php.conf
# Fancy Directory listings Gorgeous catalog list
Include conf/extra/httpd-autoindex.conf
# Virtual Hosts Hosting
#Include conf/extra/httpd-vhosts.conf
# fastcgi Mode Virtual Host
Include conf/extra/httpd-vhosts-fcgid.conf
# Various default settings footer displays version information accessfilename. htaccess
Include conf/extra/httpd-default.conf

"Httpd-php.conf Reference"
Copy Code code as follows:

#
# Find/apm/php-5.2.12-win32 Replacement
#
setenv PHPRC "/apm/php-5.2.12-win32"
SETENV tmp "/tmp"
# unsetenv Perl5lib
# Loading DLL eliminates adding PHP paths to Path
#LoadFile "/apm/php-5.2.12-win32/libpq.dll"
LoadFile "/apm/php-5.2.12-win32/libmysql.dll"
LoadFile "/apm/php-5.2.12-win32/libmcrypt.dll"
LoadFile "/apm/php-5.2.12-win32/libmhash.dll"
LoadFile "/apm/php-5.2.12-win32/libeay32.dll"
Loadfile/apm/php-5.2.12-win32/ssleay32.dll
#
# Php-module Setup
#
LoadFile "/apm/php-5.2.12-win32/php5ts.dll"
LoadModule php5_module "/apm/php-5.2.12-win32/php5apache2_2.dll"
SetHandler application/x-httpd-php
SetHandler Application/x-httpd-php-source
# Load PHP.ini File Dir
Phpinidir "/apm/php-5.2.12-win32"
AddType text/html. php. Phps

"Httpd-vhosts.conf Reference"
Copy Code code as follows:

Namevirtualhost *:80
#文档目录
DocumentRoot "/vhosts/localhost"
#名字 such as Www.php.net
ServerName localhost
#别名 such as Php.net
Serveralias 127.0.0.1
#错误日志文件
ErrorLog "Logs/dummy-host.localhost-error_log"
#目录访问规则
Options Indexes FollowSymLinks
AllowOverride All
Order Allow,deny
Allow from all
#目录索引文件
DirectoryIndex index.html index.htm index.php
[HTML]
"Httpd-vhosts-fcgid.conf Reference"
[Code]
#FcgidInitialEnv PHPRC "/apm/php5210"
#FcgidInitialEnv PATH "/apm/php5210; C:/windows/system32; C:/windows; C:/windows/system32/wbem; "
#FcgidInitialEnv SystemRoot "C:/windows"
#FcgidInitialEnv systemdrive "C:"
#FcgidInitialEnv TEMP "C:/windows/temp"
#FcgidInitialEnv TMP "C:/windows/temp"
#FcgidInitialEnv windir "C:/windows"
Fcgidiotimeout 64
Fcgidconnecttimeout 16
Fcgidmaxrequestsperprocess 500
Namevirtualhost *:80
DocumentRoot "/vhosts/localhost"
ServerName localhost
Serveralias 127.0.0.1
ErrorLog "Logs/dummy-host.localhost-error_log"
Options Indexes followsymlinks execcgi
#Options +execcgi
AllowOverride All
#AddHandler fcgid-script. php
#FCGIWrapper/apm/php5210/php-cgi.exe. php
#"
AddHandler fcgid-script. php
Fcgidwrapper "/apm/php-5.2.13-nts-win32/php-cgi.exe". php
#FcgidWrapper "/apm/php-5.3.2-nts-win32-vc6-x86/php-cgi.exe". php
#
Order Allow,deny
Allow from all
DirectoryIndex index.html index.htm index.php

"MySQL Installation"
Copy Code code as follows:

Mysqld-nt.exe--install mysql5.0.45-community-nt--defaults-file=d:\apm\mysql5.0.45\my.ini
net start mysql5.0.45-community-nt

"MySQL Uninstall"
Copy Code code as follows:

net stop Mysql5.0.45-community-nt
Mysqld-nt.exe--remove Mysql5.0.45-community-nt

"My.ini Reference"
Copy Code code as follows:

[Mysqld]
Basedir= "D:\APM\mysql5.0.45\"
Datadir= "D:\APM\mysql5.0.45\Data\"
Tmpdir= "D:\APM\mysql5.0.45\tmp\"
# log= "D:\APM\mysql5.0.45\tmp\mysql.log"
Default-character-set=utf8
port=3306
Interactive_timeout=5
Wait_timeout=5
Skip-locking
Skip-innodb
Skip-bdb
Ft_min_word_len=1
[Mysqld]
port=3306
Basedir= "d:/mysql/"
Datadir= "d:/mysql/data/"
Tmpdir= "d:/mysql/tmp/"
Default-character-set=utf8
Default-storage-engine=myisam
Skip-bdb
Skip-innodb
Skip-locking
key_buffer=16m
max_allowed_packet=1m
table_cache=128
Thread_cache=8
join_buffer_size=512k
sort_buffer=512k
record_buffer=512k
max_connections=500
wait_timeout=120
interactive_timeout=120
max_connect_errors=3000
Long_query_time=1
max_heap_table_size=16m
Tmp_table_size=8m
Thread_concurrency=8
Myisam_sort_buffer_size=8m
myisam_sort_buffer_size=4m
Low_priority_updates=1
Ft_min_word_len=1

"PHP.ini Configuration Reference"
Copy Code code as follows:

Output_buffering = On
Disable_functions = System,passthru,shell_exec,exec,popen,proc_open
ENABLE_DL = Off

Upload_tmp_dir = "d:/tmp/uploadtemp/"
Session.save_path = "d:/tmp/sessiondata/"
Date.timezone = "etc/gmt-8"; it means gmt+8.
Mbstring.language = Neutral; Set default language to Neutral (UTF-8) (default)
mbstring.internal_encoding = UTF-8; Set internal encoding to UTF-8

Cgi.force_redirect = 0
Cgi.fix_pathinfo = 1
Fastcgi.impersonate = 1

[Eaccelerator]
; zend_extension= "/apm/ext/eaccelerator_v0_9_6_for_v5_2_13-vc6/eaccelerator.dll"
; zend_extension= "/apm/ext/eaccelerator_v1_0_svn412_for_v5_2_13-vc6/eaccelerator.dll"
Eaccelerator.shm_size= "16"
Eaccelerator.cache_dir= "/tmp/eaccelerator"
eaccelerator.enable= "1"
Eaccelerator.optimizer= "1"
Eaccelerator.check_mtime= "1"
eaccelerator.debug= "0"
; eaccelerator.log_file= "/var/log/httpd/eaccelerator_log"
Eaccelerator.filter= ""
eaccelerator.shm_max= "0"
Eaccelerator.shm_ttl= "300"
eaccelerator.shm_prune_period= "0"
eaccelerator.shm_only= "0"
eaccelerator.compress= "1"
Eaccelerator.compress_level= "9"

[Zend]
Zend_optimizer.optimization_level=15
Zend_optimizer.encoder_loader=0
; zend_extension_ts= "/apm/ext/zendoptimizer-3.3.0/lib/optimizer-3.3.0/php-5.2.x/zendoptimizer.dll"
; zend_extension= "/apm/ext/zendoptimizer_nts.dll"
; zend_extension= "/apm/ext/zendoptimizerplus.dll"

; The following is a reference configuration using ZendExtensionManager.dll
; zend_extension_manager.optimizer_ts= "/apm/zend/zendoptimizer-3.3.0/lib/optimizer-3.3.0"
; zend_extension_ts= "/apm/zend/zendoptimizer-3.3.0/lib/zendextensionmanager.dll"
; zend_extension_manager.debug_server_ts= "/apm/zend/zendoptimizer-3.3.0/lib/zenddebugger-5.2.13-cygwin_nt-i386"
; zend_debugger.expose_remotely=always
; zend_debugger.allow_hosts=127.0.0.1/32
; zend_debugger.allow_tunnel=127.0.0.1/32
[Zenddebugger]
; You can load it with Zend_optimizer at the back.
; zend_extension_ts= "/apm/ext/zenddebugger-5.2.15rc1-cygwin_nt-i386/php-5.2.x/zenddebugger.dll"

[Xcache-common]
; zend_extension= "D:/apm/ext/xcache-1.3.0-php-5.2.10-nts-win32-vc6-x86/php_xcache.dll"
; Extension = Php_xcache.dll

[Xcache.admin]
Xcache.admin.enable_auth = Off
Xcache.admin.user = "MOo"
; Xcache.admin.pass = MD5 ($ your password)
Xcache.admin.pass = ""

[XCache]
; Most of the options here can only be modified in INI, and here are the default values, unless otherwise stated
; Select Low Level shm/allocator scheme implemenation
Xcache.shm_scheme = "Mmap"
; Disabling: xcache.size=0
; Enable: xcache.size=64m (any >0 value) Please also note that your system mmap upper limit
Xcache.size = 0
; Recommended set to CPU number (Cat/proc/cpuinfo |GREP-C processor)
Xcache.count = 1
; is only a reference value, you can safely store more than this number of items (PHP script/variable)
Xcache.slots = 8K
; The TTL for the cached item, 0 = Permanent
Xcache.ttl = 0
; Time interval for scanning expired items, 0 = Not scanned, other values in seconds
Xcache.gc_interval = 60

; Ditto, just for variable caching settings
Xcache.var_size = 1M
Xcache.var_count = 1
Xcache.var_slots = 8K
; Default, allow Ini_set ()
Xcache.var_ttl = 0
; Maximum TTL value
Xcache.var_maxttl = 0
Xcache.var_gc_interval = 300

; Test only with
Xcache.test = Off
; Invalid when/dev/zero
Xcache.readonly_protection = Off
; For *nix systems, the Xcache.mmap_path is a file path rather than a directory (it can not exist but must be created).
; If you expect to enable readonlyprotection, you can use a similar "/tmp/xcache"
; 2 php groups do not share the same/tmp/xcache
; For the WIN32 system, the xcache.mmap_path= anonymous map name, not the file path. Suggest using XCache Word to avoid conflict with other software
Xcache.mmap_path = "XCache"

; For *nix Systems only
; Set to null (disabled) or similar to "/tmp/phpcore/"
; Note that the directory should be able to write files to PHP (unrelated to Open_basedir)
Xcache.coredump_directory = ""

Xcache.cacher = On
Xcache.stat = On
Xcache.optimizer = Off

[Xcache.coverager]

; This setting is automatically off if xcache.coveragedump_directory is set to null
Xcache.coverager = Off

; Please make sure this catalog is readable by the Coverage Viewer script (note open_basedir)
; Depend on the Xcache.coverager=on
Xcache.coveragedump_directory = ""

[Xdebug]
Xdebug.var_display_max_depth = 10
; Xdebug.remote_autostart = 1
; xdebug.remote_enable=1
; XDEBUG.REMOTE_HANDLER=DBGP
; xdebug.remote_host=127.0.0.1
; xdebug.remote_mode=req
; Xdebug.idekey=default
; xdebug.remote_log= "/xdebug.log"
; xdebug.remote_port=9000
Xdebug.auto_trace=off
; xdebug.collect_params=on
; xdebug.collect_return=on
Xdebug.trace_output_dir= "/tmp/xdebug"
Xdebug.profiler_enable=off
Xdebug.profiler_output_dir= "/tmp/xdebug"
; zend_extension_ts= "/apm/ext/xdebug/php_xdebug-2.0.5-5.2.dll"
; zend_extension= "/apm/ext/xdebug/php_xdebug-2.0.5-5.2-nts.dll"
zend_extension= "/apm/ext/xdebug/php_xdebug-2.1.0beta3-5.2-vc6-nts.dll"

"IIS ISAPI"
Copy Code code as follows:

Add environment variable phprc=d:\php This is the path that notifies IIS to read php.ini files.
Adding D:\PHP to Path can read the associated dynamic link library.
Add a new Web service extension PHP d:\php\php5isapi.dll
Add Application extension Mapping executable file d:\php\php5isapi.dll extension. php
Restart IIS PHP to use.

"IIS FastCGI PHP"
Copy Code code as follows:

This does not add environment variables and modifies the PATH variable.
Install fastcgi First, the installer will automatically add
Web Service Extensions-FastCGI Handler
C:\windows\system32\inetsrv\fcgiext.dll
and set to allow.
Modify C:\windows\system32\inetsrv\fcgiext.ini
[Types]
php=php
[PHP]
Exepath=d:\php\php-cgi.exe
instancemaxrequests=10000
environmentvars=php_fcgi_max_requests:10000
Add Application extension Mapping executable file c:\windows\system32\inetsrv\fcgiext.dll extension. php
It's OK to reboot IIS.

"Isapi_rewrite Reference"
Copy Code code as follows:

Rewriteengine on
Rewritebase/

Rewritecond%{http_host} ^03188.net [NC]
Rewriterule ^ (. *) $ http://www.03188.net/$1 [l,r=301]

# Rewritecond%{request_uri} ^[a-z]{3,9}\/index\.php\ HTTP/
# Rewriterule ^index\. (php|htm|html) $ http://www.03188.net/[r=301,l]

Rewriterule ^ ([a-z]+)/(. *)/(. *)/(. *) \.htm$ index.php?action=$1&option=$2&extent=$3&info=$4 [L]
Rewriterule ^ ([a-z]+)/(. *)/(. *) \.htm$ index.php?action=$1&option=$2&extent=$3&info=$3 [L]
Rewriterule ^ ([a-z]+)/(. *) \.htm$ index.php?action=$1&option=$2 [L]
Rewriterule ^ ([a-z]+) \.htm$ index.php?action=$1 [L]

# rewriterule ^ (. *) \.asp$ http://www.03188.net [l,r=301]
# Modify the URL to be crawled in full mode to make it valid
# Rewriterule ^index\.php/([a-z]+)/(. *)/(. *) \.htm$ $1/$2/$3\.htm [l,r=301]
# Rewriterule ^index\.php/([a-z]+)/(. *) \.htm$ $1/$2\.htm [l,r=301]

# Modify the forum moved to appear no input file specified.
# Rewriterule ^bbs/(. *) $ http://bbs.03188.net/$1 [l,r=301]

# Modify HR HR
# Rewriterule ^hr/(. *) $ http://hr.03188.net/$1 [l,r=301]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.