2020 m. birželio 16 d., antradienis
php-fpm derinimai
php-fpm turi atskirus failus per user: /etc/php.d ten reikai nustatyti server limitus
https://tideways.com/profiler/blog/an-introduction-to-php-fpm-tuning
php session lock
php session keep locked file until script ends or you call session_write_close();
https://jennifersoft.com/en/blog/tech/2019-04-08/
https://stackoverflow.com/questions/13946033/is-it-recommended-to-store-php-sessions-in-memcache
https://jennifersoft.com/en/blog/tech/2019-04-08/
https://stackoverflow.com/questions/13946033/is-it-recommended-to-store-php-sessions-in-memcache
2019 m. spalio 15 d., antradienis
2019 m. rugpjūčio 27 d., antradienis
detect spamming sript
Pirmiausia, žiūrėti mail log:
1829AB7A07E3: uid=48 from=<aaa@bbb.lt>
Pirmas stulpelis - mail quue id, antras - proceso id, kuris siunčia.
php.ini turi būti nustatyta: mail.add_x_header = On
1829AB7A07E3: uid=48 from=<aaa@bbb.lt>
Pirmas stulpelis - mail quue id, antras - proceso id, kuris siunčia.
php.ini turi būti nustatyta: mail.add_x_header = On
postcat -q <ID> - pagal mail que id pažiūrėti laišką
postcat -q DA5E8647235C | grep X-PHP-Originating-Script
X-PHP-Originating-Script: 45:badmailer.php
The number 45 is the UID, which is the Linux user ID that ran the script
postcat -q DA5E8647235C | grep sasl_username
Resend messages in the queue: postqueue -f
Pastaba: susitvarkus, paleisti postsuper -d ALL
nes kitaip dar tukstanciai padetu laisku gali buti.
Papildomai, iš išorės galima blokuoti SMTP (jungiantis iš servo rašyti localhost):
iptables -A INPUT -p tcp -s localhost --dport 25 -j ACCEPT
iptables -A INPUT -p tcp -s localhost --dport 25 -j ACCEPT
2019 m. balandžio 21 d., sekmadienis
phpexcel, pdf
/*
$objWriter = PHPExcel_IOFactory::createWriter($doc, 'HTML');
$objWriter->writeAllSheets();
//$objWriter->generateStyles(false);
//echo $objWriter->generateSheetData();
//exit;
$objWriter->save('php://output'); exit;
$css = <<<HTML
<style>
.navigation {display:none}
.gridlines td {border:0;}
</style>
HTML;
require_once('class/pdf/pdftk.php');
ob_start();
$objWriter->save('php://output');
$excelOutput = ob_get_clean();
$excelOutput = str_replace('</head>', $css.'</head>' , $excelOutput);
pdftk::html2pdf($excelOutput,'aaa.pdf', 'L', 'I');
exit;
*/
PHPExcel_Settings::setPdfRenderer(PHPExcel_Settings::PDF_RENDERER_MPDF,'../composer/vendor/mpdf/mpdf/');
$objWriter = PHPExcel_IOFactory::createWriter($doc, 'PDF');
$objWriter->writeAllSheets();
header('Content-type:Application/pdf');
header('Content-Disposition: inline;filename="export.pdf"');
$objWriter->save('php://output');
exit;
Užsisakykite:
Pranešimai (Atom)