$hlsPath = $uploadPath . '/hls/';
FileHelper::createDirectory($hlsPath);
$hlsMaster = $hlsPath . 'master.m3u8';
$cmd = "ffmpeg -i {$originalPath} " .
"-c:v libx264 -c:a aac -strict experimental " .
"-f hls " .
"-movflags +faststart " .
"-hls_time 10 " .
"-hls_list_size 0 " .
"-hls_segment_filename {$hlsPath}segment_%03d.ts " .
"{$hlsMaster} 2>&1";
exec($cmd, $output, $returnCode); <?php
namespace App\Controllers;
class Account extends BaseController
{
public function index()
{
$data['title'] = 'Аккуант';
return view('account_header_menu, $data);
}
} где мне надо прописать git remote add (на своем компьютере или на сервере)
git remote add вы прописываете на своем компьютере. ~/.ssh/authorized_keys прописываете публичные ключи пользователей, которые будут иметь доступ к репозиторию.repo.git и установить владельцем пользователя git:cd ~
mkdir repo.git
chown git:git repo.gitcd repo.git
git --bare initgit remote add origin ssh://git@<айпи сервера>:repo.gitindex.php в папке public в котором будут выводиться изображения: <?php
require __DIR__ . '/functions.php';
$images = getAllImages();
<?php
foreach ($images as $image) {
$imageLink = __DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . $image ;
echo '<div><img src="' . $imageLink . '" alt="' . $image. '"></div>';
}functions.php в папке public :/**
* Функция сканирования папки в поиске изображений
*
* @param string $directory
* @return array
*/
function getAllImages(string $directory = __DIR__ . '/images/'): array
{
$images = [];
$ignoreFiles = ['.', '..',];
$files = scandir($directory);
foreach ($files as $file) {
if (in_array($file, $ignoreFiles)) {
continue;
}
$images[] = $file;
}
return $images;
}images, которая находится в папке public $(document).ready(function() {
$('.image').wrap('<div class="image_wrapper"></div>');
$('.text').wrap('<div class="text_wrapper"></div>');
} sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
sudo apt-get install mysql-server mysql-clienthttpd.conf указываем:# Устанавливаем корневой директорией "basic/web"
DocumentRoot "path/to/basic/web"
<Directory "path/to/basic/web">
RewriteEngine on
# Если запрашиваемая в URL директория или файл существуют обращаемся к ним напрямую
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Если нет - перенаправляем запрос на index.php
RewriteRule . index.php
# ...прочие настройки...
</Directory>path/to/basic/web - это путь до вашей точки входа в Yii2 (если у вас другой путь, то заменить). php.ini файле:extension=pdo.so
extension=pdo_mysql.sosudo service apache2 restartsystem/config/default.phpconfig.php из корневой директории и admin/config.php , оказалось что не все константы указывали правильные пути на новом сервере.