Skip to content

Permission issues using a theme that uses composer #269

@lajennylove

Description

@lajennylove

Quick summary

I don't know if this is related to the new implementation regarding the PHP selector, but as soon as I tried to use it I found permission issues.

Here's the screenshot:
Screenshot 2024-06-17 at 8 26 10 p m

I tried to do the following to fix the issue:

# check the permissions
ls -l ../../cache/acorn/framework/cache/
total 0
drwxr-xr-x  2 lajennylove  staff  64 Jun 17 20:26 data
----------  1 lajennylove  staff   0 Jun 17 20:26 packages.php

# change change them
chmod -R 755 ../../cache/acorn/framework/cache/

# Then I tried to change the owner but then that wouldn't have access my self, I guess
chown -R www-data:www-data ../../cache/acorn/framework/cache/

Then I though it wouldn't work and I stopped trying.

Steps to reproduce

  1. Create a new site on Studio
  2. Switch to PHP 8.2
  3. Clone this Sage/Vite theme https://github.com/DevArge/sage-vite
  4. Before activating it, to do the following:
# Install vendor
composer install
# Install Vite
yarn 
# Build the assets
yarn build
  1. Then activate the theme, or even better... Just try to live previewing it to avoid having issues with a broken theme.

What you expected to happen

The theme gets activated with no issues like if you were using any other LAMP environment.

What actually happened

I get the following error and I think it could affect to all the users that require composer's cache packages or related:

Warning: require(/var/www/html/wp-content/cache/acorn/framework/cache/packages.php): Failed to open stream: Permission denied in /var/www/html/wp-content/themes/sage-vite/vendor/illuminate/filesystem/Filesystem.php on line 123

Fatal error: Uncaught Error: Failed opening required '/var/www/html/wp-content/cache/acorn/framework/cache/packages.php' (include_path='.:') in /var/www/html/wp-content/themes/sage-vite/vendor/illuminate/filesystem/Filesystem.php:123 Stack trace: #0 /var/www/html/wp-content/themes/sage-vite/vendor/illuminate/filesystem/Filesystem.php(124): Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure}() #1 /var/www/html/wp-content/themes/sage-vite/vendor/roots/acorn/src/Illuminate/Foundation/PackageManifest.php(111): Illuminate\Filesystem\Filesystem->getRequire('/var/www/html/w...') #2 /var/www/html/wp-content/themes/sage-vite/vendor/roots/acorn/src/Illuminate/Foundation/PackageManifest.php(90): Illuminate\Foundation\PackageManifest->getManifest() #3 /var/www/html/wp-content/themes/sage-vite/vendor/roots/acorn/src/Illuminate/Foundation/PackageManifest.php(79): Illuminate\Foundation\PackageManifest->config('aliases') #4 /var/www/html/wp-content/themes/sage-vite/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/RegisterFacades.php(25): Illuminate\Foundation\PackageManifest->aliases() #5 /var/www/html/wp-content/themes/sage-vite/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(263): Roots\Acorn\Bootstrap\RegisterFacades->bootstrap(Object(Roots\Acorn\Application)) #6 /var/www/html/wp-content/themes/sage-vite/vendor/roots/acorn/src/Illuminate/Foundation/Http/Kernel.php(186): Illuminate\Foundation\Application->bootstrapWith(Array) #7 /var/www/html/wp-content/themes/sage-vite/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php(187): Illuminate\Foundation\Http\Kernel->bootstrap(Object(Illuminate\Http\Request)) #8 /var/www/html/wp-content/themes/sage-vite/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php(103): Roots\Acorn\Bootloader->bootHttp() #9 /var/www/html/wp-content/themes/sage-vite/functions.php(43): Roots\Acorn\Bootloader->boot() #10 /var/www/html/wp-settings.php(663): include('/var/www/html/w...') #11 /var/www/html/wp-config.php(96): require_once('/var/www/html/w...') #12 /var/www/html/wp-load.php(50): require_once('/var/www/html/w...') #13 /var/www/html/wp-admin/admin.php(34): require_once('/var/www/html/w...') #14 /var/www/html/wp-admin/customize.php(13): require_once('/var/www/html/w...') #15 {main} thrown in /var/www/html/wp-content/themes/sage-vite/vendor/illuminate/filesystem/Filesystem.php on line 123

Impact

Most (> 50%)

Available workarounds?

No and the app is unusable

Platform

Mac Silicon

Logs or notes

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions