#phpfpm

2025-07-05

От PHP к Zig: как я избавился от костылей в биллинг-системе

Недавно я занялся реинжинирингом биллинг-панели для VPN, заменив legacy-PHP на Zig. Результат: скорость выросла в 20 раз, а нагрузка упала на 70%. Но самое интересное — как мне удалось встроить Zig-код прямо в C-бинарник, хотя в интернете почти нет guides на эту тему. Хотите узнать, как я смог избежать костылей и сделать систему в 10 раз надежнее? Тогда читайте полную статью — там всё: от боли PHP до хитростей сборки Zig в продакшене.

habr.com/ru/articles/921482/

#zig #phpfpm #php #программирование #оптимизация #postgresql #биллинг #vpn #архитектура_по

2025-06-24
Okay, ich glaube, ich habe die richtigen Einstellungen für das Zusammenspiel von #MariaDB, #PHP-FPM und #Redis gefunden. Der "Feinschliff" war nicht ganz ohne. Seit ca. einer Woche scheint es hier auf #anonsys.net rundzulaufen.
Danke an @jools, @raroun und @oldkid für den Input und die Unterstützung. 👍🍻
#Friendica #FediAdmin
ScriptFanix ❤️ ⏚ ⸫ScriptFanix@maly.io
2025-03-03

Now I still have the issue of #phpFpm and/or NGinX closing the stream early, if anyone has pointers...

#PHP #NextCloud #NGinX

2025-02-17

История создания идеального Docker для Laravel

Казалось бы, упаковать PHP в контейнер и настроить GitHub Actions - дело пяти минут. Но как часто бывает, реальность оказалась сложнее. Это история о том, как я вернулся к разработке на PHP и решал накопившиеся проблемы с деплоем Laravel-проекта. О том, как готовил Docker-образ, несколько раз переписывал процесс деплоя, находил компромиссы там, где это было возможно, и полностью перестраивал архитектуру там, где компромиссы были неприемлемы.

habr.com/ru/articles/883300/

#laravel #phpfpm #php #nginx_unit #docker #dockercompose

2025-01-31

Today I learned about the PHP_INI_SCAN_DIR env variable; while its powerfull, it's nice so you can set custom php.inis being loaded.

However, today I *also* learned that php-fpm is a very "clever" piece of software which, while allowing setting env vars in each pool, will not work with PHP_INI_SCAN_DIR. It will set it tho, but in it's infinite wisdom thinks it's a **verry** clever idea to execute any phpini loading BEFORE the pool starts. So yeah.... this variable is absolute worthless in php-fpm. Sure you can set it globally before you start it in systemd, but then you also can just change the php.ini directly or use an include, so whats the point then.

*sigh* and that only cost be 2 hours of my live + wrestling with dbgsyms packages, gdb on a hosting server, stoping all other phpfpms, disabling all other pools, setting the pool to only spawn ever one worker and THEN wrestling with gdb so it actually dosnt detach when forking and also follows it so I can see whats happening..... Gosh lucky it's the weekend already.

#php #debugging #debugginglife #gdb #debugsymbols #phpfpm #hosting #hosterlive #weliveontheedgeofinsanity

2024-12-25

Выжимаем максимум скорости из PHP

При запуске PHP-приложений крайне важно правильно выбрать веб-сервер. Чтобы объективно оценить производительность популярных решений, мы проводили тестирование не на искусственных данных, а на реальных примерах. Наша цель не заключалась в создании рейтинга веб-серверов для PHP-приложений. Мы стремились показать, в каких условиях каждый сервер сможет продемонстрировать наилучшие результаты.

habr.com/ru/companies/intervol

#php #phpfpm #apache #nginx

Emanuele Panzthepanz@phpc.social
2024-10-04

"I recreated the server, now with encrypted disks, and restored the application. Can you check why it is not running?"

Spent considerable time checking the #Symfony, #caddyserver and #phpfpm configs: nothing could explain such errors, including not respecting any config change.

It was the usual suspect: #selinux, which was non properly configured

Bonus point: took the time to quickly upgrade to PHP 8.3 and Symfony 6.4; not bad for an application last deployed on December 2022 ☺

🪑Dr Rockstar ♫ajaxStardust@vivaldi.net
2024-09-29

