PHP Live Change Ini -Richtlinien nehmen zu viel [geschlossen]Php

PHP-Programmierer chatten hier
Anonymous
 PHP Live Change Ini -Richtlinien nehmen zu viel [geschlossen]

Post by Anonymous »

Auf meiner Linux-Maschine (Tröpfchen auf digitalem Ozean) mit PHP-FPM 8.2, 2 GB RAM, Apache2, Fail2ban und Modsecurity2. Führen Sie aus? < /p>
Dieser Extrakt ist der oberste Teil des Skripts.

Code: Select all

global $pathRootLib;

$actualIP = '100.200.100.100';
$userIP = $_SERVER['REMOTE_ADDR'] ?? '-';

try {
if(!file_exists($f = "$pathRootLib/php/functions.php")) { throw new Exception("missing file"); }
require_once($f);
if(!file_exists($f = "config.php")) { throw new Exception("missing file"); }
require_once($f);
if(!file_exists($f = "functions.php")) { throw new Exception("missing file"); }
require_once($f);

$arrTiming = [];
logTime(__LINE__);

error_reporting(E_ALL);
if($userIP != $actualIP) {
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
}

logTime(__LINE__);
}
...

function logTime($line): void
{
global $arrTiming;

if(empty($arrTiming)) {
$arrTiming[$line] = [
't' => time(),
'd' => 0
];
}
else {
$arrTiming[$line] = [
't' => number_format(microtime(true), 3, '.', ''),
'd' => number_format(microtime(true) - end($arrTiming)['t'], 3, '.', '')
];
}
}
< /code>
Timing -Ergebnis: < /p>
{
"tempi": {
"15": {
"t": 1759299431,
"d": 0
},
"25": {
"t": "1759299431.466",
"d": "0.466"
}
}
}
< /code>
ModSecurity, ja, scannen Sie nach Post -Inhalten, aber es tut es, bevor das Skript startet. Ist es nicht wahr? Es hat sich also nicht auf mein Timing ausgewirkt.               total        used        free      shared  buff/cache   available
Mem:           1.9Gi       1.0Gi       105Mi        12Mi       841Mi       749Mi
Swap:             0B          0B          0B
Ich teste nicht ohne ModSecurity, es muss schnell in der Produktion sein.

Code: Select all

[mysqld]

# enable ONLY_FULL_GROUP_BY
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

# disable LOAD DATA LOCAL INFILE
local_infile = 0

default_time_zone = 'Europe/Rome'

# 1gb
innodb_buffer_pool_size = 1073741824
# default 16777216
key_buffer_size = 67108864

# default 262144
sort_buffer_size = 1048576
# default 131072
read_buffer_size = 1048576
# default 262144
read_rnd_buffer_size = 1048576
# default 262144
join_buffer_size = 1048576
# default 9
thread_cache_size = 20
# default OFF
slow_query_log = ON
# default 10.000000
long_query_time = 2.000000

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post