• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Please beaware of a breaking change in the REST API on the current Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

Question Php-fpm / Must reload if update symbolic link

Erwan

Regular Pleskian
Server operating system version
AlmaLinux 9.3
Plesk version and microupdate number
18.0.60
Hi all,

We have a website installed on two instances with Plesk and shared storage. It uses PHP FPM and the website directory is: /var/www/vhosts/mondomain/current/.
"current" is a symbolic link that points to a version (currently after e.g. "release/1").
Everything works fine.

The problem is that when we change the symbolic link (e.g. "release/2"), PHP FPM continues to use "release/1".
We need to do a manual reload for the change to take effect.

Is there any way to avoid this?
 
Hi all,

We have a website installed on two instances with Plesk and shared storage. It uses PHP FPM and the website directory is: /var/www/vhosts/mondomain/current/.
"current" is a symbolic link that points to a version (currently after e.g. "release/1").
Everything works fine.

The problem is that when we change the symbolic link (e.g. "release/2"), PHP FPM continues to use "release/1".
We need to do a manual reload for the change to take effect.

Is there any way to avoid this?
To ensure PHP-FPM recognizes the updated symbolic link without a manual reload, you can use the "clear_env" directive in your PHP-FPM configuration or script a reload trigger post-deployment.
 
Hi,

Sorry for my late answer.
The problem actually comes from "opcache".
If I deactivate it in "Performance booster" (JIT, realpath cache...), the modification works.

So I was thinking of using the PHP opcache_reset() function.

But I have a few questions:
- if this function is called in a PHP script for a particular site (there are several on the instances), will the reset apply to all sites?
- from what I understand, opcache storage is done in memory. In this case, there are two instances with shared storage. If the script is only called by one instance, the other is not refreshed and therefore the modification is not taken into account.

This is to fully understand before setting up on the site in production.

Thank you.

Erwan
 
So I was thinking of using the PHP opcache_reset() function.

But I have a few questions:
- if this function is called in a PHP script for a particular site (there are several on the instances), will the reset apply to all sites?
Yes, for all sites running the same PHP handler. If the site runs a dedicate PHP handler, then it would only apply to that site.
 
Back
Top