Title: php file/log
Last modified: November 25, 2024

---

# php file/log

 *  Resolved [Devin104](https://wordpress.org/support/users/devin104/)
 * (@devin104)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/php-file-log/)
 * Your Plugin is sending me the following message:
 * > The request to write the file /srv/htdocs/wp-content/advanced-cache.php failed.
   > Please check file and directory permissions on the file paths up to this point,
   > and your PHP error log. 1. Please navigate, via FTP, to the folder – /srv/htdocs/
   > wp-content 2. Edit or create a file with the name advanced-cache.php 3. Copy
   > and paste the following lines into the file:
   > For us novices in such matters could you kindly provide step-by-step instructions
   > in terms the lay person can understnd on how I am to do this?
   > Thank you
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-file-log%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [wpmansour](https://wordpress.org/support/users/wpmansour/)
 * (@wpmansour)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/php-file-log/#post-18162223)
 * This error happens because WP-Optimize needs to write to the `advanced-cache.
   php` file to enable caching, but it doesn’t have the necessary permissions.
 * To fix the issue, use an FTP client or your hosting File Manager to access your
   site files. Navigate to `/wp-content`, create a file named `advanced-cache.php`(
   if it doesn’t exist), and set permissions to 644. Open the file and paste this:
 *     ```wp-block-code
       <?php// WP-Optimize Cacheif ( ! defined('ABSPATH') ) {    exit; // Exit if accessed directly}
       ```
   
 * Save the file, ensure caching is enabled in WP-Optimize, and you’re all set! 
   If errors persist, check permissions or contact your host for assistance.
 *  Thread Starter [Devin104](https://wordpress.org/support/users/devin104/)
 * (@devin104)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/php-file-log/#post-18163807)
 * I am a novice with FTP client or Hosting File Manager including how to navigate
   to /wp-content or to create a file named advanced-cache.php and set permissions
   to 644.
 * I would need step-by-step instructions in order to do so.
 * As an alternative, would it work if I used the Code Snippet Plugin to enter this
   code:
 *     ```wp-block-code
       <?php// WP-Optimize Cacheif ( ! defined('ABSPATH') ) {exit; // Exit if accessed directly}
       ```
   
 * Thank you
 *  [wpmansour](https://wordpress.org/support/users/wpmansour/)
 * (@wpmansour)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/php-file-log/#post-18164239)
 * Unfortunately, using the Code Snippet Plugin won’t work because the `advanced-
   cache.php` file needs to be physically present in your site’s filesystem for 
   caching to function correctly. Here’s a step-by-step guide to resolve the issue
   and create the `advanced-cache.php` file. Don’t worry—it’s straightforward even
   if you’re new to this!
 * **Use Your Hosting File Manager**:
    - Log in to your hosting account and open the **File Manager**.
    - Navigate to the `wp-content` folder.
    - Check if `advanced-cache.php` exists. If not, create a new file with that 
      name.
    - Open the file and paste this code:
 *     ```wp-block-code
       <?php// WP-Optimize Cacheif ( ! defined('ABSPATH') ) {    exit; // Exit if accessed directly}
       ```
   
    - Save the file and set permissions to 644.
    - Finally, Enable Caching in WP-Optimize: Go to your WordPress Dashboard > WP-
      Optimize > Cache and make sure caching is turned on.
 * If you run into any issues, feel free to ask for further assistance

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘php file/log’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)
 * [ftp](https://wordpress.org/support/topic-tag/ftp/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 3 replies
 * 2 participants
 * Last reply from: [wpmansour](https://wordpress.org/support/users/wpmansour/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/php-file-log/#post-18164239)
 * Status: resolved