Ugh! Finally finished (with installations at least) reconfiguring the LAN Dev Server after an SDDM debacle on my @bunsenlabs install.
:(
#flask #nginx #mariadb #phpfpm

Trying #Garuda #GarudaLinux this go round. That's pretty cool!

Also have #Artix installed on the same box.
Totally new to Arch, @zombiewarrior !
What do you think of that!
Muah-ha-ha-haww....

lol.

This #Garuda is cool though. I really like the #Hyprland . Like it better than #Sway but can't get it to go on the old HDTV as well as #Sway . #i3 for some reason doesnt work there at all. didn't mess w/ KDE XFCE or any others.
@garuda

I don't know if there is an Arch based distro w/ a more web-dev type audience, but i suppose any will do.
i just really need to run NGINX/ Python, flask etc.

This is diff. Pacman. ha.
well? let's see what happens.

2024-08-26

I have an odd problem with a #wordpress blog hosted on #Apache + #phpfpm
When a client browses a page with media (eg. /blog/wp-content/uploads/…/foo.jpg), everything loads fine but the server logs a 404 error for path /blog/blog/wp-content/uploads/…/foo.jpg with the same user-agent as the original client, but the client ip address logged is the server ip.
Client-side: no error.
It appears something server-side makes a rewrite AND an internal request is made that spoofs the user-agent 1/2

2024-07-28

Разработчики на PHP умеют писать код, но не всегда знают как устроен web-server

Одной из ключевых особенностей PHP является - легкость для разработчика в написании первой программы. Во многих мануалах для старта разработки сокращают информацию о web-сервере до минимума, например, запустите openserver или скопируйте собранный докер образ, где уже будет все настроено и просто перейдите по адресу http://localhost. Все это приводит к сужению знаний общей картины как работает web-приложение, что негативно влияет на репутацию разработчиков на этом языке программирования в целом. В прошлой статье я обещал рассказать о web-серверах для PHP, как раз для того, чтобы расширить кругозор тех людей, кто пропустил эту тему и постараться раскрыть ее максимально простым и понятным языком.

habr.com/ru/articles/832040/

#php #phpfpm #roadrunner #httpсервер

2024-07-21

I run this blog on a small Amazon Lightsail instance (1 GB RAM, 2 vCPU). Cheap!

Most of the time, it’s fine, but it has a bad habit of dying sometimes on a large image upload. The Jetpack app reports the upload as failing (offering to try again) but my site is completely unresponsive. I can resolve this in one of two ways: either I can still SSH into the box, and restarting PHP with sudo systemctl restart php-fpm recovers and I can try the upload again; or the instance isn’t responsive to SSH and I have to reboot it via the Lightsail console. The CPU utilization is elevated during this period, eating into the burstable zone.

I have seen generally better performance since I updated /etc/php-fpm.d/www.conf to override pm = static and pm.max_children = 2, but something was obviously still wrong. I installed atop since I often couldn’t get on the host to see what was happening right when it was stuck.

Last week, while working on a new post, my instance got wedged in the same way while trying to upload a short video. From the JetPack activity log I could see it became unresponsive at 11:42 PM Seattle time; the instance and atop use UTC so I’d need to look at the minutes leading up to to 0642 in the weekly atop log. That looks like this:

Well there’s my problem! php-fpm spikes in CPU, and then kswapd0 pegs the CPU while the instance’s local disk goes wild with reads trying to keep up. One odd thing is while the memory is low, it doesn’t seem to have changed much for the two php-fpm children. I guess I either need to tune the swappiness on my host or try to put a better clamp on PHP processing images? Need to investigate further.

I’m sure the real solution is to not host my own LAMP stack, but where’s the fun in that?

https://blog.ultranurd.net/2024/07/21/investigating-failed-wordpress-uploads/

#amazonLinux2023 #apache #aws #debugging #httpd #lightsail #linux #phpFpm #wordpress

2024-07-15

Часть 2: Настройка LEMP сервера для работы CMS WordPress в AlmaLinux 9, RockyLinux 9 или CentOS Stream 9

Во второй части статьи мы рассмотрим настройку LEMP сервера для работы с проектами на примере CMS WordPress. Мы проведем пошаговую настройку, обсудим автоматизацию процесса без использования популярных хостинг-панелей и в качестве бонуса представим улучшения для усиления безопасности WordPress. Это включает настройку виртуального хоста в Nginx и PHP интерпретатора для конкретного сайта. При этом мы не будем рассматривать настройку безопасности всего сервера, так как это тема для отдельной статьи. В этой статье рассмотрим: 1. Создание пользователя Linux 2. Настройка виртуального хоста 3. Проверка работы PHP 4. Работа с базой данных MariaDB 5. Настройка Let's Encrypt 6. Установка и настройка Fail2ban Перед прочтением этой статьи рекомендуется ознакомиться с первой частью — Часть 1: Установка LEMP стека в AlmaLinux 9.x, RockyLinux 9.x и CentOS Stream 9 , где был подробно описан пошаговый процесс установки. Читать

habr.com/ru/articles/828276/

#информационные_технологии #almalinux #rocky_linux #centos #lemp #nginx #phpfpm #phpfpm_настройка #серверное_администрирование #mariadb

2024-07-15

Часть 1: Установка LEMP стека в AlmaLinux 9, RockyLinux 9 и CentOS Stream 9

В этой статье я подробно опишу процесс установки LEMP сервера, настройки пользователя sudo и фаервола (iptables), а также представлю свои скрипты для автоматизации этих процессов без использования популярных хостинг-панелей. Из-за большого объема материала я разделил статью на две части: первая часть посвящена установке LEMP сервера и настройке фаервола, а вторая — настройке LEMP сервера под ключ. В этой статье рассмотрим: 1. Настройка sudo 2. Настройка Firewall (iptables) 3. Настройка репозиториев 4. Установка PHP 5. Установка Nginx 6. Установка MariaDB Читать

habr.com/ru/articles/828164/

#информационные_технологии #almalinux #rocky_linux #centos #lemp #nginx #mariadb #iptables #phpfpm #серверное_администрирование

2024-06-06

TIL: if you run "php-fpm -tt", it will not only test your configuration but also dump it on screen, very useful for figuring out what is wrong :) #PHP #PHPFPM

