Php development environment configuration records

Source: Internet
Author: User
Tags apm php development environment
I usually configure the environment on my own. in order to facilitate fast configuration in different regions, I would like to sum up and forget. if you are in trouble, you can run some php environment software. For example, phpnow. [Apache installation]

The code is as follows:


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


[Apache uninstall]

The code is as follows:


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


[Httpd. conf configuration key]

The code is as follows:


ServerRoot "D:/APM/Apache2.2.15"
Listen 80
# Gzip support for compressing the content sent to the client
# 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 for php scripts
# Comment this line in fastcgi mode
# You can configure different versions of php or cgi for each site on the VM.
# Include conf/extra/httpd-php.conf
# Fancy directory listings gorgeous directory list
Include conf/extra/httpd-autoindex.conf
# Virtual hosts Virtual host
# Include conf/extra/httpd-vhosts.conf
# Fastcgi mode VM
Include conf/extra/httpd-vhosts-fcgid.conf
# Various default settings the footer displays the version information AccessFileName. htaccess
Include conf/extra/httpd-default.conf


[Httpd-php.conf reference]

The code is as follows:


#
# Find/APM/php-5.2.12-Win32 replacement
#
SetEnv PHPRC "/APM/php-5.2.12-Win32"
SetEnv TMP "/tmp"
# UnsetEnv PERL5LIB
# Adding a php PATH to the PATH when loading a dll
# 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]

The code is as follows:


NameVirtualHost *: 80
# Document directory
DocumentRoot "/vhosts/localhost"
# Name: www.php.net
ServerName localhost
# Aliases such as php.net
ServerAlias 127.0.0.1
# Error log files
ErrorLog "log/dummy-host.localhost-error_log"
# Directory access rules
Options Indexes FollowSymLinks
AllowOverride All
Order allow, deny
Allow from all
# Directory index file
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/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 "log/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]

The code is 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]

The code is as follows:


Net stop MySQL5.0.45-community-nt
Mysqld-nt.exe -- remove MySQL5.0.45-community-nt


[My. ini reference]

The code is 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 = 16 M
Max_allowed_packet = 1 M
Table_cache = 128
Thread_cache = 8
Join_buffer_size = 512 K
Sort_buffer = 512 K
Record_buffer = 512 K
Max_connections = 500
Wait_timeout = 120
Interactive_timeout = 120
Max_connect_errorrs = 3000
Long_query_time = 1
Max_heap_table_size = 16 M
Tmp_table_size = 8 M
Thread_concurrency = 8
Myisam_sort_buffer_size = 8 M
Myisam_sort_buffer_size = 4 M
Low_priority_updates = 1
Ft_min_word_len = 1


[Php. ini configuration reference]

The code is 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"; represents 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 the reference configuration for 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]
; It can be loaded at the same time as zend_optimizer.
; 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 be modified only in ini. all options listed here are default values, unless otherwise stated
; Select low level shm/allocator scheme implemenation
Xcache. shm_scheme = "mmap"
; Disabled: xcache. size = 0
Enabled: xcache. size = 64 M (any value> 0). pay attention to the upper limit of your system mmap.
Xcache. size = 0
We recommend that you set the number of CPUs (cat/proc/cpuinfo | grep-c processor)
Xcache. count = 1
; Is just a reference value, you can safely store more projects (php scripts/variables)
Xcache. slots = 8 K
; Cache item ttl, 0 = permanent
Xcache. ttl = 0
; Interval between scanning expired items, 0 = no scanning, other values in seconds
Xcache. gc_interval = 60

; Same as above, only for variable cache settings
Xcache. var_size = 1 M
Xcache. var_count = 1
Xcache. var_slots = 8 K
; By default, ini_set () is allowed ()
Xcache. var_ttl = 0
; Maximum ttl value
Xcache. var_maxttl = 0
Xcache. var_gc_interval = 300

; For testing only
Xcache. test = Off
;/Dev/zero is invalid
Xcache. readonly_protection = Off
For * nix systems, xcache. mmap_path indicates the file path rather than the Directory (it may not exist but must be created ).
If you want to enable ReadonlyProtection, you can use "/tmp/xcache"
; Two php groups will not share the same/tmp/xcache
For Win32 systems, xcache. mmap_path = Anonymous MAP name, not the file path. we recommend that you use XCache to avoid conflicts with other software.
Xcache. mmap_path = "XCache"

; Only for * nix systems
; Set to null (disabled) or similar to "/tmp/phpcore /"
; Note that this directory should be able to be written to a file by php (not related to open_basedir)
Xcache. coredump_directory = ""

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

[Xcache. coverager]

If xcache. coveragedump_directory is set to Null, this setting is automatically set to Off
Xcache. coverager = Off

; Make sure that this directory can be read by the coverage viewer script (note: open_basedir)
; Dependent On 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]

The code is as follows:


Add the environment variable PHPRC = D: \ PHP. this is the path to notify iis to read the php. ini file.
Add D: \ PHP to the PATH to read the relevant dynamic link library.
Add a new web service extension php d: \ php \ php5isapi. dll
Add Application Extension ing executable file d: \ php \ php5isapi. dll extension. php
Restart IIS php.


[IIS FastCGI PHP]

The code is as follows:


You do not need to add environment variables or modify PATH variables.
Install FastCGI first. the installer automatically adds
Web service extension-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
Instancemax requests = 10000
EnvironmentVars = PHP_FCGI_MAX_REQUESTS: 10000
Add Application Extension ing executable file c: \ windows \ system32 \ inetsrv \ fcgiext. dll extension. php
Restart iis.


[ISAPI_Rewrite reference]

The code is as follows:


RewriteEngine On
RewriteBase/

RewriteCond % {HTTP_HOST} ^ 03188.net [NC]
RewriteRule ^ (. *) $ http://www.03188.net/1121 [L, R = 301]

#### RewriteCond % {REQUEST_URI} ^ [A-Z] {} \/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 captured url 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]

# No input file specified is displayed after the forum is moved.
# RewriteRule ^ bbs/(. *) $ http://bbs.03188.net/#1 [L, R = 301]

# Modifying 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.