Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP7Bug
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi .php
FcgidInitialEnv PHPRC "C:/oc/php-7.0.3-nts-Win32-VC14-x86/"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 10000
FcgidInitialEnv APP_POOL_ID "DefaultAppPool"
FcgidMaxRequestsPerProcess 1
FcgidProcessLifeTime 0
# Whatever these values are set to, the failure only occurs after FcgidConnectTimeout
FcgidOutputBufferSize 0
FcgidMaxProcesses 32
FcgidIOTimeout 70
FcgidIdleTimeout 80
FcgidConnectTimeout 120
FcgidProcessLifeTime 0
FcgidZombieScanInterval 1
FcgidMaxRequestLen 15728640
FcgidBusyScanInterval 10
FcgidWrapper "C:/oc/php-7.0.3-nts-Win32-VC14-x86/php-cgi.exe" .php
AddType application/x-httpd-php .php
</IfModule>
ServerName win7vm
DocumentRoot "C:/oc/webroot"
ErrorLog "logs/error.log"
<Directory "C:/oc/webroot">
DirectoryIndex index.php index.html
Options Includes ExecCGI Indexes FollowSymLinks
AllowOverride All
#2.4 compatibility
<IfModule authz_core_module>
# Require all denied
Require all granted
</IfModule>
</Directory>
ServerRoot "C:/oc/Apache24"
Listen 80
ThreadsPerChild 150
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
ServerAdmin admin@example.com
<Directory />
AllowOverride none
Require all denied
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error.log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access.log" common
</IfModule>
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
Include conf/conf.d/*.conf
[PHP]
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
disable_functions =
disable_classes =
zend.enable_gc = On
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL
display_errors = On
display_startup_errors = On
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = On
html_errors = On
error_log = C:/oc/php-7.0.3-nts-Win32-VC14-x86/log/php_errors.log
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
user_dir =
extension_dir = "C:/oc\php-7.0.3-nts-Win32-VC14-x86\ext"
enable_dl = Off
file_uploads = On
upload_tmp_dir = "C:/oc\tmp"
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_mbstring.dll
extension=php_mysqli.dll
[CLI Server]
cli_server.color = On
[Date]
date.timezone = "America/Los_Angeles"
[filter]
[iconv]
[intl]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = On
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = On
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[bcmath]
bcmath.scale = 0
[browscap]
browscap = "C:/oc\php-7.0.0RC3-nts-Win32-VC14-x86\extras\browscap.ini"
[Session]
session.save_handler = files
session.save_path="C:/oc\php-7.0.3-nts-Win32-VC14-x86\tmp"
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[Assertion]
zend.assertions = 1
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[mcrypt]
[dba]
[opcache]
[curl]
curl.cainfo = "C:/oc\php-7.0.3-nts-Win32-VC14-x86\extras\cacert.pem"
[openssl]
<?php
function millitime() {
$microtime = microtime();
$comps = explode(' ', $microtime);
// Note: Using a string here to prevent loss of precision
// in case of "overflow" (PHP converts it to a double)
return sprintf('%d%03d', $comps[1], $comps[0] * 1000);
}
if (!isset($_POST['ajax'])) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PHP breakage</title>
<script type="text/javascript" src="//code.jquery.com/jquery-2.2.0.min.js"></script>
<style type="text/css">
* { font-family: sans-serif}
</style>
</head>
<body>
<div><button>Start</button> <label><input type="number" value="4"> jobs</label></div>
<hr />
Jobs:
<ol>
</ol>
<hr />
<?php echo phpinfo() ?>
</body>
<script type="text/javascript">
"use strict";
var state = {
"trackers": []
};
$('button').on('click', function() {
var i,curr,call;
var count = $('input[type=number]').val();
var out = $('ol');
out.empty();
console.log("starting ",count,"ajax calls");
for (i = 0; i < count; i++) {
curr = { "job": i, "ajax": 1, "starttime": (new Date().getTime() / 1000) };
call = $.ajax({
url: "<?php echo $_SERVER['SCRIPT_NAME'] ?>",
method: "POST",
data: curr,
dataType: "json"
});
curr.elem = out.append('<li id="item_' + i + '">Job Running</li>');
curr.call = call;
call.done(function(data,status,req) {
console.log("data",data);
$('#item_' + parseInt(data.job)).html('Complete! (' + ( data.end - data.start ) + " elapsed)")
});
call.fail(function(data,status,req) {
console.log("failed",arguments,this);
var job = /job=(\d+)/.exec(this.data)[1];
var start = parseFloat(/starttime=(\d+.\d+)/.exec(this.data)[1]);
var end = (new Date().getTime() / 1000);
$('#item_' + parseInt(job)).html('<span style="color:#CC0000">FAILED!</span> (' + ( end - start ) + " elapsed)")
});
}
});
</script>
</html>
<?php
} else {
$start = microtime(true);
$startmillis = (float)$_POST['starttime'];
$offset = $start - $startmillis;
sleep(rand(0,5)); //pretend to be busy.
echo json_encode(["job" => $_POST['job'],"end" => microtime(true),"start"=> $start,"offset" => $offset]);
}
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment