File_put_contents() and include() failed to open stream on fresh sage install

Hi all,

followed these install instructions roots/sage github (no bedrock) inside of /themes/ folder of a previously installed and accessible wordpress, but when I try to open up http://localhost/wordpress/ now I get these errors:

**Warning** : file_put_contents(/var/www/html/wordpress/wp-content/uploads/cache/b912e5b2521a0a121ab2ed99c0cfcd23fc0211c6.php): failed to open stream: No such file or directory in  **/var/www/html/wordpress/wp-content/themes/your-theme-name/vendor/illuminate/filesystem/Filesystem.php**  on line  **122**

**Warning** : include(/var/www/html/wordpress/wp-content/uploads/cache/b912e5b2521a0a121ab2ed99c0cfcd23fc0211c6.php): failed to open stream: No such file or directory in  **/var/www/html/wordpress/wp-content/themes/your-theme-name/vendor/illuminate/view/Engines/PhpEngine.php**  on line  **43**

**Warning** : include(): Failed opening '/var/www/html/wordpress/wp-content/uploads/cache/b912e5b2521a0a121ab2ed99c0cfcd23fc0211c6.php' for inclusion (include_path='.:/usr/share/php') in  **/var/www/html/wordpress/wp-content/themes/your-theme-name/vendor/illuminate/view/Engines/PhpEngine.php**  on line  **43**

Why is “b912e5b2521a0a121ab2ed99c0cfcd23fc0211c6.php” trying to be opened? What part of the process should have created it? Here is my config.json:

{
  "entry": {
    "main": [
      "./scripts/main.js",
      "./styles/main.scss"
    ],
    "customizer": [
      "./scripts/customizer.js"
    ]
  },
  "publicPath": "/wp-content/themes/sage",
  "devUrl": "http://sage.test",
  "proxyUrl": "http://localhost:3000",
  "cacheBusting": "[name]_[hash:8]",
  "watch": [
    "app/**/*.php",
    "config/**/*.php",
    "resources/views/**/*.php"
  ]
}

b912e5b2521a0a121ab2ed99c0cfcd23fc0211c6.php is (or would be) a file rendered by Blade from your Blade templates. If it can’t be found or created, I would check and make sure your paths are all valid and you don’t have any permissions issues.

2 Likes

thx for the reply, issue was with /public/ folder permissions.

1 Like

I know this is an old post, but I found another case where file_put_contents fails: updating lando version. I needed to rebuild my container. Maybe this note will help someone else.

Just try to add permission for upload folder.

chmod -R 0777 uploads