PHP development environment configuration record

  • 2020-03-31 21:26:15
  • OfStack

[apache installation]
 
httpd.exe -k install -n "apache2.2.15" 
httpd.exe -k start -n "apache2.2.15" 

[apache uninstall]
 
httpd.exe -k stop -n "apache2.2.15" 
httpd.exe -k uninstall -n "apache2.2.15" 

【 httpd.conf configuration key 】
 
ServerRoot "D:/APM/Apache2.2.15" 
Listen 80 
#  Compress the content 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  The script  
# fastcgi The pattern comments this line  
#  Directly in the virtual host, each site can be configured to use a different version php  Or different cgi 
#Include conf/extra/httpd-php.conf 
# Fancy directory listings  Gorgeous directory listing  
Include conf/extra/httpd-autoindex.conf 
# Virtual hosts  Virtual host  
#Include conf/extra/httpd-vhosts.conf 
# fastcgi Mode virtual host  
Include conf/extra/httpd-vhosts-fcgid.conf 
# Various default settings  The footer displays version information AccessFileName .htaccess 
Include conf/extra/httpd-default.conf 

【 httpd-php.conf reference 】
 
# 
#  To find the  /APM/php-5.2.12-Win32  replace  
# 
SetEnv PHPRC "/APM/php-5.2.12-Win32" 
SetEnv TMP "/tmp" 
# UnsetEnv PERL5LIB 
#  loading dll Save in PATH add php The 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 】
 
NameVirtualHost *:80 
# The document directory  
DocumentRoot "/vhosts/localhost" 
# The name   Such as www.php.net 
ServerName localhost 
# The alias   Such as php.net 
ServerAlias 127.0.0.1 
# Error log file  
ErrorLog "logs/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;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]
 
mysqld-nt.exe --install MySQL5.0.45-community-nt --defaults-file=D:APMmysql5.0.45my.ini 
net start MySQL5.0.45-community-nt 

[Mysql uninstall]
 
net stop MySQL5.0.45-community-nt 
mysqld-nt.exe --remove MySQL5.0.45-community-nt 

[my. Ini reference]
 
[mysqld] 
basedir="D:APMmysql5.0.45" 
datadir="D:APMmysql5.0.45Data" 
tmpdir="D:APMmysql5.0.45tmp" 
# log="D:APMmysql5.0.45tmpmysql.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]
 
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 the  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" 

;  Here's how to use ZendExtensionManager.dll Reference configuration  
;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] 
;  We can put it in the back and we can sum it zend_optimizer At the same time to load  
;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 are just in  ini  Inside can be modified ,  The default values are listed here ,  Unless otherwise stated  
; select low level shm/allocator scheme implemenation 
xcache.shm_scheme = "mmap" 
;  disable : xcache.size=0 
;  To enable the : xcache.size=64M  Such as  ( any >0 The value of the )  Also pay attention to your system  mmap  ceiling  
xcache.size = 0 
;  Recommended setting as  cpu  The number  (cat /proc/cpuinfo |grep -c processor) 
xcache.count = 1 
;  It's just a reference ,  You can safely store more than this number of items (php The script / variable ) 
xcache.slots = 8K 
;  Cache item  ttl, 0= permanent  
xcache.ttl = 0 
;  The time interval for scanning expired items , 0= Don't scan ,  Other values are in seconds  
xcache.gc_interval = 60 

;  Same as above ,  This is only set for the variable cache  
xcache.var_size = 1M 
xcache.var_count = 1 
xcache.var_slots = 8K 
;  The default ,  allow  ini_set() 
xcache.var_ttl = 0 
;  The biggest ttl value  
xcache.var_maxttl = 0 
xcache.var_gc_interval = 300 

;  Just a test  
xcache.test = Off 
; /dev/zero  When is invalid  
xcache.readonly_protection = Off 
;  for  *nix  system , xcache.mmap_path  Is a file path, not a directory , ( May not exist   But you have to be able to create ). 
;  If you wish to enable  ReadonlyProtection,  You can use something like  "/tmp/xcache" 
; 2  a  php  Groups do not share the same  /tmp/xcache 
;  for  Win32  system , xcache.mmap_path= anonymous MAP The name ,  Not a file path .  It is recommended to use  XCache  Avoid conflict with other software  
xcache.mmap_path = "XCache" 

;  Only used for  *nix  system  
;  Set to null ( disable )  Or similar  "/tmp/phpcore/" 
;  Note that the directory should be able to be  php  Written to the file  ( with  open_basedir  Has nothing to do ) 
xcache.coredump_directory = "" 

xcache.cacher = On 
xcache.stat = On 
xcache.optimizer = Off 

[xcache.coverager] 

;  if  xcache.coveragedump_directory  Set to null, this setting is automatically set to  Off 
xcache.coverager = Off 

;  Please make sure that this catalogue can be  coverage viewer  The script reads  ( Pay attention to  open_basedir) 
;  Depends 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 】
 
 Add environment variables  PHPRC=D:PHP  This is the notice iis read php.ini The path to the file.  
 in PATH add  D:PHP  Can read related dynamic link library.  
 Add a new web Service extension  php d:phpphp5isapi.dll 
 Add the application extension mapping   Executable file  d:phpphp5isapi.dll  extension .php 
 restart IIS php You can use it.  

【 IIS FastCGI PHP 】
 
 You don't need to add environment variables and modify this PATH The variable.  
 First installation FastCGI , the installation program will be added automatically  
Web  Service extension  - FastCGI Handler 
c:windowssystem32inetsrvfcgiext.dll 
 And set it to allow.  
 Modify the c:windowssystem32inetsrvfcgiext.ini 
[Types] 
php=PHP 
[PHP] 
ExePath=D:phpphp-cgi.exe 
InstanceMaxRequests=10000 
EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000 
 Add the application extension mapping   Executable file  c:windowssystem32inetsrvfcgiext.dll  extension .php 
 restart iis Will do.  

【 ISAPI_Rewrite reference 】
 
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] 
#  Modifies what is fetched in full mode url Make effective  
# 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] 

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

#  Modifying human resources hr 
# RewriteRule ^hr/(.*)$ http://hr.03188.net/$1 [L,R=301] 

Related articles: