Problem to install Sage


#1

Hi everyone,
im new on this and I try to install sage in my localhost.
This happened when i active the theme “malte”

Warning: file_put_contents(/Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/uploads/cache/22f7710ebcbb24d3e58b9b6d4e672dc37c4f37b0.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/themes/malte/vendor/illuminate/filesystem/Filesystem.php on line 122

Warning: include(/Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/uploads/cache/22f7710ebcbb24d3e58b9b6d4e672dc37c4f37b0.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/themes/malte/vendor/illuminate/view/Engines/PhpEngine.php on line 43

Warning: include(): Failed opening '/Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/uploads/cache/22f7710ebcbb24d3e58b9b6d4e672dc37c4f37b0.php' for inclusion (include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/themes/malte/vendor/illuminate/view/Engines/PhpEngine.php on line 43

Some relevant information
XAMPP
localhost
PHP Version 7.2.7
Node.js installation in user/local/bin/node

➜  ~ node -v
v8.11.3
➜  ~ npm -v
5.6.0
➜  ~

config.json

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

If anyone can help me i would be so grateful. , Thank you! Markos


#2

Your publicPath should be a path relative to the web root not a URL. Try /malte/wp-content/themes/malte/. That seems to be what works for XAMPP/MAMP installs.


#3

Hi knowler,
thanks for your feedback. I changed the path but the problem persist.

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

I tested

➜  malte yarn build
yarn run v1.9.4
$ webpack --progress --config resources/assets/build/webpack.config.js
 11% building modules 14/15 modules 1 active ...lte/resources/assets/styles/main.scssWARNING: The `text-hide()` mixin has been deprecated as of v4.1.0. It will be removed entirely in v5.
         on line 10 of node_modules/bootstrap/scss/mixins/_text-hide.scss, in mixin `text-hide`
         from line 57 of node_modules/bootstrap/scss/utilities/_text.scss
         from line 14 of node_modules/bootstrap/scss/_utilities.scss
         from line 41 of node_modules/bootstrap/scss/bootstrap.scss
         from line 4 of resources/assets/styles/autoload/_bootstrap.scss
         from line 4 of stdin

 95% emitting

 DONE  Compiled successfully in 4041ms                                  22:12:41

                    Asset     Size  Chunks             Chunk Names
          scripts/main.js   217 kB       0  [emitted]  main
    scripts/customizer.js  3.26 kB       1  [emitted]  customizer
          styles/main.css   237 kB       0  [emitted]  main
      scripts/main.js.map   346 kB       0  [emitted]  main
      styles/main.css.map   422 kB       0  [emitted]  main
scripts/customizer.js.map  3.08 kB       1  [emitted]  customizer
✨  Done in 7.40s.
➜  malte

Thanks!


#4

I should have asked initially, what is the problem? Can you explain it more? Right now it is really ambiguous. Here are some questions you could answer for us:

  • How do you know Sage is the problem?
  • Does your WordPress install work with the standard Twenty Seventeen theme installed and activated?
  • Can you explain the steps you when through to install Sage? Did you use composer create-project roots/sage my-theme or did you clone the repo and composer install that way? Is the theme activated?
  • What do you see when you navigate to the above mentioned URL?
  • Are there any errors?
  • Is debugging enabled for your WordPress install?

#5

Ok,

  1. How do you know Sage is the problem?
    I’m not sure where the problem is occurring

  2. Does your WordPress install work with the standard Twenty Seventeen theme installed and activated?

Yes my wordpress instalation is correct and activate

  1. Can you explain the steps you when through to install Sage? Did you use composer create-project roots/sage my-theme or did you clone the repo and composer install that way? Is the theme activated?

I used composer
and I make this

➜ ~ cd …
➜ /Users cd …
➜ / applications
➜ /applications xampp/htdocs/malte
➜ malte wp-content/themes
➜ themes composer create-project roots/sage malte
Installing roots/sage (9.0.1)

  • Installing roots/sage (9.0.1): Loading from cache
    Created project in malte
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
    Package operations: 27 installs, 0 updates, 0 removals
  • Installing composer/installers (v1.5.0): Loading from cache
  • Installing symfony/polyfill-mbstring (v1.7.0): Loading from cache
  • Installing symfony/translation (v4.0.8): Loading from cache
  • Installing nesbot/carbon (1.27.0): Loading from cache
  • Installing psr/simple-cache (1.0.1): Loading from cache
  • Installing psr/container (1.0.0): Loading from cache
  • Installing illuminate/contracts (v5.6.17): Loading from cache
  • Installing doctrine/inflector (v1.3.0): Loading from cache
  • Installing illuminate/support (v5.6.17): Loading from cache
  • Installing illuminate/container (v5.6.17): Loading from cache
  • Installing illuminate/events (v5.6.17): Loading from cache
  • Installing psr/log (1.0.2): Loading from cache
  • Installing symfony/debug (v4.0.8): Loading from cache
  • Installing symfony/finder (v4.0.8): Loading from cache
  • Installing illuminate/filesystem (v5.6.17): Loading from cache
  • Installing illuminate/view (v5.6.17): Loading from cache
  • Installing illuminate/config (v5.6.17): Loading from cache
  • Installing roots/sage-lib (9.0.1): Loading from cache
  • Installing symfony/yaml (v3.4.8): Loading from cache
  • Installing hassankhan/config (0.10.0): Loading from cache
  • Installing brain/hierarchy (2.3.1): Loading from cache
  • Installing soberwp/controller (9.0.0-beta.4): Loading from cache
  • Installing symfony/process (v3.4.8): Loading from cache
  • Installing symfony/console (v4.0.8): Loading from cache
  • Installing illuminate/console (v5.6.17): Loading from cache
  • Installing roots/sage-installer (1.3.6): Loading from cache
  • Installing squizlabs/php_codesniffer (2.9.1): Loading from cache
    symfony/translation suggests installing symfony/config
    illuminate/support suggests installing symfony/var-dumper (Required to use the dd function (~4.0).)
    illuminate/filesystem suggests installing league/flysystem (Required to use the Flysystem local and FTP drivers (~1.0).)
    illuminate/filesystem suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)
    illuminate/filesystem suggests installing league/flysystem-cached-adapter (Required to use the Flysystem cache (~1.0).)
    illuminate/filesystem suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
    illuminate/filesystem suggests installing league/flysystem-sftp (Required to use the Flysystem SFTP driver (~1.0).)
    symfony/console suggests installing symfony/event-dispatcher
    symfony/console suggests installing symfony/lock
    illuminate/console suggests installing dragonmantank/cron-expression (Required to use scheduling component (~2.0).)
    illuminate/console suggests installing guzzlehttp/guzzle (Required to use the ping methods on schedules (~6.0).)
    Generating autoload files

Roots\Sage\Installer\ComposerScript::postCreateProject

Theme Name [Sage Starter Theme]:

malte

Theme URI [https://roots.io/sage/]:

Theme Description [Sage is a WordPress starter theme.]:

Theme Version [9.0.1]:

Theme Author [Roots]:

Theme Author URI [https://roots.io/]:

Local development URL of WP site [http://example.test]:

http://localhost/malte

Path to theme directory (e.g., /wp-content/themes/malte) [/app/themes/sage]:

Which framework would you like to load? [Bootstrap]:
[0] None
[1] Bootstrap
[2] Bulma
[3] Foundation
[4] Tachyons

1

Are you sure you want to overwrite the following files?

  • scripts/autoload/_bootstrap.js
  • styles/autoload/_bootstrap.scss
  • styles/common/_variables.scss
  • styles/components/_comments.scss
  • styles/components/_forms.scss
  • styles/components/_wp-classes.scss
  • styles/layouts/_header.scss

(yes/no) [no]:

no

No actions were taken.
➜ themes malte

—I instal yarn–

➜ malte yarn
yarn install v1.9.4
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] :mag: Validating package.json…
[2/5] :mag: Resolving packages…
[3/5] :truck: Fetching packages…
[4/5] :link: Linking dependencies…
warning " > stylelint-webpack-plugin@0.10.4" has incorrect peer dependency “webpack@^1.13.2 || ^2.7.0 || ^3.11.0 || ^4.4.0”.
[5/5] :page_with_curl: Building fresh packages…
:sparkles: Done in 36.82s.
➜ malte

–And then yarn build–

➜ malte yarn build
yarn run v1.9.4
$ webpack --progress --config resources/assets/build/webpack.config.js
95% emitting i
DONE Compiled successfully in 4736ms 06:05:57

                Asset     Size  Chunks             Chunk Names
      scripts/main.js   216 kB       0  [emitted]  main
scripts/customizer.js  3.24 kB       1  [emitted]  customizer
      styles/main.css   238 kB       0  [emitted]  main
  scripts/main.js.map   345 kB       0  [emitted]  main
  styles/main.css.map   423 kB       0  [emitted]  main

scripts/customizer.js.map 3.07 kB 1 [emitted] customizer
:sparkles: Done in 7.71s.
➜ malte

—I select the theme and i have the same error —
Warning: file_put_contents(/Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/uploads/cache/22f7710ebcbb24d3e58b9b6d4e672dc37c4f37b0.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/themes/malte/vendor/illuminate/filesystem/Filesystem.php on line 122

Warning: include(/Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/uploads/cache/22f7710ebcbb24d3e58b9b6d4e672dc37c4f37b0.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/themes/malte/vendor/illuminate/view/Engines/PhpEngine.php on line 43

Warning: include(): Failed opening ‘/Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/uploads/cache/22f7710ebcbb24d3e58b9b6d4e672dc37c4f37b0.php’ for inclusion (include_path=’.:/Applications/XAMPP/xamppfiles/lib/php’) in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/themes/malte/vendor/illuminate/view/Engines/PhpEngine.php on line 43

but when a try to activate i have this error.

malte cd …
➜ themes cd …
➜ wp-content cd …
➜ malte wp activate sage
Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-includes/wp-db.php on line 1531
Error: Error establishing a database connection. This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
➜ malte wp activate sage/resources
Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-includes/wp-db.php on line 1531
Error: Error establishing a database connection. This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.

But wordpress work with the default themes.

  1. What do you see when you navigate to the above mentioned URL?

This is from localhost/malte/wp-admin

This screen from localhost/malte with the theme

Screen with devtools

  1. Are there any errors?
    Yes the same problem
    Warning: file_put_contents(/Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/uploads/cache/22f7710ebcbb24d3e58b9b6d4e672dc37c4f37b0.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/themes/malte/vendor/illuminate/filesystem/Filesystem.php on line 122

Warning: include(/Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/uploads/cache/22f7710ebcbb24d3e58b9b6d4e672dc37c4f37b0.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/themes/malte/vendor/illuminate/view/Engines/PhpEngine.php on line 43

Warning: include(): Failed opening ‘/Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/uploads/cache/22f7710ebcbb24d3e58b9b6d4e672dc37c4f37b0.php’ for inclusion (include_path=’.:/Applications/XAMPP/xamppfiles/lib/php’) in /Applications/XAMPP/xamppfiles/htdocs/malte/wp-content/themes/malte/vendor/illuminate/view/Engines/PhpEngine.php on line 43

Is debugging enabled for your WordPress install?
Yes is enabled

This is my folder structure

Thanks knowler for your time, Im really stuck with this!


#6

I found the problem!!
Was the permission in my wp-content folder in my localhost! Im not understand why?

I found this solution because I was trying upload a picture and appear this error.

“Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server.”

I change the permission to 755 and then I upload the picture.

So I was thinking in that and then I tried to install sage and was successful :smile:

The problem was the permission in my wp-content folder. But this is no normal.

Im going to install wordpress again and see what happen.

Thanks for all!


#7

This makes sense, because uploads needs to be writeable for the sake of Blade which compiles the templates to the cache directory in there.