User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gentoo:separated-php [2024/03/12 08:40] willygentoo:separated-php [2025/03/13 13:27] (current) – [Using independent PHP for different services] willy
Line 1: Line 1:
-====== Using independent PHP for different services ======+====== L) Using independent PHP for different services ======
  
 Ideally, you want to run each PHP-based service within the boundaries of it's own PHP instance. The advantages of such a solution would be that each PHP instance can run as the service user which guarantee service isolation and more protection in data access. Ideally, you want to run each PHP-based service within the boundaries of it's own PHP instance. The advantages of such a solution would be that each PHP instance can run as the service user which guarantee service isolation and more protection in data access.
Line 21: Line 21:
 <code bash> <code bash>
 cp -a /etc/php/fpm-php8.2 /etc/php/fpm-service1 cp -a /etc/php/fpm-php8.2 /etc/php/fpm-service1
 +rm /etc/php/fpm-service1/php.ini
 </code> </code>
 Choose your preferred (or required) PHP version for service1. Choose your preferred (or required) PHP version for service1.
 +Your PHP FPM will still use the **php.ini** from the original setup folder, so delete the copied one or you will get confused!
  
 Then,  you need the following edit to your **/etc/init.d/php-fpm** script because, by default, your //service1// will be used as it was a PHP version but there is no PHP version numbered //service1//, so you need to separate the two things. The edit is simple, you need to split the PHP_SLOT variable to a PHP_SLOT_EXEC one that you can change. This approach will alow the __original__ way to still work while supporting also our __new__ way. Find the row: Then,  you need the following edit to your **/etc/init.d/php-fpm** script because, by default, your //service1// will be used as it was a PHP version but there is no PHP version numbered //service1//, so you need to separate the two things. The edit is simple, you need to split the PHP_SLOT variable to a PHP_SLOT_EXEC one that you can change. This approach will alow the __original__ way to still work while supporting also our __new__ way. Find the row:

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information