提高xampp的性能
Apache
EnableMMAP on EnableSendfile on
PHP
php.ini
realpath_cache_size = 4m
APC(Alternative PHP Cache)用来缓存opcode的php中间码(php5.5ago)
- 从PHP 扩展包中找到对应php版本的APC,(nts是非线程安全的意思),下载
- 并解压php_apc.dll到php/ext下
- 配置
# 开启扩展支持 extension : php_apc.dll # 配置扩展 apc.cache_by_default = On apc.enable_cli = Off apc.enabled = On apc.file_update_protection = 2 apc.filters = apc.gc_ttl = 3600 apc.include_once_override = Off apc.max_file_size = 1M apc.num_files_hint = 1000 apc.optimization = Off apc.report_autofilter = Off apc.shm_segments = 1 apc.shm_size = 30 apc.slam_defense = 0 apc.stat = On apc.ttl = 0 apc.user_entries_hint = 100 apc.user_ttl = 0 apc.write_lock = On
PHP 5.5以后,改为opcache,默认支持
运行时配置为
zend_extension="pathto\php\ext\php_opcache.dll" opcache.enable=1 opcache.enable_cli=1 # 共享内存大小 opcache.memory_consumption=1024 opcache.force_restart_timeout=3600 opcache.optimization_level=1 # interned string的内存大小, 也可调 opcache.interned_strings_buffer=8 # 最大缓存的文件数目 opcache.max_accelerated_files=4096 # 60s检查一次文件更新 opcache.revalidate_freq=60 # 打开快速关闭, 打开这个在PHP Request Shutdown的时候, 回收内存的速度会提高 opcache.fast_shutdown=1 # 不保存文件/函数的注释 opcache.save_comments=0
Mysql.ini
innodb_flush_log_at_trx_commit = 2
hosts
;注释掉下面的 ;::1 localhost ; 把下面的放到文件末尾 127.0.0.1 127.0.0.1

浙公网安备 33010602011771号