Hello there. I had to install multiple PHP's on my server (centos 9) because of customer demands. Some of them were very ugly, like trying to install PHP 5.3 and 5.4 on a very modern OS. Lots of incompatibilities and I believe I didn't do things very well. Yesterday the PHP 8.1 FPM was not working, complaining of "port already in use". I eventually found the source in several of /etc/opt/remi/php81/php-fpm.d files, where the listen port was overlapping with some other PHP process running. So, how are these port numbers generated? How does the system make sure that they are not already in use when it allocates them? It seems when you change the PHP version, the old webNNN.conf files are not deleted, but these could be speculations - I haven't been able to pinpoint them too accurately yet. I just moved a bunch of webNNN.conf files out until PHP 8.1 FPM started working again yesterday. I just want to prevent future boo-boos. Many thanks, -t
Ports used by ISPConfig for PHP-FPM can not overlap, as they are based on the PHP-FPM start port (see Sysetm > Server config > web) plus the website's ID. So, every port is unique, as there can not be two websites with the same ID. As mentioned below, your issue is likely not an issue with non-unique ports assigned but an issue with processes that write config files being interrupted somehow or backups that contain old config files being restored. These get deleted automatically when you change the PHP version; you can see this in debug mode. If files were left over, then there must have been an issue e.g. the process that writes and deletes the files was stopped or you copied back configs or backups manually outside of ISPConfig which contained these config files.
Many thanks for that information. I wouldn't dare touch those directories unless it stopped working. Btw, my debug mode doesn't record too much stuff into /var/log/ispconfig/ispconfig.log actually. I don't know why really, mainly safe_exec's are listed, and cron remove locks. In fact, I just checked and that's ALL that there is in that file. Yet I have: //** Logging $conf['log_file'] = $conf['ispconfig_log_dir'].$conf['fs_div'].'ispconfig.log'; $conf['log_priority'] = 0; // 0 = Debug, 1 = Warning, 2 = Error What could be wrong?
Debug mode is not configured in that file; you enable debug mode in the interface. It is described in read before posting post, which points you to this guide: https://www.faqforge.com/linux/debugging-ispconfig-3-server-actions-in-case-of-a-failure/
I FINALLY found the real cause! It was a really dumb thing that I did. I installed many PHP's using REMI's repository. I had also installed PHP 8.1 as well. But the OS also had PHP 8.1 installed!. So there were two sets of php 8.1's on the system, in separate folders, but intermixed in some settings. I finally noticed the issue when I noticed that remi's php-81 fpm was not starting when I restarted the machine, saying port already in use. I deleted the whole remi 8.1, fixed the ispconfig setup, and it started right up.