Scott Williams 🐧vwbusguy@mastodon.online
2024-06-05

I feel like #Kubernetes largely tamed #Tomcat for #Java webapps but #phpfpm remains a greedy and fickle yet necessary beast for #php.

2024-06-04

Пример использования Workerman и Symfony Messenger

Недавно мной был создан самодостаточный пример совместной работы компонентов Symfony Messenger и Symfony Console, подробно описанный в статье habr.com/ru/articles/817425/ . Для демонстрации работы этого примера нужно вручную запустить несколько консолей (терминалов), а потом в каждой вручную запустить Worker. Мой внутренний перфекционист :-) сильно против этого возражал и говорил «а вот бы все эти консоли-терминалы запускались одной командой, в нужном количестве, сразу с Worker’ами, а если какой Worker упадёт, то заново запускались в нужном количестве». Возражать своему внутреннему перфекционисту я не стал и создал ещё один пример работы Symfony Messenger, который запускается Worker’ами из PHP фреймворка Workerman . При этом Symfony Console вообще не используется. Пример: Workerman и Symfony Messenger

habr.com/ru/articles/819187/

#worker #workerman #symfony_components #symfony #php #phpfpm #symfonymessenger #асинхронность_в_php #multithreading

Paul Wilde :dontpanic2: :smeghead: :archlinux: :freebsd:paul@notnull.space
2024-05-21

Hmmm, I don't know if it's #bhyve, #ZFS or a #PHPFPM memory tweak, but my Nextcloud instance is flying since I moved to a #bhyve hypervisor (and also switch the guest from #Rocky to #Debian)
Could be any or all of those changes, but I like it so far!

2024-04-15

Настраиваем Windows WSL для локальной разработки Laravel

Всем привет! В этой небольшой статье я очень сжато расскажу, как правильно настроить WSL в Windows 11 для локальной разработки Laravel-приложения. Мы собираемся установить php, mysql, nginx и composer, а также отредактирьвать файл hosts в самом Windows. Заранее прошу не гневаться на меня поклонников Docker, здесь я рассказываю именно про WSL. Итак, без лишних промедлений, приступим. И начнем с того, что, как мы предполагаем, у нас есть Windows и всё. Если WSL уже установлен, львиную часть статьи можно пропустить. Убедитесь в том, что у ваша версия Windows совместима с WSL.

habr.com/ru/articles/807859/

#Laravel #wsl #windows #разработка_сайтов #настройка_linux #настройка_windows #phpfpm #composer

King Beauregardkingbeauregard@c.im
2023-09-22

PHP-FPM IS TAKING UP TOO MUCH MEMORY

PHP-FPM is the process manager for FastCGI, which executes PHP scripts under Web servers like Apache. Its default setting is to assume that your Web server is going to have to service a high number of requests quickly, and so it will keep a number of processes floating in memory.

That's normally fine. The problem comes in if your server is running any resource-intensive, memory-heavy scripts; then PHP-FPM keeps those processes floating in memory with a grip on those resources. This is the "dynamic" approach.

The alternative is to get PHP-FPM to create processes as needed and then destroy them once they're completed. Edit /etc/php-fpm.d/www.conf and change "pm" from "dynamic" to "ondemand":

pm = ondemand

Then run “systemctl restart php-fpm”. (or whatever command your Linux uses to restart daemons)

There is also a setting to control how long a process sits in memory before being destroyed; the default is 10 seconds. That means that a memory-intensive process might not get deleted if it gets reused within 10 seconds. So you might want to play with this setting to find the right balance between reusing and destroying.

#LinuxSolutions #phpfpm #phpfpmmemory

Out of Control :laravel: 🇨🇦outofcontrol@phpc.social
2023-09-07

If Video tutorials are your thing, and you want to learn a bit more about #Nginx and #phpfpm, fideloper has posted a few new videos over on YouTube. His latest is “How Nginx and PHP-FPM turn a web request into code”

Discussions on Reddit #Laravel subreddit reddit.com/r/laravel/comments/

youtube.com/watch?v=lh4RnczaAT

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst