Search

Apr 25, 2016

PHP Get Id youtube from URL link

<?php
if (strpos($video, 'youtube') > 0) {
    preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+(?=\?)|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $video, $matches);
    $_video = 'https://www.youtube.com/embed/' . $matches[0];
}

Mar 25, 2016

[Exception] Missing write permissions to the following directories: pub/static folder - MAGENTO 2


How to debug and fix:

1) setup/src/Magento/Setup/Model/FilePermissions.php

2) Goto line 143 in method checkRecursiveDirectories

3) Add the lines var_dump($subDirectory);var_dump($subDirectory->isWritable()); return false;

4) Re run bin/magento setup:upgrade

Now you'll see what is really wrong, and you can fix it. Personally i remove everything in pub/static, this will be auto generated content so you should not be worried about that.