├── README ├── README.md ├── linux └── sysctl.conf ├── nginx ├── global │ ├── cache.conf │ ├── php-fpm.conf │ ├── security.conf │ ├── status.conf │ └── wordpress-w3-total-cache.conf ├── nginx.conf └── site-configuration │ └── wordpress ├── php-fpm ├── conf.d │ ├── apc.ini │ ├── curl.ini │ ├── gd.ini │ ├── memcache.ini │ ├── mysql.ini │ ├── mysqli.ini │ ├── pdo.ini │ ├── pdo_mysql.ini │ ├── pdo_sqlite.ini │ ├── redis.ini │ ├── sqlite.ini │ ├── sqlite3.ini │ ├── suhosin.ini │ └── xcache.ini ├── php-fpm.conf ├── php.ini └── pool.d │ └── www.conf └── varnish ├── default.vcl ├── default ├── varnish └── varnishncsa └── varnish4-wordpress /README: -------------------------------------------------------------------------------- 1 | [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=nicolargo&url=https://github.com/nicolargo/varnish-nginx-wordpress&title=varnish-nginx-wordpress&language=en_GB&tags=github&category=rest) 2 | 3 | I serve my [blog](http://blog.nicolargo.com/2011/09/configuration-varnishnginx-pour-wordpress.html) with the following WebStack: 4 | 5 | - Debian GNU/Linux (what else) 6 | 7 | > See my [sysctl.conf](https://github.com/nicolargo/varnish-nginx-wordpress/blob/master/linux/sysctl.conf) file 8 | 9 | - Nginx 10 | 11 | > See my [NGinx configuration](https://github.com/nicolargo/varnish-nginx-wordpress/tree/master/nginx) 12 | 13 | - PHP-FPM / APC 14 | 15 | > See my [PHP configration](https://github.com/nicolargo/varnish-nginx-wordpress/tree/master/php-fpm) 16 | 17 | - Varnish 18 | 19 | > See my [Varnish configuration](https://github.com/nicolargo/varnish-nginx-wordpress/tree/master/varnish) 20 | 21 | - Wordpress with the "[WP Super Cache](http://ocaoimh.ie/wp-super-cache/)" and "[Varnish HTTP Purge](http://wordpress.org/extend/plugins/varnish-http-purge/)" plugins 22 | 23 | Feel free to share and fork ! 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=nicolargo&url=https://github.com/nicolargo/varnish-nginx-wordpress&title=varnish-nginx-wordpress&language=en_GB&tags=github&category=rest) 2 | 3 | I serve my [blog](http://blog.nicolargo.com/2011/09/configuration-varnishnginx-pour-wordpress.html) with the following WebStack: 4 | 5 | - Debian GNU/Linux (what else) 6 | 7 | > See my [sysctl.conf](https://github.com/nicolargo/varnish-nginx-wordpress/blob/master/linux/sysctl.conf) file 8 | 9 | - Nginx 10 | 11 | > See my [NGinx configuration](https://github.com/nicolargo/varnish-nginx-wordpress/tree/master/nginx) 12 | 13 | - PHP-FPM / APC 14 | 15 | > See my [PHP configration](https://github.com/nicolargo/varnish-nginx-wordpress/tree/master/php-fpm) 16 | 17 | - Varnish 18 | 19 | > See my [Varnish configuration](https://github.com/nicolargo/varnish-nginx-wordpress/tree/master/varnish) 20 | 21 | - Wordpress with the "[WP Super Cache](http://ocaoimh.ie/wp-super-cache/)" and "[Varnish HTTP Purge](http://wordpress.org/extend/plugins/varnish-http-purge/)" plugins 22 | 23 | Feel free to share and fork ! 24 | -------------------------------------------------------------------------------- /linux/sysctl.conf: -------------------------------------------------------------------------------- 1 | # 2 | # /etc/sysctl.conf - Configuration file for setting system variables 3 | # See /etc/sysctl.d/ for additonal system variables 4 | # See sysctl.conf (5) for information. 5 | # 6 | 7 | # Optimisation 8 | # Etape 2: http://blog.nicolargo.com/2010/09/12-etapes-pour-optimiser-les-performances-de-son-blog-wordpress.html 9 | 10 | # Do not set Reuse TIME-WAIT connections sockets 11 | # http://harish11g.blogspot.fr/2012/03/varnish-aws-ec2-performance-tuning.html 12 | net.ipv4.tcp_tw_reuse = 0 13 | # More queue for the network device 14 | net.core.netdev_max_backlog=6000 15 | # Lots of local ports for connections 16 | net.ipv4.tcp_max_tw_buckets=300000 17 | # Bump up send/receive buffer sizes 18 | net.core.rmem_default=262141 19 | net.core.wmem_default=262141 20 | net.core.rmem_max=262141 21 | net.core.wmem_max=262141 22 | # Tune TCP 23 | net.ipv4.tcp_rmem = 4096 131072 262141 24 | net.ipv4.tcp_wmem = 4096 131072 262141 25 | net.ipv4.tcp_sack=0 26 | net.ipv4.tcp_dsack=0 27 | net.ipv4.tcp_no_metrics_save = 1 28 | net.ipv4.tcp_window_scaling = 1 29 | net.ipv4.tcp_timestamps = 1 30 | net.ipv4.tcp_retries2=5 31 | net.ipv4.tcp_fin_timeout=60 32 | net.ipv4.tcp_keepalive_time=120 33 | net.ipv4.tcp_keepalive_intvl=30 34 | net.ipv4.tcp_keepalive_probes=3 35 | # Increase the number of incoming connections 36 | net.core.somaxconn=4096 37 | net.ipv4.tcp_max_syn_backlog=2048 38 | 39 | -------------------------------------------------------------------------------- /nginx/global/cache.conf: -------------------------------------------------------------------------------- 1 | # Define default caching of 24h 2 | expires 86400s; 3 | add_header Pragma public; 4 | add_header Cache-Control "max-age=86400, public, must-revalidate, proxy-revalidate"; 5 | 6 | # Rewrite for versioned CSS+JS via filemtime 7 | location ~* ^.+\.(css|js)$ { 8 | rewrite ^(.+)\.(\d+)\.(css|js)$ $1.$3 last; 9 | expires 31536000s; 10 | access_log off; 11 | log_not_found off; 12 | add_header Pragma public; 13 | add_header Cache-Control "max-age=31536000, public"; 14 | } 15 | 16 | # Aggressive caching for static files 17 | location ~* \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe| 18 | gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg| 19 | mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|otf|pdf|png|pot|pps| 20 | ppt|pptx|ra|ram|svg|svgz|swf|tar|t?gz|tif|tiff|ttf|wav|webm|wma|woff| 21 | wri|xla|xls|xlsx|xlt|xlw|zip)$ { 22 | expires 31536000s; 23 | access_log off; 24 | log_not_found off; 25 | add_header Pragma public; 26 | add_header Cache-Control "max-age=31536000, public"; 27 | } 28 | -------------------------------------------------------------------------------- /nginx/global/php-fpm.conf: -------------------------------------------------------------------------------- 1 | # PHP scripts -> PHP-FPM server listening on 127.0.0.1:9000 2 | location ~ \.php$ { 3 | # The following line prevents malicious php code to be executed through some uploaded file (without php extension, like image) 4 | # This fix shoudn't work though, if nginx and php are not on the same server, other options exist (like unauthorizing php execution within upload folder) 5 | # More on this serious security concern in the "Pass Non-PHP Requests to PHP" section, there http://wiki.nginx.org/Pitfalls 6 | try_files $uri =404; 7 | 8 | # PHP 9 | # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini 10 | fastcgi_pass 127.0.0.1:9000; 11 | fastcgi_index index.php; 12 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 13 | include fastcgi_params; 14 | fastcgi_param QUERY_STRING $query_string; 15 | fastcgi_param REQUEST_METHOD $request_method; 16 | fastcgi_param CONTENT_TYPE $content_type; 17 | fastcgi_param CONTENT_LENGTH $content_length; 18 | fastcgi_intercept_errors on; 19 | fastcgi_ignore_client_abort off; 20 | fastcgi_connect_timeout 60; 21 | fastcgi_send_timeout 180; 22 | fastcgi_read_timeout 180; 23 | fastcgi_buffers 4 256k; 24 | fastcgi_buffer_size 128k; 25 | fastcgi_busy_buffers_size 256k; 26 | fastcgi_temp_file_write_size 256k; 27 | } 28 | -------------------------------------------------------------------------------- /nginx/global/security.conf: -------------------------------------------------------------------------------- 1 | # Global restrictions configuration file. 2 | 3 | location = /favicon.ico { 4 | log_not_found off; 5 | access_log off; 6 | } 7 | 8 | location = /robots.txt { 9 | allow all; 10 | log_not_found off; 11 | access_log off; 12 | } 13 | 14 | location ~ /(\.|wp-config.php|readme.html|license.txt) { 15 | return 404; 16 | } 17 | 18 | location ~ /\. { 19 | deny all; 20 | access_log off; 21 | log_not_found off; 22 | } 23 | -------------------------------------------------------------------------------- /nginx/global/status.conf: -------------------------------------------------------------------------------- 1 | location /nginx_status { 2 | stub_status on; 3 | access_log off; 4 | allow 127.0.0.1; 5 | deny all; 6 | } 7 | -------------------------------------------------------------------------------- /nginx/global/wordpress-w3-total-cache.conf: -------------------------------------------------------------------------------- 1 | gzip on; 2 | gzip_types text/css application/x-javascript text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon; 3 | location ~ \.(css|js)$ { 4 | expires max; 5 | break; 6 | } 7 | location ~ \.(rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$ { 8 | expires 3600; 9 | break; 10 | } 11 | location ~ \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ { 12 | expires max; 13 | break; 14 | } 15 | add_header "X-UA-Compatible" "IE=Edge,chrome=1"; 16 | -------------------------------------------------------------------------------- /nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | 3 | # Set this value to 1 or N with N = N-Core 4 | worker_processes auto; 5 | worker_rlimit_nofile 8192; 6 | events { 7 | # max_clients = worker_processes * worker_connections 8 | worker_connections 1024; 9 | # Only for Linux 2.6 or > 10 | use epoll; 11 | # Accept as many connections as possible 12 | multi_accept on; 13 | } 14 | 15 | http { 16 | # Mime types 17 | include mime.types; 18 | default_type application/octet-stream; 19 | 20 | # Log format 21 | set_real_ip_from 127.0.0.1; 22 | real_ip_header X-Forwarded-For; 23 | log_format main '$remote_addr - $remote_user [$time_local] $status ' 24 | '"$request" $body_bytes_sent "$http_referer" ' 25 | '"$http_user_agent" "$http_x_forwarded_for"'; 26 | 27 | # Hide the Nginx version number 28 | server_tokens off; 29 | 30 | # Some tweeks... 31 | sendfile on; 32 | tcp_nodelay on; 33 | #tcp_nopush on; 34 | 35 | # Timeouts 36 | #keepalive_timeout 10 10; 37 | keepalive_timeout 65; 38 | client_body_timeout 30; 39 | client_header_timeout 30; 40 | send_timeout 30; 41 | client_max_body_size 8M; 42 | reset_timedout_connection on; 43 | 44 | # Gzip module configuration 45 | gzip on; 46 | gzip_disable "MSIE [1-6].(?!.*SV1)"; 47 | gzip_vary on; 48 | gzip_comp_level 3; 49 | gzip_proxied any; 50 | gzip_buffers 16 8k; 51 | 52 | # Put the Ip of your varnish/proxy here 53 | set_real_ip_from 127.0.0.1; 54 | # Put the Header that your varnish/proxy set 55 | real_ip_header X-Forwarded-For; 56 | 57 | 58 | include /etc/nginx/conf.d/*.conf; 59 | include /etc/nginx/sites-enabled/*; 60 | } 61 | -------------------------------------------------------------------------------- /nginx/site-configuration/wordpress: -------------------------------------------------------------------------------- 1 | server { 2 | listen 8080; 3 | 4 | server_name www.yourblogname.com; 5 | root /var/www/www.yourblogname.com; 6 | index index.php index.html index.htm; 7 | 8 | access_log /var/log/nginx/www.yourblogname.access_log; 9 | error_log /var/log/nginx/www.yourblogname.error_log; 10 | 11 | # Security 12 | include global/security.conf; 13 | 14 | location / { 15 | # This is cool because no php is touched for static content. 16 | # include the "?$args" part so non-default permalinks doesn't break when using query string 17 | try_files $uri $uri/ /index.php?$args; 18 | } 19 | 20 | # PHP-FPM 21 | include global/php-fpm.conf; 22 | 23 | # STATICS FILES 24 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 25 | expires max; 26 | log_not_found off; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /php-fpm/conf.d/apc.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php apc module 2 | extension=apc.so 3 | apc.stat = "0" 4 | apc.max_file_size = "1M" 5 | apc.localcache = "1" 6 | apc.localcache.size = "256" 7 | apc.shm_segments = "1" 8 | apc.ttl = "3600" 9 | apc.user_ttl = "7200" 10 | apc.gc_ttl = "3600" 11 | apc.cache_by_default = "1" 12 | apc.filters = "" 13 | apc.write_lock = "1" 14 | apc.num_files_hint= "512" 15 | apc.user_entries_hint="4096" 16 | apc.shm_size = "256M" 17 | apc.mmap_file_mask=/tmp/apc.XXXXXX 18 | apc.include_once_override = "0" 19 | apc.file_update_protection="2" 20 | apc.canonicalize = "1" 21 | apc.report_autofilter="0" 22 | apc.stat_ctime="0" 23 | -------------------------------------------------------------------------------- /php-fpm/conf.d/curl.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php CURL module 2 | extension=curl.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/gd.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php GD module 2 | extension=gd.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/memcache.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php memcache module 2 | extension=memcache.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/mysql.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php MySQL module 2 | extension=mysql.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/mysqli.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php MySQL module 2 | extension=mysqli.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/pdo.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php PDO module 2 | extension=pdo.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/pdo_mysql.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php MySQL module 2 | extension=pdo_mysql.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/pdo_sqlite.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php SQLite module 2 | extension=pdo_sqlite.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/redis.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php redis module 2 | extension=redis.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/sqlite.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php SQLite module 2 | extension=sqlite.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/sqlite3.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php SQLite3 module 2 | extension=sqlite3.so 3 | -------------------------------------------------------------------------------- /php-fpm/conf.d/suhosin.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php suhosin module 2 | extension=suhosin.so 3 | suhosin.executor.include.whitelist="phar" 4 | -------------------------------------------------------------------------------- /php-fpm/conf.d/xcache.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php xcache module 2 | ; extension=xcache.so 3 | -------------------------------------------------------------------------------- /php-fpm/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;; 2 | ; FPM Configuration ; 3 | ;;;;;;;;;;;;;;;;;;;;; 4 | 5 | ; All relative paths in this configuration file are relative to PHP's install 6 | ; prefix (/usr). This prefix can be dynamicaly changed by using the 7 | ; '-p' argument from the command line. 8 | 9 | ; Include one or more files. If glob(3) exists, it is used to include a bunch of 10 | ; files from a glob(3) pattern. This directive can be used everywhere in the 11 | ; file. 12 | ; Relative path can also be used. They will be prefixed by: 13 | ; - the global prefix if it's been set (-p arguement) 14 | ; - /usr otherwise 15 | ;include=/etc/php5/fpm/*.conf 16 | 17 | ;;;;;;;;;;;;;;;;;; 18 | ; Global Options ; 19 | ;;;;;;;;;;;;;;;;;; 20 | 21 | [global] 22 | ; Pid file 23 | ; Note: the default prefix is /var 24 | ; Default Value: none 25 | pid = /var/run/php5-fpm.pid 26 | 27 | ; Error log file 28 | ; If it's set to "syslog", log is sent to syslogd instead of being written 29 | ; in a local file. 30 | ; Note: the default prefix is /var 31 | ; Default Value: log/php-fpm.log 32 | error_log = /var/log/php5-fpm.log 33 | 34 | ; syslog_facility is used to specify what type of program is logging the 35 | ; message. This lets syslogd specify that messages from different facilities 36 | ; will be handled differently. 37 | ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) 38 | ; Default Value: daemon 39 | ;syslog.facility = daemon 40 | 41 | ; syslog_ident is prepended to every message. If you have multiple FPM 42 | ; instances running on the same server, you can change the default value 43 | ; which must suit common needs. 44 | ; Default Value: php-fpm 45 | ;syslog.ident = php-fpm 46 | 47 | ; Log level 48 | ; Possible Values: alert, error, warning, notice, debug 49 | ; Default Value: notice 50 | ;log_level = notice 51 | 52 | ; If this number of child processes exit with SIGSEGV or SIGBUS within the time 53 | ; interval set by emergency_restart_interval then FPM will restart. A value 54 | ; of '0' means 'Off'. 55 | ; Default Value: 0 56 | emergency_restart_threshold = 5 57 | 58 | ; Interval of time used by emergency_restart_interval to determine when 59 | ; a graceful restart will be initiated. This can be useful to work around 60 | ; accidental corruptions in an accelerator's shared memory. 61 | ; Available Units: s(econds), m(inutes), h(ours), or d(ays) 62 | ; Default Unit: seconds 63 | ; Default Value: 0 64 | emergency_restart_interval = 2m 65 | 66 | ; Time limit for child processes to wait for a reaction on signals from master. 67 | ; Available units: s(econds), m(inutes), h(ours), or d(ays) 68 | ; Default Unit: seconds 69 | ; Default Value: 0 70 | process_control_timeout = 10s 71 | 72 | ; The maximum number of processes FPM will fork. This has been design to control 73 | ; the global number of processes when using dynamic PM within a lot of pools. 74 | ; Use it with caution. 75 | ; Note: A value of 0 indicates no limit 76 | ; Default Value: 0 77 | ; process.max = 128 78 | 79 | ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. 80 | ; Default Value: yes 81 | ;daemonize = yes 82 | 83 | ; Set open file descriptor rlimit for the master process. 84 | ; Default Value: system defined value 85 | ;rlimit_files = 1024 86 | 87 | ; Set max core size rlimit for the master process. 88 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 89 | ; Default Value: system defined value 90 | ;rlimit_core = 0 91 | 92 | ; Specify the event mechanism FPM will use. The following is available: 93 | ; - select (any POSIX os) 94 | ; - poll (any POSIX os) 95 | ; - epoll (linux >= 2.5.44) 96 | ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) 97 | ; - /dev/poll (Solaris >= 7) 98 | ; - port (Solaris >= 10) 99 | ; Default Value: not set (auto detection) 100 | events.mechanism = epoll 101 | 102 | ;;;;;;;;;;;;;;;;;;;; 103 | ; Pool Definitions ; 104 | ;;;;;;;;;;;;;;;;;;;; 105 | 106 | ; Multiple pools of child processes may be started with different listening 107 | ; ports and different management options. The name of the pool will be 108 | ; used in logs and stats. There is no limitation on the number of pools which 109 | ; FPM can handle. Your system will tell you anyway :) 110 | 111 | ; To configure the pools it is recommended to have one .conf file per 112 | ; pool in the following directory: 113 | include=/etc/php5/fpm/pool.d/*.conf 114 | 115 | -------------------------------------------------------------------------------- /php-fpm/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ;;;;;;;;;;;;;;;;;;; 4 | ; About php.ini ; 5 | ;;;;;;;;;;;;;;;;;;; 6 | ; PHP's initialization file, generally called php.ini, is responsible for 7 | ; configuring many of the aspects of PHP's behavior. 8 | 9 | ; PHP attempts to find and load this configuration from a number of locations. 10 | ; The following is a summary of its search order: 11 | ; 1. SAPI module specific location. 12 | ; 2. The PHPRC environment variable. (As of PHP 5.2.0) 13 | ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) 14 | ; 4. Current working directory (except CLI) 15 | ; 5. The web server's directory (for SAPI modules), or directory of PHP 16 | ; (otherwise in Windows) 17 | ; 6. The directory from the --with-config-file-path compile time option, or the 18 | ; Windows directory (C:\windows or C:\winnt) 19 | ; See the PHP docs for more specific information. 20 | ; http://php.net/configuration.file 21 | 22 | ; The syntax of the file is extremely simple. Whitespace and Lines 23 | ; beginning with a semicolon are silently ignored (as you probably guessed). 24 | ; Section headers (e.g. [Foo]) are also silently ignored, even though 25 | ; they might mean something in the future. 26 | 27 | ; Directives following the section heading [PATH=/www/mysite] only 28 | ; apply to PHP files in the /www/mysite directory. Directives 29 | ; following the section heading [HOST=www.example.com] only apply to 30 | ; PHP files served from www.example.com. Directives set in these 31 | ; special sections cannot be overridden by user-defined INI files or 32 | ; at runtime. Currently, [PATH=] and [HOST=] sections only work under 33 | ; CGI/FastCGI. 34 | ; http://php.net/ini.sections 35 | 36 | ; Directives are specified using the following syntax: 37 | ; directive = value 38 | ; Directive names are *case sensitive* - foo=bar is different from FOO=bar. 39 | ; Directives are variables used to configure PHP or PHP extensions. 40 | ; There is no name validation. If PHP can't find an expected 41 | ; directive because it is not set or is mistyped, a default value will be used. 42 | 43 | ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one 44 | ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression 45 | ; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a 46 | ; previously set variable or directive (e.g. ${foo}) 47 | 48 | ; Expressions in the INI file are limited to bitwise operators and parentheses: 49 | ; | bitwise OR 50 | ; ^ bitwise XOR 51 | ; & bitwise AND 52 | ; ~ bitwise NOT 53 | ; ! boolean NOT 54 | 55 | ; Boolean flags can be turned on using the values 1, On, True or Yes. 56 | ; They can be turned off using the values 0, Off, False or No. 57 | 58 | ; An empty string can be denoted by simply not writing anything after the equal 59 | ; sign, or by using the None keyword: 60 | 61 | ; foo = ; sets foo to an empty string 62 | ; foo = None ; sets foo to an empty string 63 | ; foo = "None" ; sets foo to the string 'None' 64 | 65 | ; If you use constants in your value, and these constants belong to a 66 | ; dynamically loaded extension (either a PHP extension or a Zend extension), 67 | ; you may only use these constants *after* the line that loads the extension. 68 | 69 | ;;;;;;;;;;;;;;;;;;; 70 | ; About this file ; 71 | ;;;;;;;;;;;;;;;;;;; 72 | ; PHP comes packaged with two INI files. One that is recommended to be used 73 | ; in production environments and one that is recommended to be used in 74 | ; development environments. 75 | 76 | ; php.ini-production contains settings which hold security, performance and 77 | ; best practices at its core. But please be aware, these settings may break 78 | ; compatibility with older or less security conscience applications. We 79 | ; recommending using the production ini in production and testing environments. 80 | 81 | ; php.ini-development is very similar to its production variant, except it's 82 | ; much more verbose when it comes to errors. We recommending using the 83 | ; development version only in development environments as errors shown to 84 | ; application users can inadvertently leak otherwise secure information. 85 | 86 | ;;;;;;;;;;;;;;;;;;; 87 | ; Quick Reference ; 88 | ;;;;;;;;;;;;;;;;;;; 89 | ; The following are all the settings which are different in either the production 90 | ; or development versions of the INIs with respect to PHP's default behavior. 91 | ; Please see the actual settings later in the document for more details as to why 92 | ; we recommend these changes in PHP's behavior. 93 | 94 | ; allow_call_time_pass_reference 95 | ; Default Value: On 96 | ; Development Value: Off 97 | ; Production Value: Off 98 | 99 | ; display_errors 100 | ; Default Value: On 101 | ; Development Value: On 102 | ; Production Value: Off 103 | 104 | ; display_startup_errors 105 | ; Default Value: Off 106 | ; Development Value: On 107 | ; Production Value: Off 108 | 109 | ; error_reporting 110 | ; Default Value: E_ALL & ~E_NOTICE 111 | ; Development Value: E_ALL | E_STRICT 112 | ; Production Value: E_ALL & ~E_DEPRECATED 113 | 114 | ; html_errors 115 | ; Default Value: On 116 | ; Development Value: On 117 | ; Production value: Off 118 | 119 | ; log_errors 120 | ; Default Value: Off 121 | ; Development Value: On 122 | ; Production Value: On 123 | 124 | ; magic_quotes_gpc 125 | ; Default Value: On 126 | ; Development Value: Off 127 | ; Production Value: Off 128 | 129 | ; max_input_time 130 | ; Default Value: -1 (Unlimited) 131 | ; Development Value: 60 (60 seconds) 132 | ; Production Value: 60 (60 seconds) 133 | 134 | ; output_buffering 135 | ; Default Value: Off 136 | ; Development Value: 4096 137 | ; Production Value: 4096 138 | 139 | ; register_argc_argv 140 | ; Default Value: On 141 | ; Development Value: Off 142 | ; Production Value: Off 143 | 144 | ; register_long_arrays 145 | ; Default Value: On 146 | ; Development Value: Off 147 | ; Production Value: Off 148 | 149 | ; request_order 150 | ; Default Value: None 151 | ; Development Value: "GP" 152 | ; Production Value: "GP" 153 | 154 | ; session.bug_compat_42 155 | ; Default Value: On 156 | ; Development Value: On 157 | ; Production Value: Off 158 | 159 | ; session.bug_compat_warn 160 | ; Default Value: On 161 | ; Development Value: On 162 | ; Production Value: Off 163 | 164 | ; session.gc_divisor 165 | ; Default Value: 100 166 | ; Development Value: 1000 167 | ; Production Value: 1000 168 | 169 | ; session.hash_bits_per_character 170 | ; Default Value: 4 171 | ; Development Value: 5 172 | ; Production Value: 5 173 | 174 | ; short_open_tag 175 | ; Default Value: On 176 | ; Development Value: Off 177 | ; Production Value: Off 178 | 179 | ; track_errors 180 | ; Default Value: Off 181 | ; Development Value: On 182 | ; Production Value: Off 183 | 184 | ; url_rewriter.tags 185 | ; Default Value: "a=href,area=href,frame=src,form=,fieldset=" 186 | ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 187 | ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 188 | 189 | ; variables_order 190 | ; Default Value: "EGPCS" 191 | ; Development Value: "GPCS" 192 | ; Production Value: "GPCS" 193 | 194 | ;;;;;;;;;;;;;;;;;;;; 195 | ; php.ini Options ; 196 | ;;;;;;;;;;;;;;;;;;;; 197 | ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" 198 | ;user_ini.filename = ".user.ini" 199 | 200 | ; To disable this feature set this option to empty value 201 | ;user_ini.filename = 202 | 203 | ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) 204 | ;user_ini.cache_ttl = 300 205 | 206 | ;;;;;;;;;;;;;;;;;;;; 207 | ; Language Options ; 208 | ;;;;;;;;;;;;;;;;;;;; 209 | 210 | ; Enable the PHP scripting language engine under Apache. 211 | ; http://php.net/engine 212 | engine = On 213 | 214 | ; This directive determines whether or not PHP will recognize code between 215 | ; tags as PHP source which should be processed as such. It's been 216 | ; recommended for several years that you not use the short tag "short cut" and 217 | ; instead to use the full tag combination. With the wide spread use 218 | ; of XML and use of these tags by other languages, the server can become easily 219 | ; confused and end up parsing the wrong code in the wrong context. But because 220 | ; this short cut has been a feature for such a long time, it's currently still 221 | ; supported for backwards compatibility, but we recommend you don't use them. 222 | ; Default Value: On 223 | ; Development Value: Off 224 | ; Production Value: Off 225 | ; http://php.net/short-open-tag 226 | short_open_tag = Off 227 | 228 | ; Allow ASP-style <% %> tags. 229 | ; http://php.net/asp-tags 230 | asp_tags = Off 231 | 232 | ; The number of significant digits displayed in floating point numbers. 233 | ; http://php.net/precision 234 | precision = 14 235 | 236 | ; Enforce year 2000 compliance (will cause problems with non-compliant browsers) 237 | ; http://php.net/y2k-compliance 238 | y2k_compliance = On 239 | 240 | ; Output buffering is a mechanism for controlling how much output data 241 | ; (excluding headers and cookies) PHP should keep internally before pushing that 242 | ; data to the client. If your application's output exceeds this setting, PHP 243 | ; will send that data in chunks of roughly the size you specify. 244 | ; Turning on this setting and managing its maximum buffer size can yield some 245 | ; interesting side-effects depending on your application and web server. 246 | ; You may be able to send headers and cookies after you've already sent output 247 | ; through print or echo. You also may see performance benefits if your server is 248 | ; emitting less packets due to buffered output versus PHP streaming the output 249 | ; as it gets it. On production servers, 4096 bytes is a good setting for performance 250 | ; reasons. 251 | ; Note: Output buffering can also be controlled via Output Buffering Control 252 | ; functions. 253 | ; Possible Values: 254 | ; On = Enabled and buffer is unlimited. (Use with caution) 255 | ; Off = Disabled 256 | ; Integer = Enables the buffer and sets its maximum size in bytes. 257 | ; Note: This directive is hardcoded to Off for the CLI SAPI 258 | ; Default Value: Off 259 | ; Development Value: 4096 260 | ; Production Value: 4096 261 | ; http://php.net/output-buffering 262 | output_buffering = 4096 263 | 264 | ; You can redirect all of the output of your scripts to a function. For 265 | ; example, if you set output_handler to "mb_output_handler", character 266 | ; encoding will be transparently converted to the specified encoding. 267 | ; Setting any output handler automatically turns on output buffering. 268 | ; Note: People who wrote portable scripts should not depend on this ini 269 | ; directive. Instead, explicitly set the output handler using ob_start(). 270 | ; Using this ini directive may cause problems unless you know what script 271 | ; is doing. 272 | ; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler" 273 | ; and you cannot use both "ob_gzhandler" and "zlib.output_compression". 274 | ; Note: output_handler must be empty if this is set 'On' !!!! 275 | ; Instead you must use zlib.output_handler. 276 | ; http://php.net/output-handler 277 | ;output_handler = 278 | 279 | ; Transparent output compression using the zlib library 280 | ; Valid values for this option are 'off', 'on', or a specific buffer size 281 | ; to be used for compression (default is 4KB) 282 | ; Note: Resulting chunk size may vary due to nature of compression. PHP 283 | ; outputs chunks that are few hundreds bytes each as a result of 284 | ; compression. If you prefer a larger chunk size for better 285 | ; performance, enable output_buffering in addition. 286 | ; Note: You need to use zlib.output_handler instead of the standard 287 | ; output_handler, or otherwise the output will be corrupted. 288 | ; http://php.net/zlib.output-compression 289 | zlib.output_compression = Off 290 | 291 | ; http://php.net/zlib.output-compression-level 292 | ;zlib.output_compression_level = -1 293 | 294 | ; You cannot specify additional output handlers if zlib.output_compression 295 | ; is activated here. This setting does the same as output_handler but in 296 | ; a different order. 297 | ; http://php.net/zlib.output-handler 298 | ;zlib.output_handler = 299 | 300 | ; Implicit flush tells PHP to tell the output layer to flush itself 301 | ; automatically after every output block. This is equivalent to calling the 302 | ; PHP function flush() after each and every call to print() or echo() and each 303 | ; and every HTML block. Turning this option on has serious performance 304 | ; implications and is generally recommended for debugging purposes only. 305 | ; http://php.net/implicit-flush 306 | ; Note: This directive is hardcoded to On for the CLI SAPI 307 | implicit_flush = Off 308 | 309 | ; The unserialize callback function will be called (with the undefined class' 310 | ; name as parameter), if the unserializer finds an undefined class 311 | ; which should be instantiated. A warning appears if the specified function is 312 | ; not defined, or if the function doesn't include/implement the missing class. 313 | ; So only set this entry, if you really want to implement such a 314 | ; callback-function. 315 | unserialize_callback_func = 316 | 317 | ; When floats & doubles are serialized store serialize_precision significant 318 | ; digits after the floating point. The default value ensures that when floats 319 | ; are decoded with unserialize, the data will remain the same. 320 | serialize_precision = 17 321 | 322 | ; This directive allows you to enable and disable warnings which PHP will issue 323 | ; if you pass a value by reference at function call time. Passing values by 324 | ; reference at function call time is a deprecated feature which will be removed 325 | ; from PHP at some point in the near future. The acceptable method for passing a 326 | ; value by reference to a function is by declaring the reference in the functions 327 | ; definition, not at call time. This directive does not disable this feature, it 328 | ; only determines whether PHP will warn you about it or not. These warnings 329 | ; should enabled in development environments only. 330 | ; Default Value: On (Suppress warnings) 331 | ; Development Value: Off (Issue warnings) 332 | ; Production Value: Off (Issue warnings) 333 | ; http://php.net/allow-call-time-pass-reference 334 | allow_call_time_pass_reference = Off 335 | 336 | ; Safe Mode 337 | ; http://php.net/safe-mode 338 | safe_mode = Off 339 | 340 | ; By default, Safe Mode does a UID compare check when 341 | ; opening files. If you want to relax this to a GID compare, 342 | ; then turn on safe_mode_gid. 343 | ; http://php.net/safe-mode-gid 344 | safe_mode_gid = Off 345 | 346 | ; When safe_mode is on, UID/GID checks are bypassed when 347 | ; including files from this directory and its subdirectories. 348 | ; (directory must also be in include_path or full path must 349 | ; be used when including) 350 | ; http://php.net/safe-mode-include-dir 351 | safe_mode_include_dir = 352 | 353 | ; When safe_mode is on, only executables located in the safe_mode_exec_dir 354 | ; will be allowed to be executed via the exec family of functions. 355 | ; http://php.net/safe-mode-exec-dir 356 | safe_mode_exec_dir = 357 | 358 | ; Setting certain environment variables may be a potential security breach. 359 | ; This directive contains a comma-delimited list of prefixes. In Safe Mode, 360 | ; the user may only alter environment variables whose names begin with the 361 | ; prefixes supplied here. By default, users will only be able to set 362 | ; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR). 363 | ; Note: If this directive is empty, PHP will let the user modify ANY 364 | ; environment variable! 365 | ; http://php.net/safe-mode-allowed-env-vars 366 | safe_mode_allowed_env_vars = PHP_ 367 | 368 | ; This directive contains a comma-delimited list of environment variables that 369 | ; the end user won't be able to change using putenv(). These variables will be 370 | ; protected even if safe_mode_allowed_env_vars is set to allow to change them. 371 | ; http://php.net/safe-mode-protected-env-vars 372 | safe_mode_protected_env_vars = LD_LIBRARY_PATH 373 | 374 | ; open_basedir, if set, limits all file operations to the defined directory 375 | ; and below. This directive makes most sense if used in a per-directory 376 | ; or per-virtualhost web server configuration file. This directive is 377 | ; *NOT* affected by whether Safe Mode is turned On or Off. 378 | ; http://php.net/open-basedir 379 | ;open_basedir = 380 | 381 | ; This directive allows you to disable certain functions for security reasons. 382 | ; It receives a comma-delimited list of function names. This directive is 383 | ; *NOT* affected by whether Safe Mode is turned On or Off. 384 | ; http://php.net/disable-functions 385 | disable_functions = 386 | 387 | ; This directive allows you to disable certain classes for security reasons. 388 | ; It receives a comma-delimited list of class names. This directive is 389 | ; *NOT* affected by whether Safe Mode is turned On or Off. 390 | ; http://php.net/disable-classes 391 | disable_classes = 392 | 393 | ; Colors for Syntax Highlighting mode. Anything that's acceptable in 394 | ; would work. 395 | ; http://php.net/syntax-highlighting 396 | ;highlight.string = #DD0000 397 | ;highlight.comment = #FF9900 398 | ;highlight.keyword = #007700 399 | ;highlight.bg = #FFFFFF 400 | ;highlight.default = #0000BB 401 | ;highlight.html = #000000 402 | 403 | ; If enabled, the request will be allowed to complete even if the user aborts 404 | ; the request. Consider enabling it if executing long requests, which may end up 405 | ; being interrupted by the user or a browser timing out. PHP's default behavior 406 | ; is to disable this feature. 407 | ; http://php.net/ignore-user-abort 408 | ;ignore_user_abort = On 409 | 410 | ; Determines the size of the realpath cache to be used by PHP. This value should 411 | ; be increased on systems where PHP opens many files to reflect the quantity of 412 | ; the file operations performed. 413 | ; http://php.net/realpath-cache-size 414 | ;realpath_cache_size = 16k 415 | 416 | ; Duration of time, in seconds for which to cache realpath information for a given 417 | ; file or directory. For systems with rarely changing files, consider increasing this 418 | ; value. 419 | ; http://php.net/realpath-cache-ttl 420 | ;realpath_cache_ttl = 120 421 | 422 | ;;;;;;;;;;;;;;;;; 423 | ; Miscellaneous ; 424 | ;;;;;;;;;;;;;;;;; 425 | 426 | ; Decides whether PHP may expose the fact that it is installed on the server 427 | ; (e.g. by adding its signature to the Web server header). It is no security 428 | ; threat in any way, but it makes it possible to determine whether you use PHP 429 | ; on your server or not. 430 | ; http://php.net/expose-php 431 | expose_php = Off 432 | 433 | ;;;;;;;;;;;;;;;;;;; 434 | ; Resource Limits ; 435 | ;;;;;;;;;;;;;;;;;;; 436 | 437 | ; Maximum execution time of each script, in seconds 438 | ; http://php.net/max-execution-time 439 | ; Note: This directive is hardcoded to 0 for the CLI SAPI 440 | max_execution_time = 30 441 | 442 | ; Maximum amount of time each script may spend parsing request data. It's a good 443 | ; idea to limit this time on productions servers in order to eliminate unexpectedly 444 | ; long running scripts. 445 | ; Note: This directive is hardcoded to -1 for the CLI SAPI 446 | ; Default Value: -1 (Unlimited) 447 | ; Development Value: 60 (60 seconds) 448 | ; Production Value: 60 (60 seconds) 449 | ; http://php.net/max-input-time 450 | max_input_time = 60 451 | 452 | ; Maximum input variable nesting level 453 | ; http://php.net/max-input-nesting-level 454 | ;max_input_nesting_level = 64 455 | 456 | ; Maximum amount of memory a script may consume (128MB) 457 | ; http://php.net/memory-limit 458 | memory_limit = 128M 459 | 460 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 461 | ; Error handling and logging ; 462 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 463 | 464 | ; This directive informs PHP of which errors, warnings and notices you would like 465 | ; it to take action for. The recommended way of setting values for this 466 | ; directive is through the use of the error level constants and bitwise 467 | ; operators. The error level constants are below here for convenience as well as 468 | ; some common settings and their meanings. 469 | ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT 470 | ; those related to E_NOTICE and E_STRICT, which together cover best practices and 471 | ; recommended coding standards in PHP. For performance reasons, this is the 472 | ; recommend error reporting setting. Your production server shouldn't be wasting 473 | ; resources complaining about best practices and coding standards. That's what 474 | ; development servers and development settings are for. 475 | ; Note: The php.ini-development file has this setting as E_ALL | E_STRICT. This 476 | ; means it pretty much reports everything which is exactly what you want during 477 | ; development and early testing. 478 | ; 479 | ; Error Level Constants: 480 | ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 6.0.0) 481 | ; E_ERROR - fatal run-time errors 482 | ; E_RECOVERABLE_ERROR - almost fatal run-time errors 483 | ; E_WARNING - run-time warnings (non-fatal errors) 484 | ; E_PARSE - compile-time parse errors 485 | ; E_NOTICE - run-time notices (these are warnings which often result 486 | ; from a bug in your code, but it's possible that it was 487 | ; intentional (e.g., using an uninitialized variable and 488 | ; relying on the fact it's automatically initialized to an 489 | ; empty string) 490 | ; E_STRICT - run-time notices, enable to have PHP suggest changes 491 | ; to your code which will ensure the best interoperability 492 | ; and forward compatibility of your code 493 | ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup 494 | ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's 495 | ; initial startup 496 | ; E_COMPILE_ERROR - fatal compile-time errors 497 | ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) 498 | ; E_USER_ERROR - user-generated error message 499 | ; E_USER_WARNING - user-generated warning message 500 | ; E_USER_NOTICE - user-generated notice message 501 | ; E_DEPRECATED - warn about code that will not work in future versions 502 | ; of PHP 503 | ; E_USER_DEPRECATED - user-generated deprecation warnings 504 | ; 505 | ; Common Values: 506 | ; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.) 507 | ; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices) 508 | ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) 509 | ; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.) 510 | ; Default Value: E_ALL & ~E_NOTICE 511 | ; Development Value: E_ALL | E_STRICT 512 | ; Production Value: E_ALL & ~E_DEPRECATED 513 | ; http://php.net/error-reporting 514 | error_reporting = E_ALL & ~E_DEPRECATED 515 | 516 | ; This directive controls whether or not and where PHP will output errors, 517 | ; notices and warnings too. Error output is very useful during development, but 518 | ; it could be very dangerous in production environments. Depending on the code 519 | ; which is triggering the error, sensitive information could potentially leak 520 | ; out of your application such as database usernames and passwords or worse. 521 | ; It's recommended that errors be logged on production servers rather than 522 | ; having the errors sent to STDOUT. 523 | ; Possible Values: 524 | ; Off = Do not display any errors 525 | ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) 526 | ; On or stdout = Display errors to STDOUT 527 | ; Default Value: On 528 | ; Development Value: On 529 | ; Production Value: Off 530 | ; http://php.net/display-errors 531 | display_errors = Off 532 | 533 | ; The display of errors which occur during PHP's startup sequence are handled 534 | ; separately from display_errors. PHP's default behavior is to suppress those 535 | ; errors from clients. Turning the display of startup errors on can be useful in 536 | ; debugging configuration problems. But, it's strongly recommended that you 537 | ; leave this setting off on production servers. 538 | ; Default Value: Off 539 | ; Development Value: On 540 | ; Production Value: Off 541 | ; http://php.net/display-startup-errors 542 | display_startup_errors = Off 543 | 544 | ; Besides displaying errors, PHP can also log errors to locations such as a 545 | ; server-specific log, STDERR, or a location specified by the error_log 546 | ; directive found below. While errors should not be displayed on productions 547 | ; servers they should still be monitored and logging is a great way to do that. 548 | ; Default Value: Off 549 | ; Development Value: On 550 | ; Production Value: On 551 | ; http://php.net/log-errors 552 | log_errors = On 553 | 554 | ; Set maximum length of log_errors. In error_log information about the source is 555 | ; added. The default is 1024 and 0 allows to not apply any maximum length at all. 556 | ; http://php.net/log-errors-max-len 557 | log_errors_max_len = 1024 558 | 559 | ; Do not log repeated messages. Repeated errors must occur in same file on same 560 | ; line unless ignore_repeated_source is set true. 561 | ; http://php.net/ignore-repeated-errors 562 | ignore_repeated_errors = Off 563 | 564 | ; Ignore source of message when ignoring repeated messages. When this setting 565 | ; is On you will not log errors with repeated messages from different files or 566 | ; source lines. 567 | ; http://php.net/ignore-repeated-source 568 | ignore_repeated_source = Off 569 | 570 | ; If this parameter is set to Off, then memory leaks will not be shown (on 571 | ; stdout or in the log). This has only effect in a debug compile, and if 572 | ; error reporting includes E_WARNING in the allowed list 573 | ; http://php.net/report-memleaks 574 | report_memleaks = On 575 | 576 | ; This setting is on by default. 577 | ;report_zend_debug = 0 578 | 579 | ; Store the last error/warning message in $php_errormsg (boolean). Setting this value 580 | ; to On can assist in debugging and is appropriate for development servers. It should 581 | ; however be disabled on production servers. 582 | ; Default Value: Off 583 | ; Development Value: On 584 | ; Production Value: Off 585 | ; http://php.net/track-errors 586 | track_errors = Off 587 | 588 | ; Turn off normal error reporting and emit XML-RPC error XML 589 | ; http://php.net/xmlrpc-errors 590 | ;xmlrpc_errors = 0 591 | 592 | ; An XML-RPC faultCode 593 | ;xmlrpc_error_number = 0 594 | 595 | ; When PHP displays or logs an error, it has the capability of inserting html 596 | ; links to documentation related to that error. This directive controls whether 597 | ; those HTML links appear in error messages or not. For performance and security 598 | ; reasons, it's recommended you disable this on production servers. 599 | ; Note: This directive is hardcoded to Off for the CLI SAPI 600 | ; Default Value: On 601 | ; Development Value: On 602 | ; Production value: Off 603 | ; http://php.net/html-errors 604 | html_errors = Off 605 | 606 | ; If html_errors is set On PHP produces clickable error messages that direct 607 | ; to a page describing the error or function causing the error in detail. 608 | ; You can download a copy of the PHP manual from http://php.net/docs 609 | ; and change docref_root to the base URL of your local copy including the 610 | ; leading '/'. You must also specify the file extension being used including 611 | ; the dot. PHP's default behavior is to leave these settings empty. 612 | ; Note: Never use this feature for production boxes. 613 | ; http://php.net/docref-root 614 | ; Examples 615 | ;docref_root = "/phpmanual/" 616 | 617 | ; http://php.net/docref-ext 618 | ;docref_ext = .html 619 | 620 | ; String to output before an error message. PHP's default behavior is to leave 621 | ; this setting blank. 622 | ; http://php.net/error-prepend-string 623 | ; Example: 624 | ;error_prepend_string = "" 625 | 626 | ; String to output after an error message. PHP's default behavior is to leave 627 | ; this setting blank. 628 | ; http://php.net/error-append-string 629 | ; Example: 630 | ;error_append_string = "" 631 | 632 | ; Log errors to specified file. PHP's default behavior is to leave this value 633 | ; empty. 634 | ; http://php.net/error-log 635 | ; Example: 636 | ;error_log = php_errors.log 637 | ; Log errors to syslog (Event Log on NT, not valid in Windows 95). 638 | ;error_log = syslog 639 | 640 | ;;;;;;;;;;;;;;;;; 641 | ; Data Handling ; 642 | ;;;;;;;;;;;;;;;;; 643 | 644 | ; The separator used in PHP generated URLs to separate arguments. 645 | ; PHP's default setting is "&". 646 | ; http://php.net/arg-separator.output 647 | ; Example: 648 | ;arg_separator.output = "&" 649 | 650 | ; List of separator(s) used by PHP to parse input URLs into variables. 651 | ; PHP's default setting is "&". 652 | ; NOTE: Every character in this directive is considered as separator! 653 | ; http://php.net/arg-separator.input 654 | ; Example: 655 | ;arg_separator.input = ";&" 656 | 657 | ; This directive determines which super global arrays are registered when PHP 658 | ; starts up. If the register_globals directive is enabled, it also determines 659 | ; what order variables are populated into the global space. G,P,C,E & S are 660 | ; abbreviations for the following respective super globals: GET, POST, COOKIE, 661 | ; ENV and SERVER. There is a performance penalty paid for the registration of 662 | ; these arrays and because ENV is not as commonly used as the others, ENV is 663 | ; is not recommended on productions servers. You can still get access to 664 | ; the environment variables through getenv() should you need to. 665 | ; Default Value: "EGPCS" 666 | ; Development Value: "GPCS" 667 | ; Production Value: "GPCS"; 668 | ; http://php.net/variables-order 669 | variables_order = "GPCS" 670 | 671 | ; This directive determines which super global data (G,P,C,E & S) should 672 | ; be registered into the super global array REQUEST. If so, it also determines 673 | ; the order in which that data is registered. The values for this directive are 674 | ; specified in the same manner as the variables_order directive, EXCEPT one. 675 | ; Leaving this value empty will cause PHP to use the value set in the 676 | ; variables_order directive. It does not mean it will leave the super globals 677 | ; array REQUEST empty. 678 | ; Default Value: None 679 | ; Development Value: "GP" 680 | ; Production Value: "GP" 681 | ; http://php.net/request-order 682 | request_order = "GP" 683 | 684 | ; Whether or not to register the EGPCS variables as global variables. You may 685 | ; want to turn this off if you don't want to clutter your scripts' global scope 686 | ; with user data. 687 | ; You should do your best to write your scripts so that they do not require 688 | ; register_globals to be on; Using form variables as globals can easily lead 689 | ; to possible security problems, if the code is not very well thought of. 690 | ; http://php.net/register-globals 691 | register_globals = Off 692 | 693 | ; Determines whether the deprecated long $HTTP_*_VARS type predefined variables 694 | ; are registered by PHP or not. As they are deprecated, we obviously don't 695 | ; recommend you use them. They are on by default for compatibility reasons but 696 | ; they are not recommended on production servers. 697 | ; Default Value: On 698 | ; Development Value: Off 699 | ; Production Value: Off 700 | ; http://php.net/register-long-arrays 701 | register_long_arrays = Off 702 | 703 | ; This directive determines whether PHP registers $argv & $argc each time it 704 | ; runs. $argv contains an array of all the arguments passed to PHP when a script 705 | ; is invoked. $argc contains an integer representing the number of arguments 706 | ; that were passed when the script was invoked. These arrays are extremely 707 | ; useful when running scripts from the command line. When this directive is 708 | ; enabled, registering these variables consumes CPU cycles and memory each time 709 | ; a script is executed. For performance reasons, this feature should be disabled 710 | ; on production servers. 711 | ; Note: This directive is hardcoded to On for the CLI SAPI 712 | ; Default Value: On 713 | ; Development Value: Off 714 | ; Production Value: Off 715 | ; http://php.net/register-argc-argv 716 | register_argc_argv = Off 717 | 718 | ; When enabled, the SERVER and ENV variables are created when they're first 719 | ; used (Just In Time) instead of when the script starts. If these variables 720 | ; are not used within a script, having this directive on will result in a 721 | ; performance gain. The PHP directives register_globals, register_long_arrays, 722 | ; and register_argc_argv must be disabled for this directive to have any affect. 723 | ; http://php.net/auto-globals-jit 724 | auto_globals_jit = On 725 | 726 | ; Maximum size of POST data that PHP will accept. 727 | ; http://php.net/post-max-size 728 | post_max_size = 8M 729 | 730 | ; Magic quotes are a preprocessing feature of PHP where PHP will attempt to 731 | ; escape any character sequences in GET, POST, COOKIE and ENV data which might 732 | ; otherwise corrupt data being placed in resources such as databases before 733 | ; making that data available to you. Because of character encoding issues and 734 | ; non-standard SQL implementations across many databases, it's not currently 735 | ; possible for this feature to be 100% accurate. PHP's default behavior is to 736 | ; enable the feature. We strongly recommend you use the escaping mechanisms 737 | ; designed specifically for the database your using instead of relying on this 738 | ; feature. Also note, this feature has been deprecated as of PHP 5.3.0 and is 739 | ; scheduled for removal in PHP 6. 740 | ; Default Value: On 741 | ; Development Value: Off 742 | ; Production Value: Off 743 | ; http://php.net/magic-quotes-gpc 744 | magic_quotes_gpc = Off 745 | 746 | ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc. 747 | ; http://php.net/magic-quotes-runtime 748 | magic_quotes_runtime = Off 749 | 750 | ; Use Sybase-style magic quotes (escape ' with '' instead of \'). 751 | ; http://php.net/magic-quotes-sybase 752 | magic_quotes_sybase = Off 753 | 754 | ; Automatically add files before PHP document. 755 | ; http://php.net/auto-prepend-file 756 | auto_prepend_file = 757 | 758 | ; Automatically add files after PHP document. 759 | ; http://php.net/auto-append-file 760 | auto_append_file = 761 | 762 | ; By default, PHP will output a character encoding using 763 | ; the Content-type: header. To disable sending of the charset, simply 764 | ; set it to be empty. 765 | ; 766 | ; PHP's built-in default is text/html 767 | ; http://php.net/default-mimetype 768 | default_mimetype = "text/html" 769 | 770 | ; PHP's default character set is set to empty. 771 | ; http://php.net/default-charset 772 | default_charset = "utf-8" 773 | 774 | ; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is 775 | ; to disable this feature. 776 | ; http://php.net/always-populate-raw-post-data 777 | ;always_populate_raw_post_data = On 778 | 779 | ;;;;;;;;;;;;;;;;;;;;;;;;; 780 | ; Paths and Directories ; 781 | ;;;;;;;;;;;;;;;;;;;;;;;;; 782 | 783 | ; UNIX: "/path1:/path2" 784 | ;include_path = ".:/usr/share/php" 785 | ; 786 | ; Windows: "\path1;\path2" 787 | ;include_path = ".;c:\php\includes" 788 | ; 789 | ; PHP's default setting for include_path is ".;/path/to/php/pear" 790 | ; http://php.net/include-path 791 | 792 | ; The root of the PHP pages, used only if nonempty. 793 | ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root 794 | ; if you are running php as a CGI under any web server (other than IIS) 795 | ; see documentation for security issues. The alternate is to use the 796 | ; cgi.force_redirect configuration below 797 | ; http://php.net/doc-root 798 | doc_root = 799 | 800 | ; The directory under which PHP opens the script using /~username used only 801 | ; if nonempty. 802 | ; http://php.net/user-dir 803 | user_dir = 804 | 805 | ; Directory in which the loadable extensions (modules) reside. 806 | ; http://php.net/extension-dir 807 | ; extension_dir = "./" 808 | ; On windows: 809 | ; extension_dir = "ext" 810 | 811 | ; Whether or not to enable the dl() function. The dl() function does NOT work 812 | ; properly in multithreaded servers, such as IIS or Zeus, and is automatically 813 | ; disabled on them. 814 | ; http://php.net/enable-dl 815 | enable_dl = Off 816 | 817 | ; cgi.force_redirect is necessary to provide security running PHP as a CGI under 818 | ; most web servers. Left undefined, PHP turns this on by default. You can 819 | ; turn it off here AT YOUR OWN RISK 820 | ; **You CAN safely turn this off for IIS, in fact, you MUST.** 821 | ; http://php.net/cgi.force-redirect 822 | ;cgi.force_redirect = 1 823 | 824 | ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with 825 | ; every request. PHP's default behavior is to disable this feature. 826 | ;cgi.nph = 1 827 | 828 | ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 829 | ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP 830 | ; will look for to know it is OK to continue execution. Setting this variable MAY 831 | ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. 832 | ; http://php.net/cgi.redirect-status-env 833 | ;cgi.redirect_status_env = ; 834 | 835 | ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's 836 | ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok 837 | ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting 838 | ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting 839 | ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts 840 | ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. 841 | ; http://php.net/cgi.fix-pathinfo 842 | cgi.fix_pathinfo=0 843 | 844 | ; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate 845 | ; security tokens of the calling client. This allows IIS to define the 846 | ; security context that the request runs under. mod_fastcgi under Apache 847 | ; does not currently support this feature (03/17/2002) 848 | ; Set to 1 if running under IIS. Default is zero. 849 | ; http://php.net/fastcgi.impersonate 850 | ;fastcgi.impersonate = 1; 851 | 852 | ; Disable logging through FastCGI connection. PHP's default behavior is to enable 853 | ; this feature. 854 | ;fastcgi.logging = 0 855 | 856 | ; cgi.rfc2616_headers configuration option tells PHP what type of headers to 857 | ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that 858 | ; is supported by Apache. When this option is set to 1 PHP will send 859 | ; RFC2616 compliant header. 860 | ; Default is zero. 861 | ; http://php.net/cgi.rfc2616-headers 862 | ;cgi.rfc2616_headers = 0 863 | 864 | ;;;;;;;;;;;;;;;; 865 | ; File Uploads ; 866 | ;;;;;;;;;;;;;;;; 867 | 868 | ; Whether to allow HTTP file uploads. 869 | ; http://php.net/file-uploads 870 | file_uploads = On 871 | 872 | ; Temporary directory for HTTP uploaded files (will use system default if not 873 | ; specified). 874 | ; http://php.net/upload-tmp-dir 875 | ;upload_tmp_dir = 876 | 877 | ; Maximum allowed size for uploaded files. 878 | ; http://php.net/upload-max-filesize 879 | upload_max_filesize = 64M 880 | 881 | ; Maximum number of files that can be uploaded via a single request 882 | max_file_uploads = 20 883 | 884 | ;;;;;;;;;;;;;;;;;; 885 | ; Fopen wrappers ; 886 | ;;;;;;;;;;;;;;;;;; 887 | 888 | ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. 889 | ; http://php.net/allow-url-fopen 890 | allow_url_fopen = Off 891 | 892 | ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. 893 | ; http://php.net/allow-url-include 894 | allow_url_include = Off 895 | 896 | ; Define the anonymous ftp password (your email address). PHP's default setting 897 | ; for this is empty. 898 | ; http://php.net/from 899 | ;from="john@doe.com" 900 | 901 | ; Define the User-Agent string. PHP's default setting for this is empty. 902 | ; http://php.net/user-agent 903 | ;user_agent="PHP" 904 | 905 | ; Default timeout for socket based streams (seconds) 906 | ; http://php.net/default-socket-timeout 907 | default_socket_timeout = 30 908 | 909 | ; If your scripts have to deal with files from Macintosh systems, 910 | ; or you are running on a Mac and need to deal with files from 911 | ; unix or win32 systems, setting this flag will cause PHP to 912 | ; automatically detect the EOL character in those files so that 913 | ; fgets() and file() will work regardless of the source of the file. 914 | ; http://php.net/auto-detect-line-endings 915 | ;auto_detect_line_endings = Off 916 | 917 | ;;;;;;;;;;;;;;;;;;;;;; 918 | ; Dynamic Extensions ; 919 | ;;;;;;;;;;;;;;;;;;;;;; 920 | 921 | ; If you wish to have an extension loaded automatically, use the following 922 | ; syntax: 923 | ; 924 | ; extension=modulename.extension 925 | ; 926 | ; For example, on Windows: 927 | ; 928 | ; extension=msql.dll 929 | ; 930 | ; ... or under UNIX: 931 | ; 932 | ; extension=msql.so 933 | ; 934 | ; ... or with a path: 935 | ; 936 | ; extension=/path/to/extension/msql.so 937 | ; 938 | ; If you only provide the name of the extension, PHP will look for it in its 939 | ; default extension directory. 940 | 941 | ;;;;;;;;;;;;;;;;;;; 942 | ; Module Settings ; 943 | ;;;;;;;;;;;;;;;;;;; 944 | 945 | [Date] 946 | ; Defines the default timezone used by the date functions 947 | ; http://php.net/date.timezone 948 | date.timezone = 'Europe/Paris' 949 | 950 | ; http://php.net/date.default-latitude 951 | ;date.default_latitude = 31.7667 952 | 953 | ; http://php.net/date.default-longitude 954 | ;date.default_longitude = 35.2333 955 | 956 | ; http://php.net/date.sunrise-zenith 957 | ;date.sunrise_zenith = 90.583333 958 | 959 | ; http://php.net/date.sunset-zenith 960 | ;date.sunset_zenith = 90.583333 961 | 962 | [filter] 963 | ; http://php.net/filter.default 964 | ;filter.default = unsafe_raw 965 | 966 | ; http://php.net/filter.default-flags 967 | ;filter.default_flags = 968 | 969 | [iconv] 970 | ;iconv.input_encoding = ISO-8859-1 971 | ;iconv.internal_encoding = ISO-8859-1 972 | ;iconv.output_encoding = ISO-8859-1 973 | 974 | [intl] 975 | ;intl.default_locale = 976 | ; This directive allows you to produce PHP errors when some error 977 | ; happens within intl functions. The value is the level of the error produced. 978 | ; Default is 0, which does not produce any errors. 979 | ;intl.error_level = E_WARNING 980 | 981 | [sqlite] 982 | ; http://php.net/sqlite.assoc-case 983 | ;sqlite.assoc_case = 0 984 | 985 | [sqlite3] 986 | ;sqlite3.extension_dir = 987 | 988 | [Pcre] 989 | ;PCRE library backtracking limit. 990 | ; http://php.net/pcre.backtrack-limit 991 | ;pcre.backtrack_limit=100000 992 | 993 | ;PCRE library recursion limit. 994 | ;Please note that if you set this value to a high number you may consume all 995 | ;the available process stack and eventually crash PHP (due to reaching the 996 | ;stack size limit imposed by the Operating System). 997 | ; http://php.net/pcre.recursion-limit 998 | ;pcre.recursion_limit=100000 999 | 1000 | [Pdo] 1001 | ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" 1002 | ; http://php.net/pdo-odbc.connection-pooling 1003 | ;pdo_odbc.connection_pooling=strict 1004 | 1005 | ;pdo_odbc.db2_instance_name 1006 | 1007 | [Pdo_mysql] 1008 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1009 | ; http://php.net/pdo_mysql.cache_size 1010 | pdo_mysql.cache_size = 2000 1011 | 1012 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1013 | ; MySQL defaults. 1014 | ; http://php.net/pdo_mysql.default-socket 1015 | pdo_mysql.default_socket= 1016 | 1017 | [Phar] 1018 | ; http://php.net/phar.readonly 1019 | ;phar.readonly = On 1020 | 1021 | ; http://php.net/phar.require-hash 1022 | ;phar.require_hash = On 1023 | 1024 | ;phar.cache_list = 1025 | 1026 | [Syslog] 1027 | ; Whether or not to define the various syslog variables (e.g. $LOG_PID, 1028 | ; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In 1029 | ; runtime, you can define these variables by calling define_syslog_variables(). 1030 | ; http://php.net/define-syslog-variables 1031 | define_syslog_variables = Off 1032 | 1033 | [mail function] 1034 | ; For Win32 only. 1035 | ; http://php.net/smtp 1036 | SMTP = localhost 1037 | ; http://php.net/smtp-port 1038 | smtp_port = 25 1039 | 1040 | ; For Win32 only. 1041 | ; http://php.net/sendmail-from 1042 | ;sendmail_from = me@example.com 1043 | 1044 | ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). 1045 | ; http://php.net/sendmail-path 1046 | ;sendmail_path = 1047 | 1048 | ; Force the addition of the specified parameters to be passed as extra parameters 1049 | ; to the sendmail binary. These parameters will always replace the value of 1050 | ; the 5th parameter to mail(), even in safe mode. 1051 | ;mail.force_extra_parameters = 1052 | 1053 | ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename 1054 | mail.add_x_header = On 1055 | 1056 | ; The path to a log file that will log all mail() calls. Log entries include 1057 | ; the full path of the script, line number, To address and headers. 1058 | ;mail.log = 1059 | 1060 | [SQL] 1061 | ; http://php.net/sql.safe-mode 1062 | sql.safe_mode = Off 1063 | 1064 | [ODBC] 1065 | ; http://php.net/odbc.default-db 1066 | ;odbc.default_db = Not yet implemented 1067 | 1068 | ; http://php.net/odbc.default-user 1069 | ;odbc.default_user = Not yet implemented 1070 | 1071 | ; http://php.net/odbc.default-pw 1072 | ;odbc.default_pw = Not yet implemented 1073 | 1074 | ; Controls the ODBC cursor model. 1075 | ; Default: SQL_CURSOR_STATIC (default). 1076 | ;odbc.default_cursortype 1077 | 1078 | ; Allow or prevent persistent links. 1079 | ; http://php.net/odbc.allow-persistent 1080 | odbc.allow_persistent = Off 1081 | 1082 | ; Check that a connection is still valid before reuse. 1083 | ; http://php.net/odbc.check-persistent 1084 | odbc.check_persistent = On 1085 | 1086 | ; Maximum number of persistent links. -1 means no limit. 1087 | ; http://php.net/odbc.max-persistent 1088 | odbc.max_persistent = -1 1089 | 1090 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1091 | ; http://php.net/odbc.max-links 1092 | odbc.max_links = -1 1093 | 1094 | ; Handling of LONG fields. Returns number of bytes to variables. 0 means 1095 | ; passthru. 1096 | ; http://php.net/odbc.defaultlrl 1097 | odbc.defaultlrl = 4096 1098 | 1099 | ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. 1100 | ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation 1101 | ; of odbc.defaultlrl and odbc.defaultbinmode 1102 | ; http://php.net/odbc.defaultbinmode 1103 | odbc.defaultbinmode = 1 1104 | 1105 | ;birdstep.max_links = -1 1106 | 1107 | [Interbase] 1108 | ; Allow or prevent persistent links. 1109 | ibase.allow_persistent = 1 1110 | 1111 | ; Maximum number of persistent links. -1 means no limit. 1112 | ibase.max_persistent = -1 1113 | 1114 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1115 | ibase.max_links = -1 1116 | 1117 | ; Default database name for ibase_connect(). 1118 | ;ibase.default_db = 1119 | 1120 | ; Default username for ibase_connect(). 1121 | ;ibase.default_user = 1122 | 1123 | ; Default password for ibase_connect(). 1124 | ;ibase.default_password = 1125 | 1126 | ; Default charset for ibase_connect(). 1127 | ;ibase.default_charset = 1128 | 1129 | ; Default timestamp format. 1130 | ibase.timestampformat = "%Y-%m-%d %H:%M:%S" 1131 | 1132 | ; Default date format. 1133 | ibase.dateformat = "%Y-%m-%d" 1134 | 1135 | ; Default time format. 1136 | ibase.timeformat = "%H:%M:%S" 1137 | 1138 | [MySQL] 1139 | ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements 1140 | ; http://php.net/mysql.allow_local_infile 1141 | mysql.allow_local_infile = On 1142 | 1143 | ; Allow or prevent persistent links. 1144 | ; http://php.net/mysql.allow-persistent 1145 | mysql.allow_persistent = On 1146 | 1147 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1148 | ; http://php.net/mysql.cache_size 1149 | mysql.cache_size = 2000 1150 | 1151 | ; Maximum number of persistent links. -1 means no limit. 1152 | ; http://php.net/mysql.max-persistent 1153 | mysql.max_persistent = -1 1154 | 1155 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1156 | ; http://php.net/mysql.max-links 1157 | mysql.max_links = -1 1158 | 1159 | ; Default port number for mysql_connect(). If unset, mysql_connect() will use 1160 | ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the 1161 | ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look 1162 | ; at MYSQL_PORT. 1163 | ; http://php.net/mysql.default-port 1164 | mysql.default_port = 1165 | 1166 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1167 | ; MySQL defaults. 1168 | ; http://php.net/mysql.default-socket 1169 | mysql.default_socket = 1170 | 1171 | ; Default host for mysql_connect() (doesn't apply in safe mode). 1172 | ; http://php.net/mysql.default-host 1173 | mysql.default_host = 1174 | 1175 | ; Default user for mysql_connect() (doesn't apply in safe mode). 1176 | ; http://php.net/mysql.default-user 1177 | mysql.default_user = 1178 | 1179 | ; Default password for mysql_connect() (doesn't apply in safe mode). 1180 | ; Note that this is generally a *bad* idea to store passwords in this file. 1181 | ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") 1182 | ; and reveal this password! And of course, any users with read access to this 1183 | ; file will be able to reveal the password as well. 1184 | ; http://php.net/mysql.default-password 1185 | mysql.default_password = 1186 | 1187 | ; Maximum time (in seconds) for connect timeout. -1 means no limit 1188 | ; http://php.net/mysql.connect-timeout 1189 | mysql.connect_timeout = 60 1190 | 1191 | ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and 1192 | ; SQL-Errors will be displayed. 1193 | ; http://php.net/mysql.trace-mode 1194 | mysql.trace_mode = Off 1195 | 1196 | [MySQLi] 1197 | 1198 | ; Maximum number of persistent links. -1 means no limit. 1199 | ; http://php.net/mysqli.max-persistent 1200 | mysqli.max_persistent = -1 1201 | 1202 | ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements 1203 | ; http://php.net/mysqli.allow_local_infile 1204 | ;mysqli.allow_local_infile = On 1205 | 1206 | ; Allow or prevent persistent links. 1207 | ; http://php.net/mysqli.allow-persistent 1208 | mysqli.allow_persistent = On 1209 | 1210 | ; Maximum number of links. -1 means no limit. 1211 | ; http://php.net/mysqli.max-links 1212 | mysqli.max_links = -1 1213 | 1214 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1215 | ; http://php.net/mysqli.cache_size 1216 | mysqli.cache_size = 2000 1217 | 1218 | ; Default port number for mysqli_connect(). If unset, mysqli_connect() will use 1219 | ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the 1220 | ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look 1221 | ; at MYSQL_PORT. 1222 | ; http://php.net/mysqli.default-port 1223 | mysqli.default_port = 3306 1224 | 1225 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1226 | ; MySQL defaults. 1227 | ; http://php.net/mysqli.default-socket 1228 | mysqli.default_socket = 1229 | 1230 | ; Default host for mysql_connect() (doesn't apply in safe mode). 1231 | ; http://php.net/mysqli.default-host 1232 | mysqli.default_host = 1233 | 1234 | ; Default user for mysql_connect() (doesn't apply in safe mode). 1235 | ; http://php.net/mysqli.default-user 1236 | mysqli.default_user = 1237 | 1238 | ; Default password for mysqli_connect() (doesn't apply in safe mode). 1239 | ; Note that this is generally a *bad* idea to store passwords in this file. 1240 | ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") 1241 | ; and reveal this password! And of course, any users with read access to this 1242 | ; file will be able to reveal the password as well. 1243 | ; http://php.net/mysqli.default-pw 1244 | mysqli.default_pw = 1245 | 1246 | ; Allow or prevent reconnect 1247 | mysqli.reconnect = Off 1248 | 1249 | [mysqlnd] 1250 | ; Enable / Disable collection of general statstics by mysqlnd which can be 1251 | ; used to tune and monitor MySQL operations. 1252 | ; http://php.net/mysqlnd.collect_statistics 1253 | mysqlnd.collect_statistics = On 1254 | 1255 | ; Enable / Disable collection of memory usage statstics by mysqlnd which can be 1256 | ; used to tune and monitor MySQL operations. 1257 | ; http://php.net/mysqlnd.collect_memory_statistics 1258 | mysqlnd.collect_memory_statistics = Off 1259 | 1260 | ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. 1261 | ; http://php.net/mysqlnd.net_cmd_buffer_size 1262 | ;mysqlnd.net_cmd_buffer_size = 2048 1263 | 1264 | ; Size of a pre-allocated buffer used for reading data sent by the server in 1265 | ; bytes. 1266 | ; http://php.net/mysqlnd.net_read_buffer_size 1267 | ;mysqlnd.net_read_buffer_size = 32768 1268 | 1269 | [OCI8] 1270 | 1271 | ; Connection: Enables privileged connections using external 1272 | ; credentials (OCI_SYSOPER, OCI_SYSDBA) 1273 | ; http://php.net/oci8.privileged-connect 1274 | ;oci8.privileged_connect = Off 1275 | 1276 | ; Connection: The maximum number of persistent OCI8 connections per 1277 | ; process. Using -1 means no limit. 1278 | ; http://php.net/oci8.max-persistent 1279 | ;oci8.max_persistent = -1 1280 | 1281 | ; Connection: The maximum number of seconds a process is allowed to 1282 | ; maintain an idle persistent connection. Using -1 means idle 1283 | ; persistent connections will be maintained forever. 1284 | ; http://php.net/oci8.persistent-timeout 1285 | ;oci8.persistent_timeout = -1 1286 | 1287 | ; Connection: The number of seconds that must pass before issuing a 1288 | ; ping during oci_pconnect() to check the connection validity. When 1289 | ; set to 0, each oci_pconnect() will cause a ping. Using -1 disables 1290 | ; pings completely. 1291 | ; http://php.net/oci8.ping-interval 1292 | ;oci8.ping_interval = 60 1293 | 1294 | ; Connection: Set this to a user chosen connection class to be used 1295 | ; for all pooled server requests with Oracle 11g Database Resident 1296 | ; Connection Pooling (DRCP). To use DRCP, this value should be set to 1297 | ; the same string for all web servers running the same application, 1298 | ; the database pool must be configured, and the connection string must 1299 | ; specify to use a pooled server. 1300 | ;oci8.connection_class = 1301 | 1302 | ; High Availability: Using On lets PHP receive Fast Application 1303 | ; Notification (FAN) events generated when a database node fails. The 1304 | ; database must also be configured to post FAN events. 1305 | ;oci8.events = Off 1306 | 1307 | ; Tuning: This option enables statement caching, and specifies how 1308 | ; many statements to cache. Using 0 disables statement caching. 1309 | ; http://php.net/oci8.statement-cache-size 1310 | ;oci8.statement_cache_size = 20 1311 | 1312 | ; Tuning: Enables statement prefetching and sets the default number of 1313 | ; rows that will be fetched automatically after statement execution. 1314 | ; http://php.net/oci8.default-prefetch 1315 | ;oci8.default_prefetch = 100 1316 | 1317 | ; Compatibility. Using On means oci_close() will not close 1318 | ; oci_connect() and oci_new_connect() connections. 1319 | ; http://php.net/oci8.old-oci-close-semantics 1320 | ;oci8.old_oci_close_semantics = Off 1321 | 1322 | [PostgresSQL] 1323 | ; Allow or prevent persistent links. 1324 | ; http://php.net/pgsql.allow-persistent 1325 | pgsql.allow_persistent = On 1326 | 1327 | ; Detect broken persistent links always with pg_pconnect(). 1328 | ; Auto reset feature requires a little overheads. 1329 | ; http://php.net/pgsql.auto-reset-persistent 1330 | pgsql.auto_reset_persistent = Off 1331 | 1332 | ; Maximum number of persistent links. -1 means no limit. 1333 | ; http://php.net/pgsql.max-persistent 1334 | pgsql.max_persistent = -1 1335 | 1336 | ; Maximum number of links (persistent+non persistent). -1 means no limit. 1337 | ; http://php.net/pgsql.max-links 1338 | pgsql.max_links = -1 1339 | 1340 | ; Ignore PostgreSQL backends Notice message or not. 1341 | ; Notice message logging require a little overheads. 1342 | ; http://php.net/pgsql.ignore-notice 1343 | pgsql.ignore_notice = 0 1344 | 1345 | ; Log PostgreSQL backends Notice message or not. 1346 | ; Unless pgsql.ignore_notice=0, module cannot log notice message. 1347 | ; http://php.net/pgsql.log-notice 1348 | pgsql.log_notice = 0 1349 | 1350 | [Sybase-CT] 1351 | ; Allow or prevent persistent links. 1352 | ; http://php.net/sybct.allow-persistent 1353 | sybct.allow_persistent = On 1354 | 1355 | ; Maximum number of persistent links. -1 means no limit. 1356 | ; http://php.net/sybct.max-persistent 1357 | sybct.max_persistent = -1 1358 | 1359 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1360 | ; http://php.net/sybct.max-links 1361 | sybct.max_links = -1 1362 | 1363 | ; Minimum server message severity to display. 1364 | ; http://php.net/sybct.min-server-severity 1365 | sybct.min_server_severity = 10 1366 | 1367 | ; Minimum client message severity to display. 1368 | ; http://php.net/sybct.min-client-severity 1369 | sybct.min_client_severity = 10 1370 | 1371 | ; Set per-context timeout 1372 | ; http://php.net/sybct.timeout 1373 | ;sybct.timeout= 1374 | 1375 | ;sybct.packet_size 1376 | 1377 | ; The maximum time in seconds to wait for a connection attempt to succeed before returning failure. 1378 | ; Default: one minute 1379 | ;sybct.login_timeout= 1380 | 1381 | ; The name of the host you claim to be connecting from, for display by sp_who. 1382 | ; Default: none 1383 | ;sybct.hostname= 1384 | 1385 | ; Allows you to define how often deadlocks are to be retried. -1 means "forever". 1386 | ; Default: 0 1387 | ;sybct.deadlock_retry_count= 1388 | 1389 | [bcmath] 1390 | ; Number of decimal digits for all bcmath functions. 1391 | ; http://php.net/bcmath.scale 1392 | bcmath.scale = 0 1393 | 1394 | [browscap] 1395 | ; http://php.net/browscap 1396 | ;browscap = extra/browscap.ini 1397 | 1398 | [Session] 1399 | ; Handler used to store/retrieve data. 1400 | ; http://php.net/session.save-handler 1401 | ;session.save_handler = files 1402 | session.save_handler = redis 1403 | 1404 | ; Argument passed to save_handler. In the case of files, this is the path 1405 | ; where data files are stored. Note: Windows users have to change this 1406 | ; variable in order to use PHP's session functions. 1407 | ; 1408 | ; The path can be defined as: 1409 | ; 1410 | ; session.save_path = "N;/path" 1411 | ; 1412 | ; where N is an integer. Instead of storing all the session files in 1413 | ; /path, what this will do is use subdirectories N-levels deep, and 1414 | ; store the session data in those directories. This is useful if you 1415 | ; or your OS have problems with lots of files in one directory, and is 1416 | ; a more efficient layout for servers that handle lots of sessions. 1417 | ; 1418 | ; NOTE 1: PHP will not create this directory structure automatically. 1419 | ; You can use the script in the ext/session dir for that purpose. 1420 | ; NOTE 2: See the section on garbage collection below if you choose to 1421 | ; use subdirectories for session storage 1422 | ; 1423 | ; The file storage module creates files using mode 600 by default. 1424 | ; You can change that by using 1425 | ; 1426 | ; session.save_path = "N;MODE;/path" 1427 | ; 1428 | ; where MODE is the octal representation of the mode. Note that this 1429 | ; does not overwrite the process's umask. 1430 | ; http://php.net/session.save-path 1431 | ;session.save_path = "/tmp" 1432 | session.save_path = "tcp://127.0.0.1:6379?weight=1" 1433 | 1434 | ; Whether to use cookies. 1435 | ; http://php.net/session.use-cookies 1436 | session.use_cookies = 1 1437 | 1438 | ; http://php.net/session.cookie-secure 1439 | ;session.cookie_secure = 1440 | 1441 | ; This option forces PHP to fetch and use a cookie for storing and maintaining 1442 | ; the session id. We encourage this operation as it's very helpful in combatting 1443 | ; session hijacking when not specifying and managing your own session id. It is 1444 | ; not the end all be all of session hijacking defense, but it's a good start. 1445 | ; http://php.net/session.use-only-cookies 1446 | session.use_only_cookies = 1 1447 | 1448 | ; Name of the session (used as cookie name). 1449 | ; http://php.net/session.name 1450 | session.name = PHPSESSID 1451 | 1452 | ; Initialize session on request startup. 1453 | ; http://php.net/session.auto-start 1454 | session.auto_start = 0 1455 | 1456 | ; Lifetime in seconds of cookie or, if 0, until browser is restarted. 1457 | ; http://php.net/session.cookie-lifetime 1458 | session.cookie_lifetime = 0 1459 | 1460 | ; The path for which the cookie is valid. 1461 | ; http://php.net/session.cookie-path 1462 | session.cookie_path = / 1463 | 1464 | ; The domain for which the cookie is valid. 1465 | ; http://php.net/session.cookie-domain 1466 | session.cookie_domain = 1467 | 1468 | ; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. 1469 | ; http://php.net/session.cookie-httponly 1470 | session.cookie_httponly = 1471 | 1472 | ; Handler used to serialize data. php is the standard serializer of PHP. 1473 | ; http://php.net/session.serialize-handler 1474 | session.serialize_handler = php 1475 | 1476 | ; Defines the probability that the 'garbage collection' process is started 1477 | ; on every session initialization. The probability is calculated by using 1478 | ; gc_probability/gc_divisor. Where session.gc_probability is the numerator 1479 | ; and gc_divisor is the denominator in the equation. Setting this value to 1 1480 | ; when the session.gc_divisor value is 100 will give you approximately a 1% chance 1481 | ; the gc will run on any give request. 1482 | ; Default Value: 1 1483 | ; Development Value: 1 1484 | ; Production Value: 1 1485 | ; http://php.net/session.gc-probability 1486 | session.gc_probability = 1 1487 | 1488 | ; Defines the probability that the 'garbage collection' process is started on every 1489 | ; session initialization. The probability is calculated by using the following equation: 1490 | ; gc_probability/gc_divisor. Where session.gc_probability is the numerator and 1491 | ; session.gc_divisor is the denominator in the equation. Setting this value to 1 1492 | ; when the session.gc_divisor value is 100 will give you approximately a 1% chance 1493 | ; the gc will run on any give request. Increasing this value to 1000 will give you 1494 | ; a 0.1% chance the gc will run on any give request. For high volume production servers, 1495 | ; this is a more efficient approach. 1496 | ; Default Value: 100 1497 | ; Development Value: 1000 1498 | ; Production Value: 1000 1499 | ; http://php.net/session.gc-divisor 1500 | session.gc_divisor = 1000 1501 | 1502 | ; After this number of seconds, stored data will be seen as 'garbage' and 1503 | ; cleaned up by the garbage collection process. 1504 | ; http://php.net/session.gc-maxlifetime 1505 | session.gc_maxlifetime = 1440 1506 | 1507 | ; NOTE: If you are using the subdirectory option for storing session files 1508 | ; (see session.save_path above), then garbage collection does *not* 1509 | ; happen automatically. You will need to do your own garbage 1510 | ; collection through a shell script, cron entry, or some other method. 1511 | ; For example, the following script would is the equivalent of 1512 | ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): 1513 | ; find /path/to/sessions -cmin +24 | xargs rm 1514 | 1515 | ; PHP 4.2 and less have an undocumented feature/bug that allows you to 1516 | ; to initialize a session variable in the global scope, even when register_globals 1517 | ; is disabled. PHP 4.3 and later will warn you, if this feature is used. 1518 | ; You can disable the feature and the warning separately. At this time, 1519 | ; the warning is only displayed, if bug_compat_42 is enabled. This feature 1520 | ; introduces some serious security problems if not handled correctly. It's 1521 | ; recommended that you do not use this feature on production servers. But you 1522 | ; should enable this on development servers and enable the warning as well. If you 1523 | ; do not enable the feature on development servers, you won't be warned when it's 1524 | ; used and debugging errors caused by this can be difficult to track down. 1525 | ; Default Value: On 1526 | ; Development Value: On 1527 | ; Production Value: Off 1528 | ; http://php.net/session.bug-compat-42 1529 | session.bug_compat_42 = Off 1530 | 1531 | ; This setting controls whether or not you are warned by PHP when initializing a 1532 | ; session value into the global space. session.bug_compat_42 must be enabled before 1533 | ; these warnings can be issued by PHP. See the directive above for more information. 1534 | ; Default Value: On 1535 | ; Development Value: On 1536 | ; Production Value: Off 1537 | ; http://php.net/session.bug-compat-warn 1538 | session.bug_compat_warn = Off 1539 | 1540 | ; Check HTTP Referer to invalidate externally stored URLs containing ids. 1541 | ; HTTP_REFERER has to contain this substring for the session to be 1542 | ; considered as valid. 1543 | ; http://php.net/session.referer-check 1544 | session.referer_check = 1545 | 1546 | ; How many bytes to read from the file. 1547 | ; http://php.net/session.entropy-length 1548 | session.entropy_length = 0 1549 | 1550 | ; Specified here to create the session id. 1551 | ; http://php.net/session.entropy-file 1552 | ; On systems that don't have /dev/urandom /dev/arandom can be used 1553 | ; On windows, setting the entropy_length setting will activate the 1554 | ; Windows random source (using the CryptoAPI) 1555 | ;session.entropy_file = /dev/urandom 1556 | 1557 | ; Set to {nocache,private,public,} to determine HTTP caching aspects 1558 | ; or leave this empty to avoid sending anti-caching headers. 1559 | ; http://php.net/session.cache-limiter 1560 | session.cache_limiter = nocache 1561 | 1562 | ; Document expires after n minutes. 1563 | ; http://php.net/session.cache-expire 1564 | session.cache_expire = 180 1565 | 1566 | ; trans sid support is disabled by default. 1567 | ; Use of trans sid may risk your users security. 1568 | ; Use this option with caution. 1569 | ; - User may send URL contains active session ID 1570 | ; to other person via. email/irc/etc. 1571 | ; - URL that contains active session ID may be stored 1572 | ; in publically accessible computer. 1573 | ; - User may access your site with the same session ID 1574 | ; always using URL stored in browser's history or bookmarks. 1575 | ; http://php.net/session.use-trans-sid 1576 | session.use_trans_sid = 0 1577 | 1578 | ; Select a hash function for use in generating session ids. 1579 | ; Possible Values 1580 | ; 0 (MD5 128 bits) 1581 | ; 1 (SHA-1 160 bits) 1582 | ; This option may also be set to the name of any hash function supported by 1583 | ; the hash extension. A list of available hashes is returned by the hash_algos() 1584 | ; function. 1585 | ; http://php.net/session.hash-function 1586 | session.hash_function = 0 1587 | 1588 | ; Define how many bits are stored in each character when converting 1589 | ; the binary hash data to something readable. 1590 | ; Possible values: 1591 | ; 4 (4 bits: 0-9, a-f) 1592 | ; 5 (5 bits: 0-9, a-v) 1593 | ; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") 1594 | ; Default Value: 4 1595 | ; Development Value: 5 1596 | ; Production Value: 5 1597 | ; http://php.net/session.hash-bits-per-character 1598 | session.hash_bits_per_character = 5 1599 | 1600 | ; The URL rewriter will look for URLs in a defined set of HTML tags. 1601 | ; form/fieldset are special; if you include them here, the rewriter will 1602 | ; add a hidden field with the info which is otherwise appended 1603 | ; to URLs. If you want XHTML conformity, remove the form entry. 1604 | ; Note that all valid entries require a "=", even if no value follows. 1605 | ; Default Value: "a=href,area=href,frame=src,form=,fieldset=" 1606 | ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 1607 | ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 1608 | ; http://php.net/url-rewriter.tags 1609 | url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" 1610 | 1611 | [MSSQL] 1612 | ; Allow or prevent persistent links. 1613 | mssql.allow_persistent = On 1614 | 1615 | ; Maximum number of persistent links. -1 means no limit. 1616 | mssql.max_persistent = -1 1617 | 1618 | ; Maximum number of links (persistent+non persistent). -1 means no limit. 1619 | mssql.max_links = -1 1620 | 1621 | ; Minimum error severity to display. 1622 | mssql.min_error_severity = 10 1623 | 1624 | ; Minimum message severity to display. 1625 | mssql.min_message_severity = 10 1626 | 1627 | ; Compatibility mode with old versions of PHP 3.0. 1628 | mssql.compatability_mode = Off 1629 | 1630 | ; Connect timeout 1631 | ;mssql.connect_timeout = 5 1632 | 1633 | ; Query timeout 1634 | ;mssql.timeout = 60 1635 | 1636 | ; Valid range 0 - 2147483647. Default = 4096. 1637 | ;mssql.textlimit = 4096 1638 | 1639 | ; Valid range 0 - 2147483647. Default = 4096. 1640 | ;mssql.textsize = 4096 1641 | 1642 | ; Limits the number of records in each batch. 0 = all records in one batch. 1643 | ;mssql.batchsize = 0 1644 | 1645 | ; Specify how datetime and datetim4 columns are returned 1646 | ; On => Returns data converted to SQL server settings 1647 | ; Off => Returns values as YYYY-MM-DD hh:mm:ss 1648 | ;mssql.datetimeconvert = On 1649 | 1650 | ; Use NT authentication when connecting to the server 1651 | mssql.secure_connection = Off 1652 | 1653 | ; Specify max number of processes. -1 = library default 1654 | ; msdlib defaults to 25 1655 | ; FreeTDS defaults to 4096 1656 | ;mssql.max_procs = -1 1657 | 1658 | ; Specify client character set. 1659 | ; If empty or not set the client charset from freetds.comf is used 1660 | ; This is only used when compiled with FreeTDS 1661 | ;mssql.charset = "ISO-8859-1" 1662 | 1663 | [Assertion] 1664 | ; Assert(expr); active by default. 1665 | ; http://php.net/assert.active 1666 | ;assert.active = On 1667 | 1668 | ; Issue a PHP warning for each failed assertion. 1669 | ; http://php.net/assert.warning 1670 | ;assert.warning = On 1671 | 1672 | ; Don't bail out by default. 1673 | ; http://php.net/assert.bail 1674 | ;assert.bail = Off 1675 | 1676 | ; User-function to be called if an assertion fails. 1677 | ; http://php.net/assert.callback 1678 | ;assert.callback = 0 1679 | 1680 | ; Eval the expression with current error_reporting(). Set to true if you want 1681 | ; error_reporting(0) around the eval(). 1682 | ; http://php.net/assert.quiet-eval 1683 | ;assert.quiet_eval = 0 1684 | 1685 | [COM] 1686 | ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs 1687 | ; http://php.net/com.typelib-file 1688 | ;com.typelib_file = 1689 | 1690 | ; allow Distributed-COM calls 1691 | ; http://php.net/com.allow-dcom 1692 | ;com.allow_dcom = true 1693 | 1694 | ; autoregister constants of a components typlib on com_load() 1695 | ; http://php.net/com.autoregister-typelib 1696 | ;com.autoregister_typelib = true 1697 | 1698 | ; register constants casesensitive 1699 | ; http://php.net/com.autoregister-casesensitive 1700 | ;com.autoregister_casesensitive = false 1701 | 1702 | ; show warnings on duplicate constant registrations 1703 | ; http://php.net/com.autoregister-verbose 1704 | ;com.autoregister_verbose = true 1705 | 1706 | ; The default character set code-page to use when passing strings to and from COM objects. 1707 | ; Default: system ANSI code page 1708 | ;com.code_page= 1709 | 1710 | [mbstring] 1711 | ; language for internal character representation. 1712 | ; http://php.net/mbstring.language 1713 | ;mbstring.language = Japanese 1714 | 1715 | ; internal/script encoding. 1716 | ; Some encoding cannot work as internal encoding. 1717 | ; (e.g. SJIS, BIG5, ISO-2022-*) 1718 | ; http://php.net/mbstring.internal-encoding 1719 | ;mbstring.internal_encoding = EUC-JP 1720 | 1721 | ; http input encoding. 1722 | ; http://php.net/mbstring.http-input 1723 | ;mbstring.http_input = auto 1724 | 1725 | ; http output encoding. mb_output_handler must be 1726 | ; registered as output buffer to function 1727 | ; http://php.net/mbstring.http-output 1728 | ;mbstring.http_output = SJIS 1729 | 1730 | ; enable automatic encoding translation according to 1731 | ; mbstring.internal_encoding setting. Input chars are 1732 | ; converted to internal encoding by setting this to On. 1733 | ; Note: Do _not_ use automatic encoding translation for 1734 | ; portable libs/applications. 1735 | ; http://php.net/mbstring.encoding-translation 1736 | ;mbstring.encoding_translation = Off 1737 | 1738 | ; automatic encoding detection order. 1739 | ; auto means 1740 | ; http://php.net/mbstring.detect-order 1741 | ;mbstring.detect_order = auto 1742 | 1743 | ; substitute_character used when character cannot be converted 1744 | ; one from another 1745 | ; http://php.net/mbstring.substitute-character 1746 | ;mbstring.substitute_character = none; 1747 | 1748 | ; overload(replace) single byte functions by mbstring functions. 1749 | ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), 1750 | ; etc. Possible values are 0,1,2,4 or combination of them. 1751 | ; For example, 7 for overload everything. 1752 | ; 0: No overload 1753 | ; 1: Overload mail() function 1754 | ; 2: Overload str*() functions 1755 | ; 4: Overload ereg*() functions 1756 | ; http://php.net/mbstring.func-overload 1757 | ;mbstring.func_overload = 0 1758 | 1759 | ; enable strict encoding detection. 1760 | ;mbstring.strict_detection = Off 1761 | 1762 | ; This directive specifies the regex pattern of content types for which mb_output_handler() 1763 | ; is activated. 1764 | ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) 1765 | ;mbstring.http_output_conv_mimetype= 1766 | 1767 | ; Allows to set script encoding. Only affects if PHP is compiled with --enable-zend-multibyte 1768 | ; Default: "" 1769 | ;mbstring.script_encoding= 1770 | 1771 | [gd] 1772 | ; Tell the jpeg decode to ignore warnings and try to create 1773 | ; a gd image. The warning will then be displayed as notices 1774 | ; disabled by default 1775 | ; http://php.net/gd.jpeg-ignore-warning 1776 | ;gd.jpeg_ignore_warning = 0 1777 | 1778 | [exif] 1779 | ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. 1780 | ; With mbstring support this will automatically be converted into the encoding 1781 | ; given by corresponding encode setting. When empty mbstring.internal_encoding 1782 | ; is used. For the decode settings you can distinguish between motorola and 1783 | ; intel byte order. A decode setting cannot be empty. 1784 | ; http://php.net/exif.encode-unicode 1785 | ;exif.encode_unicode = ISO-8859-15 1786 | 1787 | ; http://php.net/exif.decode-unicode-motorola 1788 | ;exif.decode_unicode_motorola = UCS-2BE 1789 | 1790 | ; http://php.net/exif.decode-unicode-intel 1791 | ;exif.decode_unicode_intel = UCS-2LE 1792 | 1793 | ; http://php.net/exif.encode-jis 1794 | ;exif.encode_jis = 1795 | 1796 | ; http://php.net/exif.decode-jis-motorola 1797 | ;exif.decode_jis_motorola = JIS 1798 | 1799 | ; http://php.net/exif.decode-jis-intel 1800 | ;exif.decode_jis_intel = JIS 1801 | 1802 | [Tidy] 1803 | ; The path to a default tidy configuration file to use when using tidy 1804 | ; http://php.net/tidy.default-config 1805 | ;tidy.default_config = /usr/local/lib/php/default.tcfg 1806 | 1807 | ; Should tidy clean and repair output automatically? 1808 | ; WARNING: Do not use this option if you are generating non-html content 1809 | ; such as dynamic images 1810 | ; http://php.net/tidy.clean-output 1811 | tidy.clean_output = Off 1812 | 1813 | [soap] 1814 | ; Enables or disables WSDL caching feature. 1815 | ; http://php.net/soap.wsdl-cache-enabled 1816 | soap.wsdl_cache_enabled=1 1817 | 1818 | ; Sets the directory name where SOAP extension will put cache files. 1819 | ; http://php.net/soap.wsdl-cache-dir 1820 | soap.wsdl_cache_dir="/tmp" 1821 | 1822 | ; (time to live) Sets the number of second while cached file will be used 1823 | ; instead of original one. 1824 | ; http://php.net/soap.wsdl-cache-ttl 1825 | soap.wsdl_cache_ttl=86400 1826 | 1827 | ; Sets the size of the cache limit. (Max. number of WSDL files to cache) 1828 | soap.wsdl_cache_limit = 5 1829 | 1830 | [sysvshm] 1831 | ; A default size of the shared memory segment 1832 | ;sysvshm.init_mem = 10000 1833 | 1834 | [ldap] 1835 | ; Sets the maximum number of open links or -1 for unlimited. 1836 | ldap.max_links = -1 1837 | 1838 | [mcrypt] 1839 | ; For more information about mcrypt settings see http://php.net/mcrypt-module-open 1840 | 1841 | ; Directory where to load mcrypt algorithms 1842 | ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) 1843 | ;mcrypt.algorithms_dir= 1844 | 1845 | ; Directory where to load mcrypt modes 1846 | ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) 1847 | ;mcrypt.modes_dir= 1848 | 1849 | [dba] 1850 | ;dba.default_handler= 1851 | 1852 | ; Local Variables: 1853 | ; tab-width: 4 1854 | ; End: 1855 | -------------------------------------------------------------------------------- /php-fpm/pool.d/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can we used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'slowlog' 9 | ; - 'listen' (unixsocket) 10 | ; - 'chroot' 11 | ; - 'chdir' 12 | ; - 'php_values' 13 | ; - 'php_admin_values' 14 | ; When not set, the global prefix (or /usr) applies instead. 15 | ; Note: This directive can also be relative to the global prefix. 16 | ; Default Value: none 17 | ;prefix = /path/to/pools/$pool 18 | 19 | ; Unix user/group of processes 20 | ; Note: The user is mandatory. If the group is not set, the default user's group 21 | ; will be used. 22 | user = www-data 23 | group = www-data 24 | 25 | ; The address on which to accept FastCGI requests. 26 | ; Valid syntaxes are: 27 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on 28 | ; a specific port; 29 | ; 'port' - to listen on a TCP socket to all addresses on a 30 | ; specific port; 31 | ; '/path/to/unix/socket' - to listen on a unix socket. 32 | ; Note: This value is mandatory. 33 | listen = 127.0.0.1:9000 34 | 35 | ; Set listen(2) backlog. A value of '-1' means unlimited. 36 | ; Default Value: 128 (-1 on FreeBSD and OpenBSD) 37 | ;listen.backlog = -1 38 | 39 | ; List of ipv4 addresses of FastCGI clients which are allowed to connect. 40 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 41 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 42 | ; must be separated by a comma. If this value is left blank, connections will be 43 | ; accepted from any ip address. 44 | ; Default Value: any 45 | listen.allowed_clients = 127.0.0.1 46 | 47 | ; Choose how the process manager will control the number of child processes. 48 | ; Possible Values: 49 | ; static - a fixed number (pm.max_children) of child processes; 50 | ; dynamic - the number of child processes are set dynamically based on the 51 | ; following directives. With this process management, there will be 52 | ; always at least 1 children. 53 | ; pm.max_children - the maximum number of children that can 54 | ; be alive at the same time. 55 | ; pm.start_servers - the number of children created on startup. 56 | ; pm.min_spare_servers - the minimum number of children in 'idle' 57 | ; state (waiting to process). If the number 58 | ; of 'idle' processes is less than this 59 | ; number then some children will be created. 60 | ; pm.max_spare_servers - the maximum number of children in 'idle' 61 | ; state (waiting to process). If the number 62 | ; of 'idle' processes is greater than this 63 | ; number then some children will be killed. 64 | ; ondemand - no children are created at startup. Children will be forked when 65 | ; new requests will connect. The following parameter are used: 66 | ; pm.max_children - the maximum number of children that 67 | ; can be alive at the same time. 68 | ; pm.process_idle_timeout - The number of seconds after which 69 | ; an idle process will be killed. 70 | ; Note: This value is mandatory. 71 | pm = dynamic 72 | 73 | ; The number of child processes to be created when pm is set to 'static' and the 74 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 75 | ; This value sets the limit on the number of simultaneous requests that will be 76 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 77 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 78 | ; CGI. The below defaults are based on a server without much resources. Don't 79 | ; forget to tweak pm.* to fit your needs. 80 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 81 | ; Note: This value is mandatory. 82 | pm.max_children = 50 83 | 84 | ; The number of child processes created on startup. 85 | ; Note: Used only when pm is set to 'dynamic' 86 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 87 | pm.start_servers = 15 88 | 89 | ; The desired minimum number of idle server processes. 90 | ; Note: Used only when pm is set to 'dynamic' 91 | ; Note: Mandatory when pm is set to 'dynamic' 92 | pm.min_spare_servers = 5 93 | 94 | ; The desired maximum number of idle server processes. 95 | ; Note: Used only when pm is set to 'dynamic' 96 | ; Note: Mandatory when pm is set to 'dynamic' 97 | pm.max_spare_servers = 25 98 | 99 | ; The number of seconds after which an idle process will be killed. 100 | ; Note: Used only when pm is set to 'ondemand' 101 | ; Default Value: 10s 102 | pm.process_idle_timeout = 60s 103 | 104 | ; The number of requests each child process should execute before respawning. 105 | ; This can be useful to work around memory leaks in 3rd party libraries. For 106 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 107 | ; Default Value: 0 108 | ;pm.max_requests = 500 109 | 110 | ; The URI to view the FPM status page. If this value is not set, no URI will be 111 | ; recognized as a status page. It shows the following informations: 112 | ; pool - the name of the pool; 113 | ; process manager - static, dynamic or ondemand; 114 | ; start time - the date and time FPM has started; 115 | ; start since - number of seconds since FPM has started; 116 | ; accepted conn - the number of request accepted by the pool; 117 | ; listen queue - the number of request in the queue of pending 118 | ; connections (see backlog in listen(2)); 119 | ; max listen queue - the maximum number of requests in the queue 120 | ; of pending connections since FPM has started; 121 | ; listen queue len - the size of the socket queue of pending connections; 122 | ; idle processes - the number of idle processes; 123 | ; active processes - the number of active processes; 124 | ; total processes - the number of idle + active processes; 125 | ; max active processes - the maximum number of active processes since FPM 126 | ; has started; 127 | ; max children reached - number of times, the process limit has been reached, 128 | ; when pm tries to start more children (works only for 129 | ; pm 'dynamic' and 'ondemand'); 130 | ; Value are updated in real time. 131 | ; Example output: 132 | ; pool: www 133 | ; process manager: static 134 | ; start time: 01/Jul/2011:17:53:49 +0200 135 | ; start since: 62636 136 | ; accepted conn: 190460 137 | ; listen queue: 0 138 | ; max listen queue: 1 139 | ; listen queue len: 42 140 | ; idle processes: 4 141 | ; active processes: 11 142 | ; total processes: 15 143 | ; max active processes: 12 144 | ; max children reached: 0 145 | ; 146 | ; By default the status page output is formatted as text/plain. Passing either 147 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 148 | ; output syntax. Example: 149 | ; http://www.foo.bar/status 150 | ; http://www.foo.bar/status?json 151 | ; http://www.foo.bar/status?html 152 | ; http://www.foo.bar/status?xml 153 | ; 154 | ; By default the status page only outputs short status. Passing 'full' in the 155 | ; query string will also return status for each pool process. 156 | ; Example: 157 | ; http://www.foo.bar/status?full 158 | ; http://www.foo.bar/status?json&full 159 | ; http://www.foo.bar/status?html&full 160 | ; http://www.foo.bar/status?xml&full 161 | ; The Full status returns for each process: 162 | ; pid - the PID of the process; 163 | ; state - the state of the process (Idle, Running, ...); 164 | ; start time - the date and time the process has started; 165 | ; start since - the number of seconds since the process has started; 166 | ; requests - the number of requests the process has served; 167 | ; request duration - the duration in µs of the requests; 168 | ; request method - the request method (GET, POST, ...); 169 | ; request URI - the request URI with the query string; 170 | ; content length - the content length of the request (only with POST); 171 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 172 | ; script - the main script called (or '-' if not set); 173 | ; last request cpu - the %cpu the last request consumed 174 | ; it's always 0 if the process is not in Idle state 175 | ; because CPU calculation is done when the request 176 | ; processing has terminated; 177 | ; last request memory - the max amount of memory the last request consumed 178 | ; it's always 0 if the process is not in Idle state 179 | ; because memory calculation is done when the request 180 | ; processing has terminated; 181 | ; If the process is in Idle state, then informations are related to the 182 | ; last request the process has served. Otherwise informations are related to 183 | ; the current request being served. 184 | ; Example output: 185 | ; ************************ 186 | ; pid: 31330 187 | ; state: Running 188 | ; start time: 01/Jul/2011:17:53:49 +0200 189 | ; start since: 63087 190 | ; requests: 12808 191 | ; request duration: 1250261 192 | ; request method: GET 193 | ; request URI: /test_mem.php?N=10000 194 | ; content length: 0 195 | ; user: - 196 | ; script: /home/fat/web/docs/php/test_mem.php 197 | ; last request cpu: 0.00 198 | ; last request memory: 0 199 | ; 200 | ; Note: There is a real-time FPM status monitoring sample web page available 201 | ; It's available in: ${prefix}/share/fpm/status.html 202 | ; 203 | ; Note: The value must start with a leading slash (/). The value can be 204 | ; anything, but it may not be a good idea to use the .php extension or it 205 | ; may conflict with a real PHP file. 206 | ; Default Value: not set 207 | pm.status_path = /status 208 | 209 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 210 | ; URI will be recognized as a ping page. This could be used to test from outside 211 | ; that FPM is alive and responding, or to 212 | ; - create a graph of FPM availability (rrd or such); 213 | ; - remove a server from a group if it is not responding (load balancing); 214 | ; - trigger alerts for the operating team (24/7). 215 | ; Note: The value must start with a leading slash (/). The value can be 216 | ; anything, but it may not be a good idea to use the .php extension or it 217 | ; may conflict with a real PHP file. 218 | ; Default Value: not set 219 | ;ping.path = /ping 220 | 221 | ; This directive may be used to customize the response of a ping request. The 222 | ; response is formatted as text/plain with a 200 response code. 223 | ; Default Value: pong 224 | ;ping.response = pong 225 | 226 | ; The access log file 227 | ; Default: not set 228 | ;access.log = log/$pool.access.log 229 | 230 | ; The access log format. 231 | ; The following syntax is allowed 232 | ; %%: the '%' character 233 | ; %C: %CPU used by the request 234 | ; it can accept the following format: 235 | ; - %{user}C for user CPU only 236 | ; - %{system}C for system CPU only 237 | ; - %{total}C for user + system CPU (default) 238 | ; %d: time taken to serve the request 239 | ; it can accept the following format: 240 | ; - %{seconds}d (default) 241 | ; - %{miliseconds}d 242 | ; - %{mili}d 243 | ; - %{microseconds}d 244 | ; - %{micro}d 245 | ; %e: an environment variable (same as $_ENV or $_SERVER) 246 | ; it must be associated with embraces to specify the name of the env 247 | ; variable. Some exemples: 248 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 249 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 250 | ; %f: script filename 251 | ; %l: content-length of the request (for POST request only) 252 | ; %m: request method 253 | ; %M: peak of memory allocated by PHP 254 | ; it can accept the following format: 255 | ; - %{bytes}M (default) 256 | ; - %{kilobytes}M 257 | ; - %{kilo}M 258 | ; - %{megabytes}M 259 | ; - %{mega}M 260 | ; %n: pool name 261 | ; %o: ouput header 262 | ; it must be associated with embraces to specify the name of the header: 263 | ; - %{Content-Type}o 264 | ; - %{X-Powered-By}o 265 | ; - %{Transfert-Encoding}o 266 | ; - .... 267 | ; %p: PID of the child that serviced the request 268 | ; %P: PID of the parent of the child that serviced the request 269 | ; %q: the query string 270 | ; %Q: the '?' character if query string exists 271 | ; %r: the request URI (without the query string, see %q and %Q) 272 | ; %R: remote IP address 273 | ; %s: status (response code) 274 | ; %t: server time the request was received 275 | ; it can accept a strftime(3) format: 276 | ; %d/%b/%Y:%H:%M:%S %z (default) 277 | ; %T: time the log has been written (the request has finished) 278 | ; it can accept a strftime(3) format: 279 | ; %d/%b/%Y:%H:%M:%S %z (default) 280 | ; %u: remote user 281 | ; 282 | ; Default: "%R - %u %t \"%m %r\" %s" 283 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 284 | 285 | ; The log file for slow requests 286 | ; Default Value: not set 287 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 288 | ;slowlog = log/$pool.log.slow 289 | 290 | ; The timeout for serving a single request after which a PHP backtrace will be 291 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 292 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 293 | ; Default Value: 0 294 | ;request_slowlog_timeout = 0 295 | 296 | ; The timeout for serving a single request after which the worker process will 297 | ; be killed. This option should be used when the 'max_execution_time' ini option 298 | ; does not stop script execution for some reason. A value of '0' means 'off'. 299 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 300 | ; Default Value: 0 301 | request_terminate_timeout = 600s 302 | 303 | ; Set open file descriptor rlimit. 304 | ; Default Value: system defined value 305 | rlimit_files = 65535 306 | 307 | ; Set max core size rlimit. 308 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 309 | ; Default Value: system defined value 310 | ;rlimit_core = 0 311 | 312 | ; Chroot to this directory at the start. This value must be defined as an 313 | ; absolute path. When this value is not set, chroot is not used. 314 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 315 | ; of its subdirectories. If the pool prefix is not set, the global prefix 316 | ; will be used instead. 317 | ; Note: chrooting is a great security feature and should be used whenever 318 | ; possible. However, all PHP paths will be relative to the chroot 319 | ; (error_log, sessions.save_path, ...). 320 | ; Default Value: not set 321 | ;chroot = 322 | 323 | ; Chdir to this directory at the start. 324 | ; Note: relative path can be used. 325 | ; Default Value: current directory or / when chroot 326 | chdir = / 327 | 328 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 329 | ; stderr will be redirected to /dev/null according to FastCGI specs. 330 | ; Note: on highloaded environement, this can cause some delay in the page 331 | ; process time (several ms). 332 | ; Default Value: no 333 | ;catch_workers_output = yes 334 | 335 | ; Limits the extensions of the main script FPM will allow to parse. This can 336 | ; prevent configuration mistakes on the web server side. You should only limit 337 | ; FPM to .php extensions to prevent malicious users to use other extensions to 338 | ; exectute php code. 339 | ; Note: set an empty value to allow all extensions. 340 | ; Default Value: .php 341 | security.limit_extensions = .php .php3 .php4 .php5 342 | 343 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 344 | ; the current environment. 345 | ; Default Value: clean env 346 | ;env[HOSTNAME] = $HOSTNAME 347 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 348 | ;env[TMP] = /tmp 349 | ;env[TMPDIR] = /tmp 350 | ;env[TEMP] = /tmp 351 | 352 | ; Additional php.ini defines, specific to this pool of workers. These settings 353 | ; overwrite the values previously defined in the php.ini. The directives are the 354 | ; same as the PHP SAPI: 355 | ; php_value/php_flag - you can set classic ini defines which can 356 | ; be overwritten from PHP call 'ini_set'. 357 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 358 | ; PHP call 'ini_set' 359 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 360 | 361 | ; Defining 'extension' will load the corresponding shared extension from 362 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 363 | ; overwrite previously defined php.ini values, but will append the new value 364 | ; instead. 365 | 366 | ; Note: path INI options can be relative and will be expanded with the prefix 367 | ; (pool, global or /usr) 368 | 369 | ; Default Value: nothing is defined by default except the values in php.ini and 370 | ; specified at startup with the -d argument 371 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 372 | ;php_flag[display_errors] = off 373 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 374 | ;php_admin_flag[log_errors] = on 375 | ;php_admin_value[memory_limit] = 32M 376 | 377 | php_flag[display_errors] = off 378 | php_admin_value[error_reporting] = 0 379 | php_admin_value[error_log] = /var/log/php5-fpm.log 380 | php_admin_flag[log_errors] = on 381 | php_admin_value[memory_limit] = 128M 382 | -------------------------------------------------------------------------------- /varnish/default.vcl: -------------------------------------------------------------------------------- 1 | 2 | # Set the default backend (Nginx server for me) 3 | backend default { 4 | # My Nginx server listen on IP address 127.0.0.1 and TCP port 8080 5 | .host = "127.0.0.1"; 6 | .port = "8080"; 7 | # Increase guru timeout 8 | .first_byte_timeout = 300s; 9 | } 10 | 11 | # Purge ACL 12 | acl purge { 13 | # Only localhost can purge my cache 14 | "127.0.0.1"; 15 | "localhost"; 16 | "94.23.214.15"; 17 | } 18 | 19 | # This function is used when a request is send by a HTTP client (Browser) 20 | sub vcl_recv { 21 | # Block the forbidden IP addresse 22 | if (client.ip ~ forbidden) { 23 | error 403 "Forbidden"; 24 | } 25 | 26 | # Compatibility with Apache format log 27 | if (req.restarts == 0) { 28 | if (req.http.x-forwarded-for) { 29 | set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip; 30 | } else { 31 | set req.http.X-Forwarded-For = client.ip; 32 | } 33 | } 34 | 35 | # Normalize the header, remove the port (in case you're testing this on various TCP ports) 36 | set req.http.Host = regsub(req.http.Host, ":[0-9]+", ""); 37 | 38 | # Allow purging from ACL 39 | if (req.request == "PURGE") { 40 | # If not allowed then a error 405 is returned 41 | if (!client.ip ~ purge) { 42 | error 405 "This IP is not allowed to send PURGE requests."; 43 | } 44 | # If allowed, do a cache_lookup -> vlc_hit() or vlc_miss() 45 | return (lookup); 46 | } 47 | 48 | # Post requests will not be cached 49 | if (req.http.Authorization || req.request == "POST") { 50 | return (pass); 51 | } 52 | 53 | # --- Wordpress specific configuration 54 | 55 | # Did not cache the RSS feed 56 | if (req.url ~ "/feed") { 57 | return (pass); 58 | } 59 | 60 | # Blitz hack 61 | if (req.url ~ "/mu-.*") { 62 | return (pass); 63 | } 64 | 65 | 66 | # Did not cache the admin and login pages 67 | if (req.url ~ "/wp-(login|admin)") { 68 | return (pass); 69 | } 70 | 71 | # Remove the "has_js" cookie 72 | set req.http.Cookie = regsuball(req.http.Cookie, "has_js=[^;]+(; )?", ""); 73 | 74 | # Remove any Google Analytics based cookies 75 | set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", ""); 76 | 77 | # Remove the Quant Capital cookies (added by some plugin, all __qca) 78 | set req.http.Cookie = regsuball(req.http.Cookie, "__qc.=[^;]+(; )?", ""); 79 | 80 | # Remove the wp-settings-1 cookie 81 | set req.http.Cookie = regsuball(req.http.Cookie, "wp-settings-1=[^;]+(; )?", ""); 82 | 83 | # Remove the wp-settings-time-1 cookie 84 | set req.http.Cookie = regsuball(req.http.Cookie, "wp-settings-time-1=[^;]+(; )?", ""); 85 | 86 | # Remove the wp test cookie 87 | set req.http.Cookie = regsuball(req.http.Cookie, "wordpress_test_cookie=[^;]+(; )?", ""); 88 | 89 | # Are there cookies left with only spaces or that are empty? 90 | if (req.http.cookie ~ "^ *$") { 91 | unset req.http.cookie; 92 | } 93 | 94 | # Cache the following files extensions 95 | #if (req.url ~ "\.(css|js|png|gif|jp(e)?g|swf|ico)") { 96 | if (req.url ~ "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|otf|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|t?gz|tif|tiff|ttf|wav|webm|wma|woff|wri|xla|xls|xlsx|xlt|xlw|zip)") { 97 | unset req.http.cookie; 98 | } 99 | 100 | # Normalize Accept-Encoding header and compression 101 | # https://www.varnish-cache.org/docs/3.0/tutorial/vary.html 102 | if (req.http.Accept-Encoding) { 103 | # Do no compress compressed files... 104 | if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") { 105 | remove req.http.Accept-Encoding; 106 | } elsif (req.http.Accept-Encoding ~ "gzip") { 107 | set req.http.Accept-Encoding = "gzip"; 108 | } elsif (req.http.Accept-Encoding ~ "deflate") { 109 | set req.http.Accept-Encoding = "deflate"; 110 | } else { 111 | remove req.http.Accept-Encoding; 112 | } 113 | } 114 | 115 | # Check the cookies for wordpress-specific items 116 | if (req.http.Cookie ~ "wordpress_" || req.http.Cookie ~ "comment_") { 117 | return (pass); 118 | } 119 | if (!req.http.cookie) { 120 | unset req.http.cookie; 121 | } 122 | 123 | # --- End of Wordpress specific configuration 124 | 125 | # Did not cache HTTP authentication and HTTP Cookie 126 | if (req.http.Authorization || req.http.Cookie) { 127 | # Not cacheable by default 128 | return (pass); 129 | } 130 | 131 | # Define the default grace period to serve cached content 132 | set req.grace = 30s; 133 | 134 | # Cache all others requests 135 | return (lookup); 136 | } 137 | 138 | sub vcl_pipe { 139 | return (pipe); 140 | } 141 | 142 | sub vcl_pass { 143 | return (pass); 144 | } 145 | 146 | # The data on which the hashing will take place 147 | sub vcl_hash { 148 | hash_data(req.url); 149 | if (req.http.host) { 150 | hash_data(req.http.host); 151 | } else { 152 | hash_data(server.ip); 153 | } 154 | 155 | # If the client supports compression, keep that in a different cache 156 | if (req.http.Accept-Encoding) { 157 | hash_data(req.http.Accept-Encoding); 158 | } 159 | 160 | return (hash); 161 | } 162 | 163 | sub vcl_hit { 164 | # Allow purges 165 | if (req.request == "PURGE") { 166 | purge; 167 | error 200 "Purged."; 168 | } 169 | 170 | return (deliver); 171 | } 172 | 173 | sub vcl_miss { 174 | # Allow purges 175 | if (req.request == "PURGE") { 176 | purge; 177 | error 200 "Purged."; 178 | } 179 | 180 | return (fetch); 181 | } 182 | 183 | # This function is used when a request is sent by our backend (Nginx server) 184 | sub vcl_fetch { 185 | # Remove some headers we never want to see 186 | unset beresp.http.Server; 187 | unset beresp.http.X-Powered-By; 188 | 189 | # For static content strip all backend cookies 190 | if (req.url ~ "\.(css|js|png|gif|jp(e?)g)|swf|ico") { 191 | unset beresp.http.cookie; 192 | } 193 | 194 | # Only allow cookies to be set if we're in admin area 195 | if (beresp.http.Set-Cookie && req.url !~ "^/wp-(login|admin)") { 196 | unset beresp.http.Set-Cookie; 197 | } 198 | 199 | # don't cache response to posted requests or those with basic auth 200 | if ( req.request == "POST" || req.http.Authorization ) { 201 | return (hit_for_pass); 202 | } 203 | 204 | # don't cache search results 205 | if ( req.url ~ "\?s=" ){ 206 | return (hit_for_pass); 207 | } 208 | 209 | # only cache status ok 210 | if ( beresp.status != 200 ) { 211 | return (hit_for_pass); 212 | } 213 | 214 | # A TTL of 24h 215 | set beresp.ttl = 24h; 216 | 217 | return (deliver); 218 | } 219 | 220 | # The routine when we deliver the HTTP request to the user 221 | # Last chance to modify headers that are sent to the client 222 | sub vcl_deliver { 223 | if (obj.hits > 0) { 224 | set resp.http.X-Cache = "cached"; 225 | } else { 226 | set resp.http.x-Cache = "uncached"; 227 | } 228 | 229 | # Remove some headers: PHP version 230 | unset resp.http.X-Powered-By; 231 | 232 | # Remove some headers: Apache version & OS 233 | unset resp.http.Server; 234 | 235 | # Remove some heanders: Varnish 236 | unset resp.http.Via; 237 | unset resp.http.X-Varnish; 238 | 239 | return (deliver); 240 | } 241 | 242 | sub vcl_init { 243 | return (ok); 244 | } 245 | 246 | sub vcl_fini { 247 | return (ok); 248 | } 249 | -------------------------------------------------------------------------------- /varnish/default/varnish: -------------------------------------------------------------------------------- 1 | # Configuration file for varnish 2 | # 3 | # /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK 4 | # to be set from this shell script fragment. 5 | # 6 | 7 | # Should we start varnishd at boot? Set to "no" to disable. 8 | START=yes 9 | 10 | # Maximum number of open files (for ulimit -n) 11 | NFILES=131072 12 | 13 | # Maximum locked memory size (for ulimit -l) 14 | # Used for locking the shared memory log in memory. If you increase log size, 15 | # you need to increase this number as well 16 | MEMLOCK=82000 17 | 18 | # Default varnish instance name is the local nodename. Can be overridden with 19 | # the -n switch, to have more instances on a single server. 20 | # INSTANCE=$(uname -n) 21 | 22 | # This file contains 4 alternatives, please use only one. 23 | 24 | ## Alternative 1, Minimal configuration, no VCL 25 | # 26 | # Listen on port 6081, administration on localhost:6082, and forward to 27 | # content server on localhost:8080. Use a 1GB fixed-size cache file. 28 | # 29 | # DAEMON_OPTS="-a :6081 \ 30 | # -T localhost:6082 \ 31 | # -b localhost:8080 \ 32 | # -u varnish -g varnish \ 33 | # -S /etc/varnish/secret \ 34 | # -s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G" 35 | 36 | 37 | ## Alternative 2, Configuration with VCL 38 | # 39 | # Listen on port 6081, administration on localhost:6082, and forward to 40 | # one content server selected by the vcl file, based on the request. Use a 1GB 41 | # fixed-size cache file. 42 | # 43 | DAEMON_OPTS="-a :80 \ 44 | -T localhost:6082 \ 45 | -f /etc/varnish/default.vcl \ 46 | -S /etc/varnish/secret \ 47 | -p thread_pool_add_delay=2 \ 48 | -p thread_pools=2 \ 49 | -p thread_pool_min=200 \ 50 | -p thread_pool_max=4000 \ 51 | -p cli_timeout=25 \ 52 | -p timeout_linger=50 \ 53 | -s malloc,512M" 54 | 55 | 56 | ## Alternative 3, Advanced configuration 57 | # 58 | # See varnishd(1) for more information. 59 | # 60 | # # Main configuration file. You probably want to change it :) 61 | # VARNISH_VCL_CONF=/etc/varnish/default.vcl 62 | # 63 | # # Default address and port to bind to 64 | # # Blank address means all IPv4 and IPv6 interfaces, otherwise specify 65 | # # a host name, an IPv4 dotted quad, or an IPv6 address in brackets. 66 | # VARNISH_LISTEN_ADDRESS= 67 | # VARNISH_LISTEN_PORT=6081 68 | # 69 | # # Telnet admin interface listen address and port 70 | # VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1 71 | # VARNISH_ADMIN_LISTEN_PORT=6082 72 | # 73 | # # The minimum number of worker threads to start 74 | # VARNISH_MIN_THREADS=1 75 | # 76 | # # The Maximum number of worker threads to start 77 | # VARNISH_MAX_THREADS=1000 78 | # 79 | # # Idle timeout for worker threads 80 | # VARNISH_THREAD_TIMEOUT=120 81 | # 82 | # # Cache file location 83 | # VARNISH_STORAGE_FILE=/var/lib/varnish/$INSTANCE/varnish_storage.bin 84 | # 85 | # # Cache file size: in bytes, optionally using k / M / G / T suffix, 86 | # # or in percentage of available disk space using the % suffix. 87 | # VARNISH_STORAGE_SIZE=1G 88 | # 89 | # # File containing administration secret 90 | # VARNISH_SECRET_FILE=/etc/varnish/secret 91 | # 92 | # # Backend storage specification 93 | # VARNISH_STORAGE="file,${VARNISH_STORAGE_FILE},${VARNISH_STORAGE_SIZE}" 94 | # 95 | # # Default TTL used when the backend does not specify one 96 | # VARNISH_TTL=120 97 | # 98 | # # DAEMON_OPTS is used by the init script. If you add or remove options, make 99 | # # sure you update this section, too. 100 | # DAEMON_OPTS="-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \ 101 | # -f ${VARNISH_VCL_CONF} \ 102 | # -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \ 103 | # -t ${VARNISH_TTL} \ 104 | # -w ${VARNISH_MIN_THREADS},${VARNISH_MAX_THREADS},${VARNISH_THREAD_TIMEOUT} \ 105 | # -S ${VARNISH_SECRET_FILE} \ 106 | # -s ${VARNISH_STORAGE}" 107 | # 108 | 109 | 110 | ## Alternative 4, Do It Yourself 111 | # 112 | # DAEMON_OPTS="" 113 | -------------------------------------------------------------------------------- /varnish/default/varnishncsa: -------------------------------------------------------------------------------- 1 | # Configuration file for varnishncsa 2 | # 3 | # Uncomment this to enable logging for varnish. Please make sure you have 4 | # enough disk space for significant amounts of log data. To disable logging, 5 | # set the variable to "0", "no", or leave it unset. 6 | # 7 | # NCSA log format, to be used by HTTP log analyzers 8 | VARNISHNCSA_ENABLED=1 9 | -------------------------------------------------------------------------------- /varnish/varnish4-wordpress: -------------------------------------------------------------------------------- 1 | # 2 | # This is an example VCL file for Varnish. 3 | # 4 | # It does not do anything by default, delegating control to the 5 | # builtin VCL. The builtin VCL is called when there is no explicit 6 | # return statement. 7 | # 8 | # See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/ 9 | # and http://varnish-cache.org/trac/wiki/VCLExamples for more examples. 10 | 11 | # Update for work with Varnish 4 12 | 13 | 14 | # Marker to tell the VCL compiler that this VCL has been adapted to the 15 | # new 4.0 format. 16 | vcl 4.0; 17 | 18 | # Default backend definition. Set this to point to your content server. 19 | backend default { 20 | .host = "127.0.0.1"; 21 | .port = "8080"; 22 | .connect_timeout = 600s; 23 | .first_byte_timeout = 600s; 24 | .between_bytes_timeout = 600s; 25 | .max_connections = 800; 26 | } 27 | 28 | # Only allow purging from specific IPs 29 | acl purge { 30 | "localhost"; 31 | "127.0.0.1"; 32 | } 33 | 34 | # This function is used when a request is send by a HTTP client (Browser) 35 | sub vcl_recv { 36 | # Normalize the header, remove the port (in case you're testing this on various TCP ports) 37 | set req.http.Host = regsub(req.http.Host, ":[0-9]+", ""); 38 | 39 | # WooCommerce: The code below makes sure the AJAX "add to cart" function works 40 | set req.url = regsub(req.url, "add-to-cart=\d+_\d+&", ""); 41 | 42 | # Allow purging from ACL 43 | if (req.method == "PURGE") { 44 | # If not allowed then a error 405 is returned 45 | if (!client.ip ~ purge) { 46 | return(synth(405, "This IP is not allowed to send PURGE requests.")); 47 | } 48 | # If allowed, do a cache_lookup -> vlc_hit() or vlc_miss() 49 | return (purge); 50 | } 51 | 52 | # Post requests will not be cached 53 | if (req.http.Authorization || req.method == "POST") { 54 | return (pass); 55 | } 56 | 57 | # --- Wordpress specific configuration 58 | 59 | # Did not cache the RSS feed 60 | if (req.url ~ "/feed") { 61 | return (pass); 62 | } 63 | 64 | # Blitz hack 65 | if (req.url ~ "/mu-.*") { 66 | return (pass); 67 | } 68 | 69 | 70 | # Did not cache the admin and login pages 71 | if (req.url ~ "/wp-(login|admin)") { 72 | return (pass); 73 | } 74 | 75 | # Do not cache the WooCommerce pages 76 | ### REMOVE IT IF YOU DO NOT USE WOOCOMMERCE ### 77 | if (req.url ~ "/(cart|my-account|checkout|addons|/?add-to-cart=)") { 78 | return (pass); 79 | } 80 | 81 | # Remove the "has_js" cookie 82 | set req.http.Cookie = regsuball(req.http.Cookie, "has_js=[^;]+(; )?", ""); 83 | 84 | # Remove any Google Analytics based cookies 85 | set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", ""); 86 | 87 | # Remove the Quant Capital cookies (added by some plugin, all __qca) 88 | set req.http.Cookie = regsuball(req.http.Cookie, "__qc.=[^;]+(; )?", ""); 89 | 90 | # Remove the wp-settings-1 cookie 91 | set req.http.Cookie = regsuball(req.http.Cookie, "wp-settings-1=[^;]+(; )?", ""); 92 | 93 | # Remove the wp-settings-time-1 cookie 94 | set req.http.Cookie = regsuball(req.http.Cookie, "wp-settings-time-1=[^;]+(; )?", ""); 95 | 96 | # Remove the wp test cookie 97 | set req.http.Cookie = regsuball(req.http.Cookie, "wordpress_test_cookie=[^;]+(; )?", ""); 98 | 99 | # Are there cookies left with only spaces or that are empty? 100 | if (req.http.cookie ~ "^ *$") { 101 | unset req.http.cookie; 102 | } 103 | 104 | # Cache the following files extensions 105 | if (req.url ~ "\.(css|js|png|gif|jp(e)?g|swf|ico)") { 106 | unset req.http.cookie; 107 | } 108 | 109 | # Normalize Accept-Encoding header and compression 110 | # https://www.varnish-cache.org/docs/3.0/tutorial/vary.html 111 | if (req.http.Accept-Encoding) { 112 | # Do no compress compressed files... 113 | if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") { 114 | unset req.http.Accept-Encoding; 115 | } elsif (req.http.Accept-Encoding ~ "gzip") { 116 | set req.http.Accept-Encoding = "gzip"; 117 | } elsif (req.http.Accept-Encoding ~ "deflate") { 118 | set req.http.Accept-Encoding = "deflate"; 119 | } else { 120 | unset req.http.Accept-Encoding; 121 | } 122 | } 123 | 124 | # Check the cookies for wordpress-specific items 125 | if (req.http.Cookie ~ "wordpress_" || req.http.Cookie ~ "comment_") { 126 | return (pass); 127 | } 128 | if (!req.http.cookie) { 129 | unset req.http.cookie; 130 | } 131 | 132 | # --- End of Wordpress specific configuration 133 | 134 | # Did not cache HTTP authentication and HTTP Cookie 135 | if (req.http.Authorization || req.http.Cookie) { 136 | # Not cacheable by default 137 | return (pass); 138 | } 139 | 140 | # Cache all others requests 141 | return (hash); 142 | } 143 | 144 | sub vcl_pipe { 145 | return (pipe); 146 | } 147 | 148 | sub vcl_pass { 149 | return (fetch); 150 | } 151 | 152 | # The data on which the hashing will take place 153 | sub vcl_hash { 154 | hash_data(req.url); 155 | if (req.http.host) { 156 | hash_data(req.http.host); 157 | } else { 158 | hash_data(server.ip); 159 | } 160 | 161 | # If the client supports compression, keep that in a different cache 162 | if (req.http.Accept-Encoding) { 163 | hash_data(req.http.Accept-Encoding); 164 | } 165 | 166 | return (lookup); 167 | } 168 | 169 | # This function is used when a request is sent by our backend (Nginx server) 170 | sub vcl_backend_response { 171 | # Remove some headers we never want to see 172 | unset beresp.http.Server; 173 | unset beresp.http.X-Powered-By; 174 | 175 | # For static content strip all backend cookies 176 | if (bereq.url ~ "\.(css|js|png|gif|jp(e?)g)|swf|ico") { 177 | unset beresp.http.cookie; 178 | } 179 | 180 | # Only allow cookies to be set if we're in admin area 181 | if (beresp.http.Set-Cookie && bereq.url !~ "^/wp-(login|admin)") { 182 | unset beresp.http.Set-Cookie; 183 | } 184 | 185 | # don't cache response to posted requests or those with basic auth 186 | if ( bereq.method == "POST" || bereq.http.Authorization ) { 187 | set beresp.uncacheable = true; 188 | set beresp.ttl = 120s; 189 | return (deliver); 190 | } 191 | 192 | # don't cache search results 193 | if ( bereq.url ~ "\?s=" ){ 194 | set beresp.uncacheable = true; 195 | set beresp.ttl = 120s; 196 | return (deliver); 197 | } 198 | 199 | # only cache status ok 200 | if ( beresp.status != 200 ) { 201 | set beresp.uncacheable = true; 202 | set beresp.ttl = 120s; 203 | return (deliver); 204 | } 205 | 206 | # A TTL of 24h 207 | set beresp.ttl = 24h; 208 | # Define the default grace period to serve cached content 209 | set beresp.grace = 30s; 210 | 211 | return (deliver); 212 | } 213 | 214 | # The routine when we deliver the HTTP request to the user 215 | # Last chance to modify headers that are sent to the client 216 | sub vcl_deliver { 217 | if (obj.hits > 0) { 218 | set resp.http.X-Cache = "cached"; 219 | } else { 220 | set resp.http.x-Cache = "uncached"; 221 | } 222 | 223 | # Remove some headers: PHP version 224 | unset resp.http.X-Powered-By; 225 | 226 | # Remove some headers: Apache version & OS 227 | unset resp.http.Server; 228 | 229 | # Remove some heanders: Varnish 230 | unset resp.http.Via; 231 | unset resp.http.X-Varnish; 232 | 233 | return (deliver); 234 | } 235 | 236 | sub vcl_init { 237 | return (ok); 238 | } 239 | 240 | sub vcl_fini { 241 | return (ok); 242 | } 243 | --------------------------------------------------------------------------------