ข้ามการนำทาง

Resolved

Reported for: WPML Multilingual CMS 3.6.1

Resolved in: 3.6.2

Overview of the issue

On some server configurations, WPML is not allowed to create a cache directory even though the permissions should allow to. This issue has been reported for IIS/8.5 server so far.

Workaround

We are still investigating this issue. In the meantime, we can suggest two alternatives:

  1. Make sure the web server is allowed to write in the wp-content directory.
  2. Define a specific “cache” directory in the wp-config.php file like the following:
    define( 'WPML_CACHE_PATH_ROOT', '/absolute/path/to/cache/folder/' );
    Where ‘/absolute/path/to/cache/folder/’ is the absolute path to your cache directory which should be writable by the web server.

12 การตอบกลับ ถึง “Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to create the cache directory...'”

  1. Similar issue here. Error message is below. Our hosting provider does not allow writing files with PHP extension to cache directory for security reasons.

    Failed to write cache file
    ….wp-content/cache/wpml/twig/22/22a0b4e76c9d5699160a979893341298d3f501b940621405963d6c09b723f5ce.php”.’ in /nas/content/live/softactivity/wp-content/plugins/wpml-translation-management/vendor/twig/twig/lib/Twig/Cache/Filesystem.php:84\nStack trace:\n#0 /nas/content/live/softactivity/wp-content/plugins/wpml-translation-management/vendor/twig/twig/lib/Twig/Environment.php(448): Twig_Cache_Filesystem->write(‘/nas/content/li…’, ‘loadTemplate(‘template.twig’)\n#2 /nas/content/live/softactivity/wp-content/plugins/sitepress-multilingual-cms/classes/class-wpml-templates-factory.php(38): Twig_Environment->render(‘template.twig’, Array)\n#3 /nas/content/live/softactivity/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-w in ….wp-content/plugins/wpml-translation-management/vendor/twig/twig/lib/Twig/Cache/Filesystem.php on line 84

  2. I have a specific error that relates to the Buddy Press integration plugin. I updated the WordPress core and WPML at the same time, would this be the issue?

    Fatal error: Uncaught exception ‘InvalidArgumentException’ with message ‘Argument ID must be numeric and greater than 0.’ in /home/sionltdc/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php:28 Stack trace: #0 /home/sionltdc/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/canonicals/class-wpml-canonicals.php(78): WPML_Translation_Element->__construct(0, Object(SitePress)) #1 /home/sionltdc/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/compatibility/wpseo/class-wpml-wpseo-filters.php(71): WPML_Canonicals->get_canonical_url(false, Object(WP_Post)) #2 [internal function]: WPML_WPSEO_Filters->canonical_filter(false) #3 /home/sionltdc/public_html/wp-includes/class-wp-hook.php(298): call_user_func_array(Array, Array) #4 /home/sionltdc/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(false, Array) #5 /home/sionltdc/public_html/wp-content/plugins/wordpress-seo/frontend/class-frontend.php(1001): apply_filters(‘wpseo_ in /home/sionltdc/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php on line 28

    • We released just now a beta for WPML that allows it to work with WPEngine restrictions. We’ll update the texts in this errata in a few minutes. You should go to your WPML account, click on Downloads and get the Beta package. Unzip it and use the WPML components from there. This will go out as the production version on Monday.

    • We have also contacted WP Engine support and they said:

      “Our Security App Amour is there so that a binary php cannot create another binary php. That is an exploit within itself.”

      They are essentially saying that another PHP file can’t create another PHP file which is what the plugin is attempting to do.

      Contrary to that however, is the fact that the twig file is actually being created as I’ve FTP’d the server and can browse to it. I am unable to download the file due to a Read permission…

      • It’s fine. We are not asking WPEngine to make any change in their system. We released just now a beta for WPML that allows it to work with WPEngine restrictions. We’ll update the texts in this errata in a few minutes. You should go to your WPML account, click on Downloads and get the Beta package. Unzip it and use the WPML components from there. This will go out as the production version on Monday.