• Resolved john.m.c

    (@johnmc-1)


    Problem: The site was down because we found out because the full path for the site has changed so we needed to change the cache path to reflect this for the site to work again.

    The current PATH of this plugin seems to be static.
    Current path is: /srv/bindings/ABC1234/code/wp-content/uploads

    Example:

    /srv/bindings/ABC1234/code/wp-content/uploads – the directory after /bindings/ was changed last week when it was down.

    This is happening in other hosting platform. Binding IDs change from time to time due to container migrations as part of maintenance.

    So I believe this plugin needs to use $_SERVER variable instead to retrieve the binding path.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Raul P.

    (@alignak)

    What you are saying is slightly incorrect.
    Unless.. you have manually inserted a cache path on the plugin settings, for which case will become static.

    By default, the cache path is empty and therefore FVM will take the filepath directly from wordpress sing the wp_upload_dir function.
    https://developer.www.ads-software.com/reference/functions/wp_upload_dir/

    If you need to use a custom cache directory, there should be a server alias for your bindings path, so instead of /srv/bindings/ABC1234/ it should probably be /home/ABC1234/some-path

    Also pleae note, that github repository is not official and I don’t have it publicly available on github.

    I suggest using the default path, or asking your host for an alias you can use on the cache path.

    Hi @alignak!

    Thanks for looking into this, there might be a possibility that the plugin might be caching the complete file path which might be a similar open issue in WooCommerce https://github.com/woocommerce/woocommerce/issues/23751 which they are trying to add a patch at the moment so the plugin will not to cache the full path https://github.com/woocommerce/woocommerce/pull/23971

    We are wondering if there are any workarounds to filter that cache function or are you open to collaborating in finding a long term fix for this to make it work on container-based platforms?

    Plugin Author Raul P.

    (@alignak)

    @carl-alberto FVM doesn’t cache the file path, unless you manually define it on the plugin settings.

    However, if your server is using a remote disk such as NFS, or under certain nginx/apache configurations, your server may be itself caching file paths. If that’s the case, PHP will retrieve the file path from cache, rather than from looking for the file on the disk.

    Thanks @alignak, it seems when server path changes, you can manually override from here https://screencast.com/t/sVkIoVbNa aside from clearing the cache

    Plugin Author Raul P.

    (@alignak)

    @carl-alberto yes, that’s exactly what I said.

    By default the path is empty, so it takes it from wordpress itself realtime (the label showing underneath the field).

    Ask your hosting if you don’t have an alternative path, that doesn’t change.
    Usually that’s the case.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘File path for this plugin needs to use $_SERVER variable #1’ is closed to new replies.