Viewed   54 times

I'm pretty new at laravel, in fact and I'm trying to create my very first project. for some reason I keep getting this error (I haven't even started coding yet)

Error in exception handler: The stream or file "/var/www/laravel/app/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /var/www/laravel/bootstrap/compiled.php:8423

I've read this has something to do with permissions but chmod -R 775 storage didn't help at all.

 Answers

1

To fix this issue, you need to change the ownership of the directory to the unix user that the webserver uses.

  1. Get out of the VM
  2. Using the console, go to your synced folder (vagrant)
  3. sudo chown -R $USER:www-data storage
  4. chmod -R 775 storage

Even though I created the project within the VM using the VM user, the folder belonged to the user in the real computer; so, when trying to

Now it's working.

Thanks to all those that helped me figure this thing out

EDIT:

Actually, it still wasn't working, it still gave me a "permission denied" problem.

Here's what I did, I modified my Vagrantfile like this:

config.vm.synced_folder "./app","/var/www/", create:true,
:owner => "vagrant",
:group => "www-data",
:mount_options => ["dmode=775","fmode=664"]
Thursday, September 8, 2022
3

Make sure to get() the subpages as IlluminateSupportCollection and mapWithKeys() to reformat the results. Use toArray() to provide the format Nova assumes:

private function selectOptions(): array
{
    $subpages = DB::table('subpages')->get();
    return $subpages->mapWithKeys(function ($subpage) {
        return [$subpage->slug => $subpage->slug];
    })->toArray();
}

This is how the returned result should look like:

[
    'my-article-1' => 'my-article-1',
    'my-article-2' => 'my-article-2',
    'my-article-3' => 'my-article-3',
]
Thursday, September 1, 2022
 
talha_q
 
3

Decode to array and array_combine with the new keys.
Then loop the 'agent' and replace the keys again with array_combine.

$arr = json_decode($json, true);
$mainkeys = ["url", "secret_token", "agent"];
$subkeys = ["id", "quantity"];

$arr = array_combine(array_slice($mainkeys,0,count($arr)), $arr);

if(isset($arr["agent"])){
    foreach($arr["agent"] as &$val){
        $val = array_combine($subkeys, $val);
    }
}
unset($val); 

https://3v4l.org/mKePQ

array(3) {
  ["url"]=>
  string(26) "https://www.gosdoddgle.com"
  ["secret_token"]=>
  string(25) "stringstrinngstringstring"
  ["agent"]=>
  array(2) {
    [0]=>
    array(2) {
      ["id"]=>
      string(6) "sdsds1"
      ["quantity"]=>
      string(6) "sdsds1"
    }
    [1]=>
    &array(2) {
      ["id"]=>
      string(6) "sdsds1"
      ["quantity"]=>
      string(6) "sdsds1"
    }
  }
}
Tuesday, August 23, 2022
3

This bug will be fixed in a future version.

For now:

  • Close down VS2017
  • Go to "C:Users{username}AppDataLocal.IdentityService"
  • Rename "IdentityServiceAdalCache.cache" as shown below. (for example just add an underscore to it)
  • Restart VS2017 and log in.

NOTE: There are similar issues that this won't resolve, but this worked for me.

Tuesday, August 30, 2022
 
marnir
 
5

Found the solution via this

TransformXml task could not be loaded from Microsoft.Web.Publishing.Tasks.dll

In my case, I had Visual Studio 2012 installed on an E: drive already, so I found a copy of Microsoft.Web.Publishing.Tasks in

E:Program Files (x86)MSBuildMicrosoftVisualStudiov11.0Web

So I copied that file, and Microsoft.Web.XmlTransform to here:

C:Program Files (x86)MSBuildMicrosoftVisualStudiov12.0Web

and now all is well :)

Thursday, September 29, 2022
 
mozilla
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 
Share