<!DOCTYPE html>
<html class="h-100" data-bs-theme="light" data-mantine-color-scheme="light" lang="ru" prefix="og: https://ogp.me/ns#">
<head>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<link crossorigin="true" href="https://cdn.hexlet.io" rel="preconnect">
<link href="https://mc.yandex.ru" rel="preconnect">
<meta content="aa2vrdtq64dub8knuf83lwywit311w" name="facebook-domain-verification">
<link href="/favicon.ico" rel="icon" sizes="any">
<link href="/favicon.svg" rel="icon" type="image/svg+xml">
<link href="/apple-touch-icon.png" rel="apple-touch-icon">
<link href="/manifest.webmanifest" rel="manifest">
<script>
//<![CDATA[
window.gon={};gon.ym_counter="25559621";gon.is_bot=true;gon.applications={};gon.current_user={"id":null,"last_viewed_notification_id":null,"email":null,"state":null,"first_name":"","last_name":"","created_at":"2026-02-26 19:00:27 UTC","current_program":null,"current_team":null,"full_name":"","guest":true,"can_use_paid_features":false,"is_hexlet_employee":false,"sanitized_phone_number":"","can_subscribe":true,"can_renew_education":false};gon.token="u_VefJ-d0WTldysk8Gmj8LIh_WnzkY83yA9g_j5kRWFUJJVLbeN8BFM0D7z8ZlOHcijQw_umcZV17_qqbGOiDw";gon.locale="ru";gon.language="ru";gon.theme="light";gon.rails_env="production";gon.mobile=false;gon.google={"analytics_key":"UA-1360700-51","optimize_key":"GTM-5QDVFPF"};gon.captcha={"google_v3_site_key":"6LenGbgZAAAAAM7HbrDbn5JlizCSzPcS767c9vaY","yandex_site_key":"ysc1_Vyob5ZPPUdPBsu0ykt8bVFdzsfpoVjQChLGl2b4g19647a89","verification_failed":null};gon.social_signin=false;gon.typoreporter_google_form_id="1FAIpQLSeibfGq-KvWQ2Fyru-zkFFRVTLBuzXAHAoEyN1p49FtDmNoNA";
//]]>
</script>
<meta charset="utf-8">
<title>Composer | PHP: Настройка окружения</title>
<meta name="description" content="Composer / PHP: Настройка окружения: Выясняем, зачем нужен пакетный менеджер и какие задачи он решает">
<link rel="canonical" href="https://ru.hexlet.io/courses/php-setup-environment/lessons/composer/theory_unit">
<meta name="robots" content="noarchive">
<meta property="og:title" content="Composer">
<meta property="og:title" content="PHP: Настройка окружения">
<meta property="og:description" content="Composer / PHP: Настройка окружения: Выясняем, зачем нужен пакетный менеджер и какие задачи он решает">
<meta property="og:url" content="https://ru.hexlet.io/courses/php-setup-environment/lessons/composer/theory_unit">
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="M6fAIbAHGcMDaXDJbOUG1BzS_N8JU1Ye3fQqkV7lJp3cdgsWQnm0o7UqVFFg6vaj3NvRdQFkqLxgFLDFDOLB8w" />
<script src="/vite/assets/inertia-DfXos102.js" crossorigin="anonymous" type="module"></script><link rel="modulepreload" href="/vite/assets/chunk-DsPFFUou.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/preload-helper-BJ4cLWpC.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/init-BrRXra1y.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/ahoy-DrlRQ-1D.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/analytics-cb8xch9l.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/ErrorFallbackBlock-naDSYSy9.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Surface-DL2bpZA-.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/gon-D3e4yh1x.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/mantine-CGMYrt2Y.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/utils-DRqSHbQE.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/routes-CCH8ilKF.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/extends-C-EagtpE.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/inheritsLoose-BBd-DCVI.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/objectWithoutPropertiesLoose-DRHXDhjp.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/index.esm-DAqKOkZ0.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Button-CGPUux8l.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/CloseButton-D1euiPao.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Group-BX48WcuU.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Loader-BQEY8g6v.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Modal-Cy3HByv7.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/OptionalPortal-1Hza5P2w.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Stack-CtjJzfw4.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Textarea-Ck64llAy.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Box-B5-OOzBf.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/DirectionProvider-Dc9zdUke.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/events-DJQOhap0.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/use-reduced-motion-D2owz4wa.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/use-disclosure-zKtK5W1r.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/use-hotkeys-Cnc_Rwkb.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/random-id-DOQyszCZ.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/notifications.store-C-3AFSMn.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/exports-C_MrNx_T.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/axios-BEvgo0ym.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/dayjs.min-BkKovM-s.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/i18next-BlSq9s7B.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/client-U9M77rxp.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-dom-DaLxUz_h.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/useTranslation-Bx1Cdrkz.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/compiler-runtime-6XxiPFnt.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/jsx-runtime-CwjcCKJi.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-CkL4ZRHB.js" as="script" crossorigin="anonymous">
<link rel="stylesheet" href="/vite/assets/application-BqhCP46M.js" />
<script src="/vite/assets/application-Df9RExpe.js" crossorigin="anonymous" type="module"></script><link rel="modulepreload" href="/vite/assets/chunk-DsPFFUou.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/autocomplete-VMNbxKGl.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/routes-CCH8ilKF.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/createPopper-C3aM9r1M.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/js.cookie-D1-O8zkX.js" as="script" crossorigin="anonymous"><link rel="stylesheet" href="/vite/assets/application-C8HjmMaq.css" media="screen" />
<script>
window.ym = function(){(ym.a=ym.a||[]).push(arguments)};
window.addEventListener('load', function() {
setTimeout(function() {
ym.l = 1*new Date();
ym(window.gon.ym_counter, "init", {
clickmap: true,
trackLinks: true,
accurateTrackBounce: true,
webvisor: true
});
// Загружаем скрипт
var k = document.createElement('script');
k.async = 1;
k.src = 'https://mc.yandex.ru/metrika/tag.js';
document.head.appendChild(k);
ym(window.gon.ym_counter, 'getClientID', function(clientID) {
window.ymClientId = clientID;
});
}, 1500);
});
</script>
<!-- Google Tag Manager - deferred -->
<script>
// dataLayer stub сразу — пуши работают до загрузки скрипта
window.dataLayer = window.dataLayer || [];
// Сам скрипт — отложенно после load
window.addEventListener('load', function() {
setTimeout(function() {
dataLayer.push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
var j = document.createElement('script');
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=GTM-WK88TH';
document.head.appendChild(j);
}, 1500);
});
</script>
<!-- End Google Tag Manager -->
</head>
<body>
<noscript>
<div>
<img alt="" src="https://mc.yandex.ru/watch/25559621" style="position:absolute; left:-9999px;">
</div>
</noscript>
<header class="sticky-top bg-body">
<nav class="navbar navbar-expand-lg">
<div class="container-xxl">
<a class="navbar-brand" href="/"><img alt="Логотип Хекслета" height="24" src="https://ru.hexlet.io/vite/assets/logo_ru_light-BpiEA1LT.svg" width="96">
</a><button aria-controls="collapsable" aria-expanded="false" aria-label="Меню" class="navbar-toggler border-0 mb-0 mt-1" data-bs-target="#collapsable" data-bs-toggle="collapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsable">
<ul class="navbar-nav mb-lg-0 mt-lg-1">
<li class="nav-item dropdown">
<button aria-haspopup class="btn nav-link" data-bs-toggle="dropdown" type="button">
Все курсы
<span class="bi bi-chevron-down align-middle ms-1"></span>
</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item d-flex py-2" href="/courses"><div class="fw-bold me-auto">Все что есть</div>
<div class="text-muted">117</div>
</a></li>
<li>
<hr class="dropdown-divider">
</li>
<li class="dropdown-item">
<b>Популярные категории</b>
</li>
<li>
<a class="dropdown-item py-2" href="/courses_devops">Курсы по DevOps
</a></li>
<li>
<a class="dropdown-item py-2" href="/courses_data_analytics">Курсы по аналитике данных
</a></li>
<li>
<a class="dropdown-item py-2" href="/courses_programming">Курсы по программированию
</a></li>
<li>
<a class="dropdown-item py-2" href="/courses_testing">Курсы по тестированию
</a></li>
<li>
<hr class="dropdown-divider">
</li>
<li class="dropdown-item">
<b>Популярные курсы</b>
</li>
<li>
<a class="dropdown-item py-2" href="/programs/devops-engineer-from-scratch">DevOps-инженер с нуля
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/go">Go-разработчик
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/java">Java-разработчик
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/python">Python-разработчик
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/qa-auto-engineer-java">Автоматизатор тестирования на Java
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/data-analytics">Аналитик данных
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/frontend">Фронтенд-разработчик
</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<button aria-haspopup class="btn nav-link" data-bs-toggle="dropdown" type="button">
О Хекслете
<span class="bi bi-chevron-down align-middle"></span>
</button>
<ul class="dropdown-menu bg-body">
<li>
<a class="dropdown-item py-2" href="/pages/about">О нас
</a></li>
<li>
<a class="dropdown-item py-2" href="/blog">Блог
</a></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://special.hexlet.io/hse-research" role="button">Результаты (Исследование)
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://career.hexlet.io" role="button">Хекслет Карьера
</span></li>
<li>
<a class="dropdown-item py-2" href="/testimonials">Отзывы студентов
</a></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://t.me/hexlet_help_bot" role="button">Поддержка (В ТГ)
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://special.hexlet.io/referal-program/?promo_creative=priglasite-druzei&promo_name=referal-program&promo_position=promo_position&promo_start=010724&promo_type=link" role="button">Реферальная программа
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://special.hexlet.io/certificate" role="button">Подарочные сертификаты
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://hh.ru/employer/4307094" role="button">Вакансии
</span></li>
<li>
<span class="dropdown-item d-flex external-link" rel="noopener noreferrer nofollow" data-href="https://b2b.hexlet.io" data-target="_blank" role="button">Компаниям
</span></li>
<li>
<span class="dropdown-item d-flex external-link" rel="noopener noreferrer nofollow" data-href="https://hexly.ru/" data-target="_blank" role="button">Колледж
</span></li>
<li>
<span class="dropdown-item d-flex external-link" rel="noopener noreferrer nofollow" data-href="https://hexlyschool.ru/" data-target="_blank" role="button">Частная школа
</span></li>
</ul>
</li>
<li><a class="nav-link" href="/subscription/new">Подписка</a></li>
</ul>
<ul class="navbar-nav flex-lg-row align-items-lg-center gap-2 ms-auto">
<li>
<a class="nav-link" aria-label="Переключить тему" href="/theme/switch?new_theme=dark"><span aria-hidden="true" class="bi bi-moon"></span>
</a></li>
<li>
<span data-target="_self" class="nav-link external-link" data-href="/u/new" role="button"><span>Регистрация</span>
</span></li>
<li>
<span data-target="_self" class="nav-link external-link" data-href="https://ru.hexlet.io/session/new" role="button"><span>Вход</span>
</span></li>
</ul>
</div>
</div>
</nav>
</header>
<div class="x-container-xxxl">
</div>
<main class="mb-6 min-vh-100 h-100">
<link rel="preload" as="image" href="https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6Mzk5MiwicHVyIjoiYmxvYl9pZCJ9fQ==--e9d0f30948ea766a7e6bc3e3d56c192344d45fb8/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Programming-cuate%20(1).png"/><link rel="preload" as="image" href="/vite/assets/development-BVihs_d5.png"/><div id="app" data-page="{"component":"web/courses/lessons/theory_unit","props":{"errors":{},"locale":"ru","language":"ru","httpsHost":"https://ru.hexlet.io","host":"ru.hexlet.io","colorScheme":"light","auth":{"user":{"id":null,"last_viewed_notification_id":null,"email":null,"state":null,"first_name":"","last_name":"","created_at":"2026-02-26T19:00:27.094Z","current_program":null,"current_team":null,"full_name":"","guest":true,"can_use_paid_features":false,"is_hexlet_employee":false,"sanitized_phone_number":"","can_subscribe":true,"can_renew_education":false}},"cloudflareTurnstileSiteKey":"0x4AAAAAAA15KmeFXzd2H0Xo","vkIdClientId":"51586979","yandexIdClientId":"88d071f1d3384eb4bd1deb37910235c7","formAuthToken":"71DVGaTI6oxcy6KD1M_Ceq9bDWC_Me1yjhnDiukDIOkAgR4uVrZH7OqIhhvYwDINb1IgyrcGE9Az-VneuwTHhw","topics":[{"id":31679,"title":"У меня совершенная путаница между темой неймспейсов и управлением зависимостями через composer. В теме про неймспейсы говорилось, что в первую очередь так разделяются области видимости. Но там файлы подключались через requier_once.\n\nComposer же собирает все наши библиотеки, включая самописные и делает возможным их использование через require_once 'vendor/autoload.php';\n\nЯ правильно понимаю, что неймспейсы (созданные по стандартам) никаких классов/участков кодов не подгружают? И для того чтобы использовать библиотеки обязательно подключать autoload.php?\n\nТо есть делаем мы веб-приложение и для каких-то целей создаем новую точку входа. Там ваяем обработчик, который принимает какие-то данные, обрабатываем их с помощью библиотек, возвращаем результат. Вначале обработчика обязательно же подключать autoload.php, так?\n\nСумбурно получилось, многие вещи мне еще не понятны, поэтому и вопрос сформулировать сложно. И уж тем более самому проверить.","plain_title":"У меня совершенная путаница между темой неймспейсов и управлением зависимостями через composer. В теме про неймспейсы говорилось, что в первую очередь так разделяются области видимости. Но там файлы подключались через requier_once. Composer же собирает все наши библиотеки, включая самописные и делает возможным их использование через require_once 'vendor/autoload.php'; Я правильно понимаю, что неймспейсы (созданные по стандартам) никаких классов/участков кодов не подгружают? И для того чтобы использовать библиотеки обязательно подключать autoload.php? То есть делаем мы веб-приложение и для каких-то целей создаем новую точку входа. Там ваяем обработчик, который принимает какие-то данные, обрабатываем их с помощью библиотек, возвращаем результат. Вначале обработчика обязательно же подключать autoload.php, так? Сумбурно получилось, многие вещи мне еще не понятны, поэтому и вопрос сформулировать сложно. И уж тем более самому проверить. ","creator":{"public_name":"Александр Петраков","id":125514,"is_tutor":false},"comments":[{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":68896,"body":"Более того, это стандарт. В проекте весь код должен подгружаться автоматически композером. Это снижает уровень сложности и связанности кода.","topic_id":31679},{"creator":{"public_name":"","id":164434,"is_tutor":false},"id":68846,"body":"Всё верно, неймспейсы сами по себе ничего не подгружают вообще, помимо назначения неймспейсов подгрузку надо делать отдельно. Либо вручную прописывать через require или include (на практике так почти никогда не делают), либо через __'vendor/autoload.php'__, который всё сам собирает и подключает, экономля нам кучу времени.\n\n> И для того чтобы использовать библиотеки обязательно подключать autoload.php?\n\nТеоретически можно и вручную подключить и всё прописать :), но практически всегда подключают через autoload в начале файла.","topic_id":31679}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Composer","entity_url":null,"active":true}},{"id":24191,"title":"Один из самых хреновых курсов на хекслете. Очень бесит, решил забросить.","plain_title":"Один из самых хреновых курсов на хекслете. Очень бесит, решил забросить. ","creator":{"public_name":"Alexandr","id":27968,"is_tutor":false},"comments":[{"creator":{"public_name":"Сергей К.","id":5174,"is_tutor":false},"id":51609,"body":"Александр, опишите, что по-вашему мнению получилось неудачно, и как это можно исправить. Мы учтём ваши пожелания в будущих редакциях курса.","topic_id":24191}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Composer","entity_url":null,"active":true}},{"id":18749,"title":"пишу export PATH=$PATH:$HOME/.composer/vendor/bin\nно при открытии нового терминала переменная PATH возвращается к прежнему состоянию - пропадает $HOME/.composer/vendor/bin\n\nчерез sudo не помогло -\n```\nsudo: export: команда не найдена\n```","plain_title":"пишу export PATH=$PATH:$HOME/.composer/vendor/bin но при открытии нового терминала переменная PATH возвращается к прежнему состоянию - пропадает $HOME/.composer/vendor/bin через sudo не помогло - sudo: export: команда не найдена ","creator":{"public_name":"Zahar Steblovskiy","id":111870,"is_tutor":false},"comments":[{"creator":{"public_name":"Zahar Steblovskiy","id":111870,"is_tutor":false},"id":39619,"body":"нашел в /etc/environment =)","topic_id":18749},{"creator":{"public_name":"Zahar Steblovskiy","id":111870,"is_tutor":false},"id":39616,"body":"у меня в убунте ~/.bashrc = но там нет вообще строки с PATH. Добавлять просто в конец \"export PATH=$PATH:$HOME/.composer/vendor/bin\" ?","topic_id":18749},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":39569,"body":"export работает только для текущей баш сессии. Если вы хотите чтобы оно работало глобально, то эту строчку нужно добавить либо в `~/.bashrc` либо в `~/.bash_profile`.","topic_id":18749},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":39792,"body":"Все же в environment обавлять неверно, потому что тогда это сработает для всех. ","topic_id":18749}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Composer","entity_url":null,"active":true}},{"id":18987,"title":"Здравствуйте! Не работает эта команда\n> composer global require phploc/phploc\nПишет :\n```\nChanged current directory to /home/andrey/.config/composer\nUsing version ^4.0 for phploc/phploc\n./composer.json has been created\nLoading composer repositories with package information\nUpdating dependencies (including require-dev)\nYour requirements could not be resolved to an installable set of packages.\n\n Problem 1\n - phploc/phploc 4.0.0 requires sebastian/finder-facade ^1.1 -> satisfiable by sebastian/finder-facade[1.1.0, 1.2.0, 1.2.1, 1.2.2].\n - phploc/phploc 4.0.1 requires sebastian/finder-facade ^1.1 -> satisfiable by sebastian/finder-facade[1.1.0, 1.2.0, 1.2.1, 1.2.2].\n - sebastian/finder-facade 1.1.0 requires theseer/fdomdocument >=1.3.1 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6].\n - sebastian/finder-facade 1.2.0 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6].\n - sebastian/finder-facade 1.2.1 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6].\n - sebastian/finder-facade 1.2.2 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6].\n - theseer/fdomdocument 1.6.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.5.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.4.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.4.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.4.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - Installation request for phploc/phploc ^4.0 -> satisfiable by phploc/phploc[4.0.0, 4.0.1].\n\n To enable extensions, verify that they are enabled in your .ini files:\n - /etc/php/7.2/cli/php.ini\n - /etc/php/7.2/cli/conf.d/10-opcache.ini\n - /etc/php/7.2/cli/conf.d/10-pdo.ini\n - /etc/php/7.2/cli/conf.d/20-calendar.ini\n - /etc/php/7.2/cli/conf.d/20-ctype.ini\n - /etc/php/7.2/cli/conf.d/20-exif.ini\n - /etc/php/7.2/cli/conf.d/20-fileinfo.ini\n - /etc/php/7.2/cli/conf.d/20-ftp.ini\n - /etc/php/7.2/cli/conf.d/20-gettext.ini\n - /etc/php/7.2/cli/conf.d/20-iconv.ini\n - /etc/php/7.2/cli/conf.d/20-json.ini\n - /etc/php/7.2/cli/conf.d/20-phar.ini\n - /etc/php/7.2/cli/conf.d/20-posix.ini\n - /etc/php/7.2/cli/conf.d/20-readline.ini\n - /etc/php/7.2/cli/conf.d/20-shmop.ini\n - /etc/php/7.2/cli/conf.d/20-sockets.ini\n - /etc/php/7.2/cli/conf.d/20-sysvmsg.ini\n - /etc/php/7.2/cli/conf.d/20-sysvsem.ini\n - /etc/php/7.2/cli/conf.d/20-sysvshm.ini\n - /etc/php/7.2/cli/conf.d/20-tokenizer.ini\n You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.\n\nInstallation failed, deleting ./composer.json.\n```","plain_title":"Здравствуйте! Не работает эта команда composer global require phploc/phploc Пишет : ``` Changed current directory to /home/andrey/.config/composer Using version ^4.0 for phploc/phploc ./composer.json has been created Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - phploc/phploc 4.0.0 requires sebastian/finder-facade ^1.1 -> satisfiable by sebastian/finder-facade[1.1.0, 1.2.0, 1.2.1, 1.2.2]. - phploc/phploc 4.0.1 requires sebastian/finder-facade ^1.1 -> satisfiable by sebastian/finder-facade[1.1.0, 1.2.0, 1.2.1, 1.2.2]. - sebastian/finder-facade 1.1.0 requires theseer/fdomdocument >=1.3.1 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6]. - sebastian/finder-facade 1.2.0 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6]. - sebastian/finder-facade 1.2.1 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6]. - sebastian/finder-facade 1.2.2 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6]. - theseer/fdomdocument 1.6.6 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.5 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.5.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.4.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.4.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.4.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - Installation request for phploc/phploc ^4.0 -> satisfiable by phploc/phploc[4.0.0, 4.0.1]. To enable extensions, verify that they are enabled in your .ini files: - /etc/php/7.2/cli/php.ini - /etc/php/7.2/cli/conf.d/10-opcache.ini - /etc/php/7.2/cli/conf.d/10-pdo.ini - /etc/php/7.2/cli/conf.d/20-calendar.ini - /etc/php/7.2/cli/conf.d/20-ctype.ini - /etc/php/7.2/cli/conf.d/20-exif.ini - /etc/php/7.2/cli/conf.d/20-fileinfo.ini - /etc/php/7.2/cli/conf.d/20-ftp.ini - /etc/php/7.2/cli/conf.d/20-gettext.ini - /etc/php/7.2/cli/conf.d/20-iconv.ini - /etc/php/7.2/cli/conf.d/20-json.ini - /etc/php/7.2/cli/conf.d/20-phar.ini - /etc/php/7.2/cli/conf.d/20-posix.ini - /etc/php/7.2/cli/conf.d/20-readline.ini - /etc/php/7.2/cli/conf.d/20-shmop.ini - /etc/php/7.2/cli/conf.d/20-sockets.ini - /etc/php/7.2/cli/conf.d/20-sysvmsg.ini - /etc/php/7.2/cli/conf.d/20-sysvsem.ini - /etc/php/7.2/cli/conf.d/20-sysvshm.ini - /etc/php/7.2/cli/conf.d/20-tokenizer.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode. Installation failed, deleting ./composer.json. ``` ","creator":{"public_name":"Андрей Захватошин","id":183403,"is_tutor":false},"comments":[{"creator":{"public_name":"Андрей Захватошин","id":183403,"is_tutor":false},"id":40104,"body":"После манипуляций с .bash_profile выходит это\n```\nIn RequireCommand.php line 81:\n \n file_put_contents(./composer.json): failed to open stream: Permission denie \n d \n \n\nrequire [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...\n\n```\nВернул его обратно, но эта ошибка осталась","topic_id":18987},{"creator":{"public_name":"Андрей Захватошин","id":183403,"is_tutor":false},"id":40206,"body":"Спасибо. Разобрался\n","topic_id":18987},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":40195,"body":"> file_put_contents(./composer.json): failed to open stream: Permission denie \n d \n\nОшибка не связана с bash_profile, тут пишут что с правами не все в порядке. Вам нужно изучить этот вопрос https://ru.hexlet.io/courses/cli-basics тогда станет понятнее.\n\n> - theseer/fdomdocument 1.6.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n\nПопробуйте перевести, что здесь написано?","topic_id":18987}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Composer","entity_url":null,"active":true}},{"id":29432,"title":"Composer устанавливать глобально или локально?","plain_title":"Composer устанавливать глобально или локально? ","creator":{"public_name":"Роман Перепихненко","id":63984,"is_tutor":false},"comments":[{"creator":{"public_name":"","id":315406,"is_tutor":false},"id":107282,"body":"**Александр О.**, присоединюсь к вашей еврейской общине - а как вы думаете, понимает ли в чем разница между двумя способами установки человек, который спрашивает как лучше установить компоузер?","topic_id":29432},{"creator":{"public_name":"Роман Перепихненко","id":63984,"is_tutor":false},"id":63809,"body":"**Александр О.**, https://getcomposer.org/doc/00-intro.md ну тут два вариант установки, какой выбрать при установке у себе на системе?\n","topic_id":29432},{"creator":{"public_name":"Александр О.","id":61806,"is_tutor":false},"id":64040,"body":"**Роман Перепихненко**,\n\n> ну тут два вариант установки\n\nА вы понимаете, чем принципиально отличаются эти два способа установки? Ну, как будет работать composer при локальной установке, а как — при глобальной?","topic_id":29432},{"creator":{"public_name":"Александр О.","id":61806,"is_tutor":false},"id":63777,"body":"Уточните, пожалуйста, что вы понимаете под локальным вариантом установки composer?","topic_id":29432}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Composer","entity_url":null,"active":true}},{"id":42893,"title":"Добрый день. Целый день мучаюсь с установкой, перепробовал все ответы в гугле, но так и не решил проблему. Система Linux Mint, php7.4.6, composer 1.10.6. При установке phploc выдаёт ` \n Problem 1\n\n - Installation request for sebastian/version (locked at 2.0.1) -> satisfiable by sebastian/version[2.0.1].\n\n - phploc/phploc 6.0.0 requires sebastian/version ^3.0 -> satisfiable by sebastian/version[3.0.0].\n\n - phploc/phploc 6.0.1 requires sebastian/version ^3.0 -> satisfiable by sebastian/version[3.0.0].\n\n - phploc/phploc 6.0.2 requires sebastian/version ^3.0 -> satisfiable by sebastian/version[3.0.0].\n\n - Conclusion: don't install sebastian/version 3.0.0\n\n - Installation request for phploc/phploc ^6.0 -> satisfiable by phploc/phploc[6.0.0, 6.0.1, 6.0.2].\n`\nНашёл, что sebastion/version входит в phpunit, и удалял и переустанавливал её - не помогает","plain_title":"Добрый день. Целый день мучаюсь с установкой, перепробовал все ответы в гугле, но так и не решил проблему. Система Linux Mint, php7.4.6, composer 1.10.6. При установке phploc выдаёт Problem 1 - Installation request for sebastian/version (locked at 2.0.1) -> satisfiable by sebastian/version[2.0.1]. - phploc/phploc 6.0.0 requires sebastian/version ^3.0 -> satisfiable by sebastian/version[3.0.0]. - phploc/phploc 6.0.1 requires sebastian/version ^3.0 -> satisfiable by sebastian/version[3.0.0]. - phploc/phploc 6.0.2 requires sebastian/version ^3.0 -> satisfiable by sebastian/version[3.0.0]. - Conclusion: don't install sebastian/version 3.0.0 - Installation request for phploc/phploc ^6.0 -> satisfiable by phploc/phploc[6.0.0, 6.0.1, 6.0.2]. Нашёл, что sebastion/version входит в phpunit, и удалял и переустанавливал её - не помогает ","creator":{"public_name":"Виктор Плеханов","id":284754,"is_tutor":false},"comments":[{"creator":{"public_name":"Nikolai Gagarinov","id":104929,"is_tutor":true},"id":93278,"body":"Привет, какой версии phpunit? Попробуй обновить, вроде `composer global update`.\nХорошо, если 8-9 версия phpunit","topic_id":42893}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Composer","entity_url":null,"active":true}},{"id":30214,"title":"Всё. Убился головой об стену. Help needed! 4-е сутки бьюсь с\n\n`composer global require phploc/phploc`\n\nСистема:\n\n\n\nHost: Windows 7 > Oracle VM VirtualBox 6 > Ubuntu 16.04\n\n>Your requirements could not be resolved to an installable set of packages.\n\n>Problem 1\n>- phploc/phploc 4.0.0 requires sebastian/finder-facade ^1.1 -> satisfiable by sebastian/finder-facade[1.1.0, 1.2.0, 1.2.1, 1.2.2].\n\n...\n\n>Installation failed, reverting ./composer.json to its original content.\n\nВывод полностью:\n\n```\nelkub@elkub-VirtualBox:~/.composer$ composer global require phploc/phploc\nChanged current directory to /home/elkub/.composer\nUsing version ^4.0 for phploc/phploc\n./composer.json has been updated\nLoading composer repositories with package information\nUpdating dependencies (including require-dev)\nYour requirements could not be resolved to an installable set of packages.\n\n Problem 1\n - phploc/phploc 4.0.0 requires sebastian/finder-facade ^1.1 -> satisfiable by sebastian/finder-facade[1.1.0, 1.2.0, 1.2.1, 1.2.2].\n - phploc/phploc 4.0.1 requires sebastian/finder-facade ^1.1 -> satisfiable by sebastian/finder-facade[1.1.0, 1.2.0, 1.2.1, 1.2.2].\n - sebastian/finder-facade 1.1.0 requires theseer/fdomdocument >=1.3.1 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6].\n - sebastian/finder-facade 1.2.0 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6].\n - sebastian/finder-facade 1.2.1 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6].\n - sebastian/finder-facade 1.2.2 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6].\n - theseer/fdomdocument 1.6.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.6.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.5.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.4.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.4.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - theseer/fdomdocument 1.4.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n - Installation request for phploc/phploc ^4.0 -> satisfiable by phploc/phploc[4.0.0, 4.0.1].\n\n To enable extensions, verify that they are enabled in your .ini files:\n - /etc/php/7.0/cli/php.ini\n - /etc/php/7.0/cli/conf.d/10-opcache.ini\n - /etc/php/7.0/cli/conf.d/10-pdo.ini\n - /etc/php/7.0/cli/conf.d/20-calendar.ini\n - /etc/php/7.0/cli/conf.d/20-ctype.ini\n - /etc/php/7.0/cli/conf.d/20-exif.ini\n - /etc/php/7.0/cli/conf.d/20-fileinfo.ini\n - /etc/php/7.0/cli/conf.d/20-ftp.ini\n - /etc/php/7.0/cli/conf.d/20-gettext.ini\n - /etc/php/7.0/cli/conf.d/20-iconv.ini\n - /etc/php/7.0/cli/conf.d/20-json.ini\n - /etc/php/7.0/cli/conf.d/20-phar.ini\n - /etc/php/7.0/cli/conf.d/20-posix.ini\n - /etc/php/7.0/cli/conf.d/20-readline.ini\n - /etc/php/7.0/cli/conf.d/20-shmop.ini\n - /etc/php/7.0/cli/conf.d/20-sockets.ini\n - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini\n - /etc/php/7.0/cli/conf.d/20-sysvsem.ini\n - /etc/php/7.0/cli/conf.d/20-sysvshm.ini\n - /etc/php/7.0/cli/conf.d/20-tokenizer.ini\n You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.\n\nInstallation failed, reverting ./composer.json to its original content.\n```","plain_title":"Всё. Убился головой об стену. Help needed! 4-е сутки бьюсь с composer global require phploc/phploc Система: Host: Windows 7 > Oracle VM VirtualBox 6 > Ubuntu 16.04 Your requirements could not be resolved to an installable set of packages. Problem 1 - phploc/phploc 4.0.0 requires sebastian/finder-facade ^1.1 -> satisfiable by sebastian/finder-facade[1.1.0, 1.2.0, 1.2.1, 1.2.2]. ... Installation failed, reverting ./composer.json to its original content. Вывод полностью: elkub@elkub-VirtualBox:~/.composer$ composer global require phploc/phploc Changed current directory to /home/elkub/.composer Using version ^4.0 for phploc/phploc ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - phploc/phploc 4.0.0 requires sebastian/finder-facade ^1.1 -> satisfiable by sebastian/finder-facade[1.1.0, 1.2.0, 1.2.1, 1.2.2]. - phploc/phploc 4.0.1 requires sebastian/finder-facade ^1.1 -> satisfiable by sebastian/finder-facade[1.1.0, 1.2.0, 1.2.1, 1.2.2]. - sebastian/finder-facade 1.1.0 requires theseer/fdomdocument >=1.3.1 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6]. - sebastian/finder-facade 1.2.0 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6]. - sebastian/finder-facade 1.2.1 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6]. - sebastian/finder-facade 1.2.2 requires theseer/fdomdocument ~1.3 -> satisfiable by theseer/fdomdocument[1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6]. - theseer/fdomdocument 1.6.6 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.5 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.6.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.5.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.4.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.4.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. - theseer/fdomdocument 1.4.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. - Installation request for phploc/phploc ^4.0 -> satisfiable by phploc/phploc[4.0.0, 4.0.1]. To enable extensions, verify that they are enabled in your .ini files: - /etc/php/7.0/cli/php.ini - /etc/php/7.0/cli/conf.d/10-opcache.ini - /etc/php/7.0/cli/conf.d/10-pdo.ini - /etc/php/7.0/cli/conf.d/20-calendar.ini - /etc/php/7.0/cli/conf.d/20-ctype.ini - /etc/php/7.0/cli/conf.d/20-exif.ini - /etc/php/7.0/cli/conf.d/20-fileinfo.ini - /etc/php/7.0/cli/conf.d/20-ftp.ini - /etc/php/7.0/cli/conf.d/20-gettext.ini - /etc/php/7.0/cli/conf.d/20-iconv.ini - /etc/php/7.0/cli/conf.d/20-json.ini - /etc/php/7.0/cli/conf.d/20-phar.ini - /etc/php/7.0/cli/conf.d/20-posix.ini - /etc/php/7.0/cli/conf.d/20-readline.ini - /etc/php/7.0/cli/conf.d/20-shmop.ini - /etc/php/7.0/cli/conf.d/20-sockets.ini - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini - /etc/php/7.0/cli/conf.d/20-sysvsem.ini - /etc/php/7.0/cli/conf.d/20-sysvshm.ini - /etc/php/7.0/cli/conf.d/20-tokenizer.ini You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode. Installation failed, reverting ./composer.json to its original content. ","creator":{"public_name":"Михаил Лось","id":209057,"is_tutor":false},"comments":[{"creator":{"public_name":"Михаил Лось","id":209057,"is_tutor":false},"id":68761,"body":"**Сергей Журбей**. В моем случае решилось с помощью\n\n_sudo apt install global_\n\nзатем - рекомендованных (https://stackoverflow.com/questions/43408604/php7-install-ext-dom-issue):\n1. _sudo apt install php7.2-xml_ \n2. _sudo apt install php-mbstring_\n3. и наконец, но не в последнюю очередь ))\n\n_composer global require phploc/phploc_\n\nПоставил всё на Систему:\nHost: Windows 7 > Oracle VM VirtualBox 5.2.8 r121009 (Qt5.6.2) > Ubuntu 18.04.1\n","topic_id":30214},{"creator":{"public_name":"Игорь Седнев","id":231634,"is_tutor":false},"id":65467,"body":"**Михаил Лось**, у вас криво стали зависимости. Прбойте сделать по порядку\n# sudo apt groupinstall development tools\n\n# sudo apt install curl php-cli php-mbstring git unzip\n\n# sudo apt update\nпосле чего уже устанавливай те composer","topic_id":30214},{"creator":{"public_name":"Михаил Лось","id":209057,"is_tutor":false},"id":65476,"body":"**Игорь Седнев**, грейт сэпсибоу! Но дальше \"тренироваться\" буду уже в пнд - втр. ","topic_id":30214},{"creator":{"public_name":"Михаил Лось","id":209057,"is_tutor":false},"id":65469,"body":"**Игорь Седнев**,\nт.е., установленный composer нужно сносить? Он себя, по-моему, вполне адекватно ведет. Проблема именно с phploc. На самом деле, я уже чистил, autoremov'ил систему (операционку) и т.д. Да и гит никого не обижает - работает... Его тоже вычищать? curl и php-cli тоже установлены - их тоже сносить?","topic_id":30214},{"creator":{"public_name":"Игорь Седнев","id":231634,"is_tutor":false},"id":65473,"body":"**Михаил Лось**, сносить не обезательно, apt install под убунтой проверяет чтобы были установлены все зависимости а apt update соответствие версий но если после этих команд не зароботает тогда либо проверять соответствие установленых зависимостей (из пэхапэшнного cli сделать php - - ini\nЛибо о катится на чистую (что имхо проще) и устанавливать по официальным мануалам с начала. В virtul box можно делать контрольные точки, желательно делать их перед каждым действием где могут начаться проблемы, экономит кучу нервов","topic_id":30214},{"creator":{"public_name":"Danil Gurachevskii","id":236724,"is_tutor":false},"id":66065,"body":"**Сергей Журбей**, Огромное спасибо помогло только это ","topic_id":30214},{"creator":{"public_name":"Михаил Лось","id":209057,"is_tutor":false},"id":65678,"body":"**Сергей Журбей**\nСпасибо. Обязательно проверю. К сожалению не сегодня - завалили \"текучкой\" - дня 4 разгребать :(","topic_id":30214},{"creator":{"public_name":"Sergey Zhurbey","id":236336,"is_tutor":false},"id":66261,"body":"**Danil Gurachevskii**, рад помочь =)","topic_id":30214},{"creator":{"public_name":"Михаил Лось","id":209057,"is_tutor":false},"id":68758,"body":"**Игорь Седнев**, ндаа... и вот через месяц я вернулся )) Не помогло, но... вот это (Сергей Журбей): https://stackoverflow.com/questions/43408604/php7-install-ext-dom-issue\nзаработало. Всё равно, спасибо за время и ответы","topic_id":30214},{"creator":{"public_name":"Sergey Zhurbey","id":236336,"is_tutor":false},"id":65676,"body":"Была такая же ошибка, ответ нашел здесь \nhttps://stackoverflow.com/questions/43408604/php7-install-ext-dom-issue\n","topic_id":30214},{"creator":{"public_name":"Михаил Лось","id":209057,"is_tutor":false},"id":65474,"body":"**Игорь Седнев**, есть контрольная, но далеко, еще до PHP. Попробую apt'ом. А вот `git unzip` - это на самом деле: `sudo apt install curl php-cli php-mbstring git unzip` ?","topic_id":30214},{"creator":{"public_name":"Игорь Седнев","id":231634,"is_tutor":false},"id":65475,"body":"**Михаил Лось**, да. И ещё попробуй sudo apt install phploc если заругается ставь по этой\nhttps://linux-notes.org/ustanovka-phploc-v-unix-linux/\nИнструкции ","topic_id":30214}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Composer","entity_url":null,"active":true}},{"id":31619,"title":"Выполнение команды > composer global require phploc/phploc\nзаканчивается следующим:\n\n Changed current directory to /home/webuser/.composer\n Using version ^4.0 for phploc/phploc\n ./composer.json has been updated\n Loading composer repositories with package information\n Updating dependencies (including require-dev)\n Killed\n\nЭто что-то пошло не так? :)\n\n","plain_title":"Выполнение команды > composer global require phploc/phploc заканчивается следующим: Changed current directory to /home/webuser/.composer Using version ^4.0 for phploc/phploc ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Killed Это что-то пошло не так? :) ","creator":{"public_name":"Евгений Лавелин","id":1472,"is_tutor":false},"comments":[{"creator":{"public_name":"Сергей К.","id":5174,"is_tutor":false},"id":68792,"body":"Евгений, приветствую! Загуглите ошибку. [Здесь](https://stackoverflow.com/questions/20667761/composer-killed-while-updating) и [здесь](https://github.com/composer/composer/issues/1815#issuecomment-16782526) примеры обсуждения аналогичной проблемы. Похоже, у вас не хватает ресурсов для обновления композера.","topic_id":31619}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Composer","entity_url":null,"active":true}},{"id":31809,"title":"> Чтобы shell увидел программу, установленную глобально, нужно правильно настроить переменную окружения $PATH.\n\nПравильно - это как?\n\n1. Нужно прописать в PATH локальный адрес Composer?\n2. И / или прописать локальный адрес интерпретатора PHP?\n3. Команда echo $PATH у меня возвращает просто “$PATH”. В примере на сайте - возвращает локальный адрес. Как мне добиться того же?\n","plain_title":"Чтобы shell увидел программу, установленную глобально, нужно правильно настроить переменную окружения $PATH. Правильно - это как? Нужно прописать в PATH локальный адрес Composer? И / или прописать локальный адрес интерпретатора PHP? Команда echo $PATH у меня возвращает просто “$PATH”. В примере на сайте - возвращает локальный адрес. Как мне добиться того же? ","creator":{"public_name":"Alex Sokolov","id":225918,"is_tutor":false},"comments":[{"creator":{"public_name":"Nikolai Gagarinov","id":104929,"is_tutor":true},"id":69184,"body":"Алекс, как устанавливали composer в систему? Советую использовать `chocolatey`. Он установит простой командой `choco install composer` Композер и пропишет его в путях. Специалльная папка должна находится примерно в таком месте `/Users/username/AppData/Roaming/Composer/vendor/bin/` А более точно можно узнать с помощью `composer global config home`","topic_id":31809},{"creator":{"public_name":"Nikolai Gagarinov","id":104929,"is_tutor":true},"id":69173,"body":"Алекс, привет. Какая операционная система? У композера есть специальная папка для исполняемых файлов, которые будут запускаться глобально. Вот её нужно добавить в переменную `PATH`","topic_id":31809},{"creator":{"public_name":"Андрей Миськов","id":103643,"is_tutor":false},"id":69289,"body":"Добрый день, Alex!\nВы уже успели ознакомиться с гайдом [Как работать с Linux используя Windows](https://guides.hexlet.io/ubuntu-linux-in-windows/)?","topic_id":31809},{"creator":{"public_name":"Alex Sokolov","id":225918,"is_tutor":false},"id":69176,"body":"Привет, Николай!\nУ меня windows 10.\nЯ как раз и ищу адрес этой \"специальной папки для исполняемых файлов\" чтобы добавить его в переменную PATH.\n","topic_id":31809}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Composer","entity_url":null,"active":true}},{"id":22205,"title":"Устанавливаю компосер, запускаю (пишу composer), а он говорит что такой команды не найденно","plain_title":"Устанавливаю компосер, запускаю (пишу composer), а он говорит что такой команды не найденно ","creator":{"public_name":"Владимир Резник","id":170614,"is_tutor":false},"comments":[{"creator":{"public_name":"Владимир Резник","id":170614,"is_tutor":false},"id":47366,"body":"24 гб свободно\n","topic_id":22205},{"creator":{"public_name":"Владимир Резник","id":170614,"is_tutor":false},"id":47304,"body":"написал php composer.phar и все получилось вроде)","topic_id":22205},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":47353,"body":"> Out of memory \n\nМало памяти)","topic_id":22205},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":47378,"body":"Оперативной? 0_o","topic_id":22205},{"creator":{"public_name":"Владимир Резник","id":170614,"is_tutor":false},"id":47303,"body":"Вот https://asciinema.org/a/pABSQkWzz3dPfmlV3Qd0R3Fk2","topic_id":22205},{"creator":{"public_name":"Владимир Резник","id":170614,"is_tutor":false},"id":47305,"body":"Появилась новая проблема, теперь когда пишу php composer.phar global require phploc/phploc, он мне выдает :\n\nPHP Fatal error: Out of memory (allocated 47710208) (tried to allocate 2097176 bytes) in phar:///home/mobaxterm/composer.phar/src/Composer/Util/RemoteFilesystem.php on line 594\n\nFatal error: Out of memory (allocated 47710208) (tried to allocate 2097176 bytes) in phar:///home/mobaxterm/composer.phar/src/Composer/Util/RemoteFilesystem.php on line 594\n","topic_id":22205},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":47284,"body":"Если команда не найдена, значит он не установлен либо установлен не правильно. Вы можете записать https://asciinema.org с процессом установки? Глянем как вы его ставите.","topic_id":22205}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Composer","entity_url":null,"active":true}}],"lesson":{"exercise":null,"units":[{"id":2128,"name":"theory","url":"/courses/php-setup-environment/lessons/composer/theory_unit"},{"id":2539,"name":"quiz","url":"/courses/php-setup-environment/lessons/composer/quiz_unit"}],"links":[{"id":425532,"name":"Переменная PATH","url":"https://en.wikipedia.org/wiki/PATH_(variable)\n"},{"id":425533,"name":"Изменение переменной PATH","url":"https://ru.hexlet.io/courses/cli-basics/lessons/execution/theory_unit#izmenenie-peremennoy-path\n"}],"ordered_units":[{"id":2128,"name":"theory","url":"/courses/php-setup-environment/lessons/composer/theory_unit"},{"id":2539,"name":"quiz","url":"/courses/php-setup-environment/lessons/composer/quiz_unit"}],"id":1027,"slug":"composer","state":"approved","name":"Composer","course_order":400,"goal":"Выясняем, зачем нужен пакетный менеджер и какие задачи он решает","self_study":"1. В проекте _hexlet-php_ инициализируйте PHP-проект\n1. Заполните пустые поля файла _composer.json_. Чтобы было проще, изучить описание каждого поля в [документации Composer](https://getcomposer.org/doc/04-schema.md)\n1. Добавьте все изменения на GitHub\n","theory_video_provider":null,"theory_video_uid":null,"theory":"Ключевая программа в экосистеме PHP — это Composer. Она выполняет так много функций, что мы не сможем рассмотреть всё в рамках этого курса. Мы советуем периодически просматривать ее команды и изучать информацию по ним. Основная задача, которую решает Composer — **управление зависимостями**. Именно о нем мы поговорим в этом уроке.\n\nЧтобы установить Composer, изучите официальное руководство для [Windows](https://getcomposer.org/download/) и [Linux](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos). На MacOS все немного проще — Composer устанавливается через Homebrew командой `brew install composer`.\n\nДля успешной установки и настройки Composer нужно немного разбираться в работе с командными интерпретаторами. Рекомендуем пройти [соответствующий курс на Хекслете](https://ru.hexlet.io/courses/cli-basics), если вы этого еще не сделали.\n\nКроме самого Composer, установите следующие программы, используя пакетный менеджер вашей операционной системы:\n\n* [git](https://ru.wikipedia.org/wiki/Git)\n* [curl](https://ru.wikipedia.org/wiki/CURL)\n\n\n\nУбедитесь, что Composer работает:\n\n```bash\ncomposer\n ______\n / ____/___ ____ ___ ____ ____ ________ _____\n / / / __ \\/ __ `__ \\/ __ \\/ __ \\/ ___/ _ \\/ ___/\n/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /\n\\____/\\____/_/ /_/ /_/ .___/\\____/____/\\___/_/\n /_/\nComposer version 1.8.0 2018-12-03 10:31:16\n\n# Здесь много вывода\n```\n\nЗапуск Composer без аргументов выведет весь список доступных команд с их описанием. Пробегитесь по ним, чтобы сформировать первое впечатление.\n\nПочти с зарождения программирования появилась идея повторно использовать код не только в рамках одного проекта, но и в других проектах. Например, во всех проектах используются одни и те же функции для работы с датами, математическими формулами и расчетами. Такое переиспользование привело к росту производительности — современные программисты могут сосредоточиться на решении уникальных задач бизнеса, не тратя время на изобретение велосипеда под инфраструктурные задачи. Работать стало еще проще, когда появились Git и GitHub.\n\nПервоначально общий код выносился в файлы, которые программисты держали на своих компьютерах и копировали из проекта в проект. У такого способа есть ряд существенных недостатков:\n\n1. Код сложно передать другим\n1. У разных программистов хранятся разные копии одних и тех же решений\n1. Доработкой кода занимается только его автор\n1. В сумме много разных копий без возможности быстрого обновления\n1. Код копируется прямо в другой проект, поэтому он модифицируется и становится специфичным\n\nGit автоматически решает часть этих проблем. С его помощью можно создавать наборы общих файлов — библиотеки. Потом в конечных проектах можно использовать такие библиотеки причем как написанные нами, так и сторонними разработчиками.\n\nНо тут возникает новая сложность — когда библиотек становится много, у них появляется общий код более низкого уровня. Например, финансовые библиотеки могут использовать функции для преобразования валют. Чтобы подобный код не дублировался, хочется его вынести в общее место. Этот процесс может продолжаться бесконечно. Одни библиотеки зависят от других, которые зависят от третьих и так далее.\n\nС точки зрения переиспользования кода все хорошо — большое число маленьких библиотек решают всевозможные задачи, что позволяет быстро двигаться вперед. Но с точки зрения управления, появляются проблемы:\n\n1. Нужно вводить понятие «версия», потому что библиотеки начинают зависеть не только друг от друга, но и от версий друг друга. Для примера представим, что в новой версии библиотеки ее автор изменил параметры функций — это ломает обратную совместимость. В такой ситуации можно обновить вторую библиотеку, но тогда первая перестанет работать. Она рассчитывала на одно поведение зависимой библиотеки, а получила — другое.\n1. Нужно стандартизировать способ создания библиотек, чтобы автоматизировать их соединение. Типичный веб-проект может зависеть от сотни библиотек, которые в свою очередь зависят от других библиотек. Общее число зависимостей может легко перевалить за тысячу — вручную управлять таким зоопарком невозможно.\n1. Из-за проблемы выше нужно автоматизированное средство управления зависимостями — для их обновления, установки и удаления.\n\nВсеми этими вопросами занимаются **пакетные менеджеры**. Обычно пакетный менеджер поставляется вместе с языком программирования, потому что сложно представить себе современный код без единой зависимости.\n\n## Терминология\n\nВ PHP есть два важных понятия:\n\n* **Пакет** — это та самая библиотека, которую мы пишем или используем в проекте как зависимость\n* **Репозиторий** — это хранилище пакетов PHP, которое называется [Packagist](https://packagist.org/). Любой пользователь может за пару минут опубликовать пакет в Packagist, а все остальные смогут его использовать. Сейчас в хранилище больше трехсот тысяч пакетов, и их количество растет. Обычно исходный код пакетов хранится на GitHub, но это не обязательно.\n\n## Глобальная установка пакетов\n\nМногие пакеты в PHP — это законченные программы. Их можно установить и запустить как обычную утилиту командной строки. Эти пакеты ставятся в системные директории и не связаны с конкретным проектом.\n\nПопробуем установить утилиту `phpcs`, которая анализирует код на соответствие стандартам. Инструкция по установке подобных пакетов обычно есть на странице [репозитория](https://github.com/PHPCSStandards/PHP_CodeSniffer/) на GitHub:\n\n```bash\n# Composer скачает исходный код этого пакета и положит его куда-то к себе\n# Конкретный путь зависит от настроек и операционной системы\ncomposer global require 'squizlabs/php_codesniffer=*'\n```\n\n[](https://asciinema.org/a/1qE5Er4aSJuAQbvj5U7UM4n8J)\n\n* Здесь _global_ означает, что установка глобальная, то есть пакет ставится в операционную систему как обычная программа\n* Чтобы командный интерпретатор увидел программу, установленную глобально, нужно правильно настроить переменную окружения `$PATH`, добавив в нее путь к исполняемым файлам Composer. Его можно узнать, выполнив в терминале команду `composer global config bin-dir`\n\nУстановка занимает некоторое время, в течение которого видно, как скачивается сам пакет и его зависимости. Дальше ничего делать не нужно — `phpcs` создан утилитой командной строки, он сразу готов к использованию:\n\n```bash\n# Как аргумент эта утилита принимает путь до файла или директории с исходным кодом\n# Здесь в качестве опции мы указываем также и стандарт PSR12\nphpcs --standard=PSR12 path/to/file\n\nFILE: /home/hexlet/projects/test/test.php\n-------------------------------------------------------------------------------\nFOUND 1 ERROR AFFECTING 1 LINE\n-------------------------------------------------------------------------------\n 12 | ERROR | [x] Each imported trait must have its own \"use\" import statement\n-------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n-------------------------------------------------------------------------------\n\nTime: 21ms; Memory: 6MB\n```\n\nЕсли что-то пошло не так, убедитесь, что вы все правильно настроили:\n\n* Изучите вывод `echo $PATH` и поищите, есть ли там путь до исполняемых файлов Composer:\n\n ```bash\n echo $PATH\n\n /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/hex/.composer/vendor/bin\n ```\n\n* С помощью команды `which phpcs` проверьте, все ли установилось:\n\n ```bash\n which phpcs\n\n /home/hex/.composer/vendor/bin/phpcs\n ```\n\n## Ошибки\n\nВо время установки пакетов Composer может ругаться на различные ошибки. Например, так:\n\n```bash\n- Installation request for phar-io/manifest 1.0.x-dev -> satisfiable by phar-io/manifest[1.0.x-dev].\n- phar-io/manifest 1.0.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.\nProblem 2\n- Installation request for phar-io/manifest dev-master -> satisfiable by phar-io/manifest[dev-master].\n- phar-io/manifest dev-master requires ext-dom * -> the requested PHP extension dom is missing from your system.\nProblem 3\n- Installation request for phpunit/php-code-coverage 7.0.x-dev -> satisfiable by phpunit/php-code-coverage[7.0.x-dev].\n- phpunit/php-code-coverage 7.0.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.\n Problem 4\n```\n\nЭти ошибки говорят нам, что устанавливаемые библиотеки хотят использовать PHP-расширение, которое не установлено в систему. Это прямо написано в выводе:\n\n> _requires ext-dom * -> the requested PHP extension dom is missing from your system_\n\nКогда вы встречаете такую ошибку, то первым делом нужно посмотреть на название расширения. Здесь это _dom_. Затем нужно поискать инструкцию, которая объяснит, как установить это расширение в вашу операционную систему. Проще всего это сделать таким запросом: _php <название операционной системы> <название расширения> install extension_.\n\n## Проект\n\nComposer – это универсальный способ описывать любой код на PHP, который подходит для работы и с библиотекой, и с полноценным сайтом. В любом случае внутри будет Composer. Фактически любой новый проект начинается не с написания кода, а с инициализации Composer. Для этого нужно запустить команду `init`. Она задаст несколько вопросов и на основе ваших ответов сформирует файл _composer.json_.\n\nЕсли вы не понимаете значение некоторых вопросов, смело жмите Enter — потом все можно будет поправить:\n\n```bash\ncomposer init\n\nWelcome to the Composer config generator\n\nThis command will guide you through creating your composer.json config.\nPackage name (<vendor>/<name>) [hex/hex]: hex/example\nDescription []: example package\nAuthor [, n to skip]: hex <hex@hexlet.io>\nMinimum Stability []:\nPackage Type (e.g. library, project, metapackage, composer-plugin) []:\nLicense []:\n\nDefine your dependencies.\n\nWould you like to define your dependencies (require) interactively [yes]? n\nWould you like to define your dev dependencies (require-dev) interactively [yes]? n\n\n{\n \"name\": \"hex/example\",\n \"description\": \"example package\",\n \"authors\": [\n {\n \"name\": \"hex\",\n \"email\": \"hex@hexlet.io\"\n }\n ],\n \"require\": {}\n}\nDo you confirm generation [yes]?\n```\n\nКогда вопросы закончатся, Composer покажет конечный результат в виде [JSON](https://ru.wikipedia.org/wiki/JSON) — это текстовый формат для представления структурированных данных. Если вы не знакомы с ним, это не критично. Достаточно выучить несколько правил формирования данных в виде JSON, чтобы чувствовать себя комфортно:\n\n```json\n{\n \"name\": \"hex/example\",\n \"description\": \"example package\",\n \"authors\": [\n {\n \"name\": \"hex\",\n \"email\": \"hex@hexlet.io\"\n }\n ],\n \"require\": {}\n}\n```\n\nЕсли вас все устраивает, то Composer создаст файл _composer.json_. Именно этот файл является ключевым. В нем описывается абсолютно все, что касается зависимостей. С этого момента все команды _composer_, непосредственно связанные с проектом, выполняются именно в той директории, в которой находится файл _composer.json_.\n\nИмя пакета в _composer.json_, состоит из двух частей:\n\n* _vendor name_ — имя, под которым вы зарегистрированы в Packagist\n* _project name_\n\nПричем _vendor name_ уникален глобально, то есть все пользователи имеют свое собственное неповторимое имя, а вот _project name_ должен быть уникален только в пределах _vendor name_.\n\nComposer рекомендует именовать пакет словами в нижнем регистре и в качестве разделителя использовать дефис: например, _dependency-injection_.\n\n## Проблемы\n\nИногда в файле _composer.json_ содержатся синтаксические ошибки — нарушения правила форматирования JSON. В таком случае при попытке сделать что-то с проектом будут появляться подобные ошибки:\n\n```bash\n[Seld\\JsonLint\\ParsingException]\n\"./composer.json\" does not contain valid JSON\nParse error on line 2:\n\"name\": \"mokevnin/myproject\",\n---------^\n```\n\nОбычно любые сообщения с неожиданными символами или строками говорят о синтаксической ошибке.\n\nВоспользуйтесь валидаторами JSON для проверки корректности своего файла. Например, для этого подходит [jsonlint.com](https://jsonlint.com/) и другие подобные инструменты, которые можно найти по запросу _json validator_.\n\n[](https://asciinema.org/a/fmo2z9OYBDY7P3XJ7lF6hSa7q)\n"},"lessonMember":null,"courseMember":null,"course":{"start_lesson":{"exercise":null,"units":[{"id":2134,"name":"theory","url":"/courses/php-setup-environment/lessons/intro/theory_unit"}],"links":[],"ordered_units":[{"id":2134,"name":"theory","url":"/courses/php-setup-environment/lessons/intro/theory_unit"}],"id":1030,"slug":"intro","state":"approved","name":"Введение","course_order":100,"goal":"Знакомимся с темой, целями и задачами курса","self_study":"1. Создайте репозиторий на GitHub [по этой инструкции](https://www.youtube.com/watch?v=ku3Mg_XCsAo) с именем _hexlet-php_ и файлом _README_\n1. Склонируйте его в домашнюю директорию на своем компьютере\n1. Добавьте в _README.md_ текст «Мой первый проект на Хекслете»\n1. Добавьте все изменения на GitHub\n","theory_video_provider":null,"theory_video_uid":null,"theory":"Хекслет построен так, что все задания выполняются прямо в браузере. Единственное исключение — это проекты, в которых вы отрабатываете навыки работы в настоящем окружении. Такой подход позволяет сосредоточиться на самой задаче, но рождает ложное ощущение понимания происходящего. Изучение программирования во многом связано с настройкой среды, причем для многих людей установка и конфигурирование сложнее, чем написание кода. Чем быстрее вы начнете возиться с кодом у себя на компьютере, тем быстрее пойдет прогресс — вы сможете писать реальные приложения и решать тестовые задания.\n\nКстати, о заданиях. Хекслет поддерживает [список тестовых заданий](https://github.com/Hexlet/ru-test-assignments) от разных компаний. Рекомендуем пользоваться им как ориентиром. Идеально, если еще во время обучения вы реализуете хотя бы одно или два задания у себя на GitHub. Во-первых, вы обретете уверенность и увидите, что уже кое-что можете. Во-вторых, работодатели смогут оценить ваш GitHub-аккаунт и посмотреть на код.\n\nВ этом курсе мы установим и настроим PHP. Кроме того, вы познакомитесь с пакетным менеджером Composer, научитесь подключать сторонние библиотеки и выкладывать свой код в публичный доступ.\n\nПеред началом курса проверьте свою операционную систему:\n\n* Используйте Ubuntu или macOS — они удобнее для разработки\n* Если вы используете Windows, настройте ее по [этой инструкции](https://docs.microsoft.com/ru-ru/windows/wsl/install-win10)\n\n## Окружение\n\nРабота с командной строкой, настройка окружения, установка языка и библиотек, взаимодействие с операционной системой – это значительная часть работы любого программиста на любом языке. От этого зависит эффективность отладки, способность самостоятельно справляться с проблемами и даже качество кода.\n\nКогда программист только приходит на первую работу, поначалу он пытается запустить проект локально у себя на компьютере. Чем больше и сложнее проект, тем больше разных знаний для этого понадобится: начиная от сетей, портов, IP-адресов и виртуализации с помощью Docker и заканчивая сборщиками (webpack). В некоторых компаниях подобная настройка может занимать дни, а в особо запущенных случаях — всю неделю. И это при условии достаточной квалификации программиста.\n\nИзучение экосистемы своего языка — это непрерывный и очень непредсказуемый процесс. Постоянно возникающие непонятные ошибки — это норма. Постоянное часовое гугление — это тоже норма. Через это проходили все, это необходимое зло. Почему такое происходит? В языках программирования все подчиняется определенным правилам. В отличие от них, экосистема — это зоопарк из огромного количества программ, операционных систем и особенностей железа, которые хитро переплетаются друг с другом. Все настолько индивидуально, что практически у каждого программиста своя уникальная ситуация.\n\nИменно поэтому существуют тысячи статей по установке PHP, и постоянно появляются новые. По комментариям к этим статьям можно заметить, что далеко не всем они помогают, пользователи сталкиваются с ошибками на каждом шагу.\n\nСо временем вы во всем разберетесь, и настройка окружения не будет казаться такой страшной. Единственное важное условие – не пытайтесь решать проблемы методом тыка, старайтесь разобраться в их причинах. Только так вы вырастете как разработчик.\n"},"id":157,"slug":"php-setup-environment","challenges_count":0,"name":"PHP: Настройка окружения","allow_indexing":true,"state":"approved","course_state":"finished","pricing_type":"paid","description":"На этом курсе вы изучите процесс настройки окружения для PHP. Вы узнаете о зависимостях и утилите Composer. В итоге научитесь создавать собственный пакет, который можно будет использовать как программу. Знания из этого курса помогут грамотно организовать локальное окружение и использовать хорошие практики по управлению кодом.","kind":"additional","updated_at":"2026-01-20T11:53:40.293Z","language":"php","duration_cache":9780,"skills":["Настраивать локальное окружение для запуска PHP-кода","Устанавливать библиотеки и подключать их в коде","Использовать программы, улучшающие качество кода"],"keywords":["зависимости","composer","автозагрузка"],"lessons_count":9,"cover":"https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6OTAwNSwicHVyIjoiYmxvYl9pZCJ9fQ==--c6a06a94f55a365f3d2c7a093a9f42c76a3ea6d7/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJwbmciLCJyZXNpemVfdG9fZmlsbCI6WzYwMCw0MDBdfSwicHVyIjoidmFyaWF0aW9uIn19--6067466c2912ca31a17eddee04b8cf2a38c6ad17/image.png"},"recommendedLandings":[{"stack":{"id":2,"slug":"php","title":"PHP-разработчик","audience":"for_beginners","start_type":"weekly","pricing_model":"purchase","priority":"high","kind":"profession","state":"published","stack_state":"finished","order":60,"duration_in_months":10},"id":1,"slug":"php","title":"РНР-разработчик","subtitle":"Изучите PHP и Laravel для разработки и проектирования REST API","subtitle_for_lists":"Изучите PHP и Laravel для разработки и проектирования REST API","locale":"ru","current":true,"duration_in_months_text":"10 месяцев","stack_slug":"php","price_text":"от 5 650 ₽","duration_text":"10 месяцев","cover_list_variant":"https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6Mzk5MiwicHVyIjoiYmxvYl9pZCJ9fQ==--e9d0f30948ea766a7e6bc3e3d56c192344d45fb8/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Programming-cuate%20(1).png"}],"lessonMemberUnit":null,"accessToLearnUnitExists":false,"accessToCourseExists":false},"url":"/courses/php-setup-environment/lessons/composer/theory_unit","version":"8f286f6358a90a7bef2263b3a6edf5a90a94fa42","encryptHistory":false,"clearHistory":false}"><style data-mantine-styles="true">:root, :host{--mantine-font-family: Arial, sans-serif;--mantine-font-family-headings: Arial, sans-serif;--mantine-heading-font-weight: normal;--mantine-radius-default: 0rem;--mantine-primary-color-filled: var(--mantine-color-indigo-filled);--mantine-primary-color-filled-hover: var(--mantine-color-indigo-filled-hover);--mantine-primary-color-light: var(--mantine-color-indigo-light);--mantine-primary-color-light-hover: var(--mantine-color-indigo-light-hover);--mantine-primary-color-light-color: var(--mantine-color-indigo-light-color);--mantine-spacing-xxl: calc(4rem * var(--mantine-scale));--mantine-font-size-xs: 12px;--mantine-font-size-sm: 14px;--mantine-font-size-md: 16px;--mantine-font-size-lg: clamp(16.0000px, calc(15.2727px + 0.2273vw), 18.0000px);--mantine-font-size-xl: clamp(16.0000px, calc(14.5455px + 0.4545vw), 20.0000px);--mantine-font-size-display-3: clamp(32.0000px, calc(26.1818px + 1.8182vw), 48.0000px);--mantine-font-size-display-2: clamp(36.0000px, calc(25.8182px + 3.1818vw), 64.0000px);--mantine-font-size-display-1: clamp(40.0000px, calc(25.4545px + 4.5455vw), 80.0000px);--mantine-font-size-h1: clamp(28.0000px, calc(23.6364px + 1.3636vw), 40.0000px);--mantine-font-size-h2: clamp(24.0000px, calc(21.0909px + 0.9091vw), 32.0000px);--mantine-font-size-h3: clamp(20.0000px, calc(17.0909px + 0.9091vw), 28.0000px);--mantine-font-size-h4: clamp(16.0000px, calc(13.0909px + 0.9091vw), 24.0000px);--mantine-font-size-h5: clamp(16.0000px, calc(14.5455px + 0.4545vw), 20.0000px);--mantine-font-size-h6: 1rem;--mantine-primary-color-0: var(--mantine-color-indigo-0);--mantine-primary-color-1: var(--mantine-color-indigo-1);--mantine-primary-color-2: var(--mantine-color-indigo-2);--mantine-primary-color-3: var(--mantine-color-indigo-3);--mantine-primary-color-4: var(--mantine-color-indigo-4);--mantine-primary-color-5: var(--mantine-color-indigo-5);--mantine-primary-color-6: var(--mantine-color-indigo-6);--mantine-primary-color-7: var(--mantine-color-indigo-7);--mantine-primary-color-8: var(--mantine-color-indigo-8);--mantine-primary-color-9: var(--mantine-color-indigo-9);--mantine-color-red-0: #ffeaea;--mantine-color-red-1: #fed4d4;--mantine-color-red-2: #f4a7a8;--mantine-color-red-3: #ec7878;--mantine-color-red-4: #e55050;--mantine-color-red-5: #e03131;--mantine-color-red-6: #e02829;--mantine-color-red-7: #c71a1c;--mantine-color-red-8: #b21218;--mantine-color-red-9: #9c0411;--mantine-color-violet-0: #fce9ff;--mantine-color-violet-1: #f1cfff;--mantine-color-violet-2: #e09bff;--mantine-color-violet-3: #d16fff;--mantine-color-violet-4: #be37fe;--mantine-color-violet-5: #b51afe;--mantine-color-violet-6: #b009ff;--mantine-color-violet-7: #9b00e4;--mantine-color-violet-8: #8a00cc;--mantine-color-violet-9: #7800b3;--mantine-color-indigo-0: #edecff;--mantine-color-indigo-1: #d6d5fe;--mantine-color-indigo-2: #aaa9f4;--mantine-color-indigo-3: #7b79eb;--mantine-color-indigo-4: #5451e4;--mantine-color-indigo-5: #3b37e0;--mantine-color-indigo-6: #2d2adf;--mantine-color-indigo-7: #1f1ec7;--mantine-color-indigo-8: #1819b2;--mantine-color-indigo-9: #0c149e;--mantine-color-cyan-0: #dffdff;--mantine-color-cyan-1: #caf5ff;--mantine-color-cyan-2: #99e8ff;--mantine-color-cyan-3: #64daff;--mantine-color-cyan-4: #3ccffe;--mantine-color-cyan-5: #24c8fe;--mantine-color-cyan-6: #00c2ff;--mantine-color-cyan-7: #00ade4;--mantine-color-cyan-8: #009acd;--mantine-color-cyan-9: #0085b5;--mantine-color-green-0: #e9fdec;--mantine-color-green-1: #d7f6dc;--mantine-color-green-2: #b0eab9;--mantine-color-green-3: #86df94;--mantine-color-green-4: #62d574;--mantine-color-green-5: #4ccf5f;--mantine-color-green-6: #3fcc54;--mantine-color-green-7: #2fb344;--mantine-color-green-8: #25a03b;--mantine-color-green-9: #138a2e;--mantine-color-yellow-0: #fff7e2;--mantine-color-yellow-1: #ffeecd;--mantine-color-yellow-2: #ffdc9c;--mantine-color-yellow-3: #ffc966;--mantine-color-yellow-4: #feb93a;--mantine-color-yellow-5: #feae1e;--mantine-color-yellow-6: #ffa90f;--mantine-color-yellow-8: #ca8200;--mantine-color-yellow-9: #af7000;--mantine-h1-font-size: clamp(28.0000px, calc(23.6364px + 1.3636vw), 40.0000px);--mantine-h1-font-weight: normal;--mantine-h2-font-size: clamp(24.0000px, calc(21.0909px + 0.9091vw), 32.0000px);--mantine-h2-font-weight: normal;--mantine-h3-font-size: clamp(20.0000px, calc(17.0909px + 0.9091vw), 28.0000px);--mantine-h3-font-weight: normal;--mantine-h4-font-size: clamp(16.0000px, calc(13.0909px + 0.9091vw), 24.0000px);--mantine-h4-font-weight: normal;--mantine-h5-font-size: clamp(16.0000px, calc(14.5455px + 0.4545vw), 20.0000px);--mantine-h5-font-weight: normal;--mantine-h6-font-size: 1rem;--mantine-h6-font-weight: normal;}
:root[data-mantine-color-scheme="dark"], :host([data-mantine-color-scheme="dark"]){--mantine-color-anchor: var(--mantine-color-text);--mantine-color-dimmed: #495057;--mantine-color-dark-filled: var(--mantine-color-dark-5);--mantine-color-dark-filled-hover: var(--mantine-color-dark-6);--mantine-color-dark-light: rgba(105, 105, 105, 0.15);--mantine-color-dark-light-hover: rgba(105, 105, 105, 0.2);--mantine-color-dark-light-color: var(--mantine-color-dark-0);--mantine-color-dark-outline: var(--mantine-color-dark-1);--mantine-color-dark-outline-hover: rgba(184, 184, 184, 0.05);--mantine-color-gray-filled: var(--mantine-color-gray-5);--mantine-color-gray-filled-hover: var(--mantine-color-gray-6);--mantine-color-gray-light: rgba(222, 226, 230, 0.15);--mantine-color-gray-light-hover: rgba(222, 226, 230, 0.2);--mantine-color-gray-light-color: var(--mantine-color-gray-0);--mantine-color-gray-outline: var(--mantine-color-gray-1);--mantine-color-gray-outline-hover: rgba(241, 243, 245, 0.05);--mantine-color-red-filled: var(--mantine-color-red-5);--mantine-color-red-filled-hover: var(--mantine-color-red-6);--mantine-color-red-light: rgba(236, 120, 120, 0.15);--mantine-color-red-light-hover: rgba(236, 120, 120, 0.2);--mantine-color-red-light-color: var(--mantine-color-red-0);--mantine-color-red-outline: var(--mantine-color-red-1);--mantine-color-red-outline-hover: rgba(254, 212, 212, 0.05);--mantine-color-pink-filled: var(--mantine-color-pink-5);--mantine-color-pink-filled-hover: var(--mantine-color-pink-6);--mantine-color-pink-light: rgba(250, 162, 193, 0.15);--mantine-color-pink-light-hover: rgba(250, 162, 193, 0.2);--mantine-color-pink-light-color: var(--mantine-color-pink-0);--mantine-color-pink-outline: var(--mantine-color-pink-1);--mantine-color-pink-outline-hover: rgba(255, 222, 235, 0.05);--mantine-color-grape-filled: var(--mantine-color-grape-5);--mantine-color-grape-filled-hover: var(--mantine-color-grape-6);--mantine-color-grape-light: rgba(229, 153, 247, 0.15);--mantine-color-grape-light-hover: rgba(229, 153, 247, 0.2);--mantine-color-grape-light-color: var(--mantine-color-grape-0);--mantine-color-grape-outline: var(--mantine-color-grape-1);--mantine-color-grape-outline-hover: rgba(243, 217, 250, 0.05);--mantine-color-violet-filled: var(--mantine-color-violet-5);--mantine-color-violet-filled-hover: var(--mantine-color-violet-6);--mantine-color-violet-light: rgba(209, 111, 255, 0.15);--mantine-color-violet-light-hover: rgba(209, 111, 255, 0.2);--mantine-color-violet-light-color: var(--mantine-color-violet-0);--mantine-color-violet-outline: var(--mantine-color-violet-1);--mantine-color-violet-outline-hover: rgba(241, 207, 255, 0.05);--mantine-color-indigo-filled: var(--mantine-color-indigo-5);--mantine-color-indigo-filled-hover: var(--mantine-color-indigo-6);--mantine-color-indigo-light: rgba(123, 121, 235, 0.15);--mantine-color-indigo-light-hover: rgba(123, 121, 235, 0.2);--mantine-color-indigo-light-color: var(--mantine-color-indigo-0);--mantine-color-indigo-outline: var(--mantine-color-indigo-1);--mantine-color-indigo-outline-hover: rgba(214, 213, 254, 0.05);--mantine-color-blue-filled: var(--mantine-color-blue-5);--mantine-color-blue-filled-hover: var(--mantine-color-blue-6);--mantine-color-blue-light: rgba(116, 192, 252, 0.15);--mantine-color-blue-light-hover: rgba(116, 192, 252, 0.2);--mantine-color-blue-light-color: var(--mantine-color-blue-0);--mantine-color-blue-outline: var(--mantine-color-blue-1);--mantine-color-blue-outline-hover: rgba(208, 235, 255, 0.05);--mantine-color-cyan-filled: var(--mantine-color-cyan-5);--mantine-color-cyan-filled-hover: var(--mantine-color-cyan-6);--mantine-color-cyan-light: rgba(100, 218, 255, 0.15);--mantine-color-cyan-light-hover: rgba(100, 218, 255, 0.2);--mantine-color-cyan-light-color: var(--mantine-color-cyan-0);--mantine-color-cyan-outline: var(--mantine-color-cyan-1);--mantine-color-cyan-outline-hover: rgba(202, 245, 255, 0.05);--mantine-color-teal-filled: var(--mantine-color-teal-5);--mantine-color-teal-filled-hover: var(--mantine-color-teal-6);--mantine-color-teal-light: rgba(99, 230, 190, 0.15);--mantine-color-teal-light-hover: rgba(99, 230, 190, 0.2);--mantine-color-teal-light-color: var(--mantine-color-teal-0);--mantine-color-teal-outline: var(--mantine-color-teal-1);--mantine-color-teal-outline-hover: rgba(195, 250, 232, 0.05);--mantine-color-green-filled: var(--mantine-color-green-5);--mantine-color-green-filled-hover: var(--mantine-color-green-6);--mantine-color-green-light: rgba(134, 223, 148, 0.15);--mantine-color-green-light-hover: rgba(134, 223, 148, 0.2);--mantine-color-green-light-color: var(--mantine-color-green-0);--mantine-color-green-outline: var(--mantine-color-green-1);--mantine-color-green-outline-hover: rgba(215, 246, 220, 0.05);--mantine-color-lime-filled: var(--mantine-color-lime-5);--mantine-color-lime-filled-hover: var(--mantine-color-lime-6);--mantine-color-lime-light: rgba(192, 235, 117, 0.15);--mantine-color-lime-light-hover: rgba(192, 235, 117, 0.2);--mantine-color-lime-light-color: var(--mantine-color-lime-0);--mantine-color-lime-outline: var(--mantine-color-lime-1);--mantine-color-lime-outline-hover: rgba(233, 250, 200, 0.05);--mantine-color-yellow-filled: var(--mantine-color-yellow-5);--mantine-color-yellow-filled-hover: var(--mantine-color-yellow-6);--mantine-color-yellow-light: rgba(255, 201, 102, 0.15);--mantine-color-yellow-light-hover: rgba(255, 201, 102, 0.2);--mantine-color-yellow-light-color: var(--mantine-color-yellow-0);--mantine-color-yellow-outline: var(--mantine-color-yellow-1);--mantine-color-yellow-outline-hover: rgba(255, 238, 205, 0.05);--mantine-color-orange-filled: var(--mantine-color-orange-5);--mantine-color-orange-filled-hover: var(--mantine-color-orange-6);--mantine-color-orange-light: rgba(255, 192, 120, 0.15);--mantine-color-orange-light-hover: rgba(255, 192, 120, 0.2);--mantine-color-orange-light-color: var(--mantine-color-orange-0);--mantine-color-orange-outline: var(--mantine-color-orange-1);--mantine-color-orange-outline-hover: rgba(255, 232, 204, 0.05);--app-cta-gradient: linear-gradient(90deg, var(--mantine-color-blue-9) 0%, var(--mantine-color-cyan-7) 100%);--app-color-surface: #2e2e2e;}
:root[data-mantine-color-scheme="light"], :host([data-mantine-color-scheme="light"]){--mantine-color-anchor: var(--mantine-color-text);--mantine-color-dimmed: #495057;--mantine-color-red-light: rgba(224, 40, 41, 0.1);--mantine-color-red-light-hover: rgba(224, 40, 41, 0.12);--mantine-color-red-outline-hover: rgba(224, 40, 41, 0.05);--mantine-color-violet-light: rgba(176, 9, 255, 0.1);--mantine-color-violet-light-hover: rgba(176, 9, 255, 0.12);--mantine-color-violet-outline-hover: rgba(176, 9, 255, 0.05);--mantine-color-indigo-light: rgba(45, 42, 223, 0.1);--mantine-color-indigo-light-hover: rgba(45, 42, 223, 0.12);--mantine-color-indigo-outline-hover: rgba(45, 42, 223, 0.05);--mantine-color-cyan-light: rgba(0, 194, 255, 0.1);--mantine-color-cyan-light-hover: rgba(0, 194, 255, 0.12);--mantine-color-cyan-outline-hover: rgba(0, 194, 255, 0.05);--mantine-color-green-light: rgba(63, 204, 84, 0.1);--mantine-color-green-light-hover: rgba(63, 204, 84, 0.12);--mantine-color-green-outline-hover: rgba(63, 204, 84, 0.05);--mantine-color-yellow-light: rgba(255, 169, 15, 0.1);--mantine-color-yellow-light-hover: rgba(255, 169, 15, 0.12);--mantine-color-yellow-outline-hover: rgba(255, 169, 15, 0.05);--app-color-surface: #f1f3f5;--app-cta-gradient: linear-gradient(90deg, var(--mantine-color-blue-filled) 0%, var(--mantine-color-cyan-5) 100%);}</style><style data-mantine-styles="classes">@media (max-width: 35.99375em) {.mantine-visible-from-xs {display: none !important;}}@media (min-width: 36em) {.mantine-hidden-from-xs {display: none !important;}}@media (max-width: 47.99375em) {.mantine-visible-from-sm {display: none !important;}}@media (min-width: 48em) {.mantine-hidden-from-sm {display: none !important;}}@media (max-width: 61.99375em) {.mantine-visible-from-md {display: none !important;}}@media (min-width: 62em) {.mantine-hidden-from-md {display: none !important;}}@media (max-width: 74.99375em) {.mantine-visible-from-lg {display: none !important;}}@media (min-width: 75em) {.mantine-hidden-from-lg {display: none !important;}}@media (max-width: 87.99375em) {.mantine-visible-from-xl {display: none !important;}}@media (min-width: 88em) {.mantine-hidden-from-xl {display: none !important;}}</style><div style="position:absolute;top:0rem" class=""></div><div style="max-width:var(--container-size-xl);height:100%;min-height:0rem" class=""><style data-mantine-styles="inline">.__m__-_R_5ub_{--grid-gutter:0rem;}</style><div style="height:100%;min-height:0rem" class="m_410352e9 mantine-Grid-root __m__-_R_5ub_"><div class="m_dee7bd2f mantine-Grid-inner" style="height:100%"><style data-mantine-styles="inline">.__m__-_R_rdub_{--col-flex-grow:auto;--col-flex-basis:91.66666666666667%;--col-max-width:91.66666666666667%;}@media(min-width: 48em){.__m__-_R_rdub_{--col-flex-grow:auto;--col-flex-basis:83.33333333333334%;--col-max-width:83.33333333333334%;}}</style><div style="min-width:0rem;height:100%;min-height:0rem;display:flex" class="m_96bdd299 mantine-Grid-col __m__-_R_rdub_"><style data-mantine-styles="inline">.__m__-_R_6qrdub_{margin-top:0rem;padding-inline:var(--mantine-spacing-xs);width:100%;}@media(min-width: 48em){.__m__-_R_6qrdub_{margin-top:var(--mantine-spacing-xl);width:80%;}}@media(min-width: 62em){.__m__-_R_6qrdub_{padding-inline:var(--mantine-spacing-xl);}}</style><div style="margin-inline:auto;max-width:var(--mantine-breakpoint-xl)" class="__m__-_R_6qrdub_"><div style="color:var(--mantine-color-dimmed)" class="m_4451eb3a mantine-Center-root" data-inline="true"><div style="--ti-size:var(--ti-size-xs);--ti-bg:transparent;--ti-color:var(--mantine-color-indigo-light-color);--ti-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;margin-inline-end:calc(0.125rem * var(--mantine-scale));color:inherit" class="m_7341320d mantine-ThemeIcon-root" data-variant="transparent" data-size="xs"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-lock "><path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6"></path><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8 11v-4a4 4 0 1 1 8 0v4"></path></svg></div><p style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">PHP: Настройка окружения</p></div><h1 style="--title-fw:var(--mantine-h1-font-weight);--title-lh:var(--mantine-h1-line-height);--title-fz:var(--mantine-h1-font-size);margin-bottom:var(--mantine-spacing-xl)" class="m_8a5d1357 mantine-Title-root" data-order="1">Теория: Composer</h1><script type="application/ld+json">{"@context":"https://schema.org","@type":"LearningResource","name":"Composer","inLanguage":"ru","isPartOf":{"@type":"LearningResource","name":"PHP: Настройка окружения"},"isAccessibleForFree":"False","hasPart":{"@type":"WebPageElement","isAccessibleForFree":"False","cssSelector":".paywalled"}}</script><div class=""><div style="--alert-color:var(--mantine-color-indigo-light-color);margin-bottom:var(--mantine-spacing-lg);font-size:var(--mantine-font-size-lg)" class="m_66836ed3 mantine-Alert-root" id="mantine-_R_remqrdub_" role="alert" aria-describedby="mantine-_R_remqrdub_-body" aria-labelledby="mantine-_R_remqrdub_-title"><div class="m_a5d60502 mantine-Alert-wrapper"><div class="m_667f2a6a mantine-Alert-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-rocket "><path d="M4 13a8 8 0 0 1 7 7a6 6 0 0 0 3 -5a9 9 0 0 0 6 -8a3 3 0 0 0 -3 -3a9 9 0 0 0 -8 6a6 6 0 0 0 -5 3"></path><path d="M7 14a6 6 0 0 0 -3 6a6 6 0 0 0 6 -3"></path><path d="M14 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"></path></svg></div><div class="m_667c2793 mantine-Alert-body"><div class="m_6a03f287 mantine-Alert-title"><span id="mantine-_R_remqrdub_-title" class="m_698f4f23 mantine-Alert-label">Полный доступ к материалам</span></div><div id="mantine-_R_remqrdub_-body" class="m_7fa78076 mantine-Alert-message"><div style="--group-gap:var(--mantine-spacing-md);--group-align:center;--group-justify:space-between;--group-wrap:wrap" class="m_4081bf90 mantine-Group-root"><p class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Зарегистрируйтесь и получите доступ к этому и десяткам других курсов</p><a style="--button-height:var(--button-height-xs);--button-padding-x:var(--button-padding-x-xs);--button-fz:var(--mantine-font-size-xs);--button-bg:linear-gradient(45deg, var(--mantine-color-blue-filled) 0%, var(--mantine-color-cyan-filled) 100%);--button-hover:linear-gradient(45deg, var(--mantine-color-blue-filled) 0%, var(--mantine-color-cyan-filled) 100%);--button-color:var(--mantine-color-white);--button-bd:none" class="mantine-focus-auto mantine-active m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root" data-variant="gradient" data-size="xs" href="/u/new"><span class="m_80f1301b mantine-Button-inner"><span class="m_811560b9 mantine-Button-label">Зарегистрироваться</span></span></a></div></div></div></div></div><div class="paywalled m_d08caa0 mantine-Typography-root"><p>Ключевая программа в экосистеме PHP — это Composer. Она выполняет так много функций, что мы не сможем рассмотреть всё в рамках этого курса. Мы советуем периодически просматривать ее команды и изучать информацию по ним. Основная задача, которую решает Composer — <strong>управление зависимостями</strong>. Именно о нем мы поговорим в этом уроке.</p>
<p>Чтобы установить Composer, изучите официальное руководство для <a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://getcomposer.org/download/" rel="noopener noreferrer" target="_blank">Windows</a> и <a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos" rel="noopener noreferrer" target="_blank">Linux</a>. На MacOS все немного проще — Composer устанавливается через Homebrew командой <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">brew install composer</code>.</p>
<p>Для успешной установки и настройки Composer нужно немного разбираться в работе с командными интерпретаторами. Рекомендуем пройти <a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://ru.hexlet.io/courses/cli-basics" rel="noopener noreferrer" target="_blank">соответствующий курс на Хекслете</a>, если вы этого еще не сделали.</p>
<p>Кроме самого Composer, установите следующие программы, используя пакетный менеджер вашей операционной системы:</p>
<ul>
<li><a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://ru.wikipedia.org/wiki/Git" rel="noopener noreferrer" target="_blank">git</a></li>
<li><a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://ru.wikipedia.org/wiki/CURL" rel="noopener noreferrer" target="_blank">curl</a></li>
</ul>
<p><img style="--image-object-fit:contain;width:auto" class="m_9e117634 mantine-Image-root" src="/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6OTAwOCwicHVyIjoiYmxvYl9pZCJ9fQ==--19120be13c19e56c7a6ebefa2764880165c4144b/composer.png" alt="Composer" loading="lazy"/></p>
<p>Убедитесь, что Composer работает:</p>
<div style="margin-bottom:var(--mantine-spacing-lg)" class="m_e597c321 mantine-CodeHighlight-codeHighlight" dir="ltr"><div class="m_be7e9c9c mantine-CodeHighlight-controls"><button style="--ai-bg:transparent;--ai-hover:transparent;--ai-color:inherit;--ai-bd:none" class="mantine-focus-auto mantine-active m_d498bab7 mantine-CodeHighlight-control m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="none" type="button" aria-label="Copy code"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"></path><path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path></svg></span></button></div><div style="--scrollarea-scrollbar-size:calc(0.25rem * var(--mantine-scale));--sa-corner-width:0px;--sa-corner-height:0px" class="m_f744fd40 mantine-CodeHighlight-scrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden;overscroll-behavior-inline:none" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><pre class="m_2c47c4fd mantine-CodeHighlight-pre" style="padding:0"><code class="m_5caae6d3 mantine-CodeHighlight-code">composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.8.0 2018-12-03 10:31:16
# Здесь много вывода</code></pre></div></div></div><button class="mantine-focus-auto m_c9378bc2 mantine-CodeHighlight-showCodeButton m_87cf2631 mantine-UnstyledButton-root" data-hidden="true" type="button">Expand code</button></div>
<p>Запуск Composer без аргументов выведет весь список доступных команд с их описанием. Пробегитесь по ним, чтобы сформировать первое впечатление.</p>
<p>Почти с зарождения программирования появилась идея повторно использовать код не только в рамках одного проекта, но и в других проектах. Например, во всех проектах используются одни и те же функции для работы с датами, математическими формулами и расчетами. Такое переиспользование привело к росту производительности — современные программисты могут сосредоточиться на решении уникальных задач бизнеса, не тратя время на изобретение велосипеда под инфраструктурные задачи. Работать стало еще проще, когда появились Git и GitHub.</p>
<p>Первоначально общий код выносился в файлы, которые программисты держали на своих компьютерах и копировали из проекта в проект. У такого способа есть ряд существенных недостатков:</p>
<ol>
<li>Код сложно передать другим</li>
<li>У разных программистов хранятся разные копии одних и тех же решений</li>
<li>Доработкой кода занимается только его автор</li>
<li>В сумме много разных копий без возможности быстрого обновления</li>
<li>Код копируется прямо в другой проект, поэтому он модифицируется и становится специфичным</li>
</ol>
<p>Git автоматически решает часть этих проблем. С его помощью можно создавать наборы общих файлов — библиотеки. Потом в конечных проектах можно использовать такие библиотеки причем как написанные нами, так и сторонними разработчиками.</p>
<p>Но тут возникает новая сложность — когда библиотек становится много, у них появляется общий код более низкого уровня. Например, финансовые библиотеки могут использовать функции для преобразования валют. Чтобы подобный код не дублировался, хочется его вынести в общее место. Этот процесс может продолжаться бесконечно. Одни библиотеки зависят от других, которые зависят от третьих и так далее.</p>
<p>С точки зрения переиспользования кода все хорошо — большое число маленьких библиотек решают всевозможные задачи, что позволяет быстро двигаться вперед. Но с точки зрения управления, появляются проблемы:</p>
<ol>
<li>Нужно вводить понятие «версия», потому что библиотеки начинают зависеть не только друг от друга, но и от версий друг друга. Для примера представим, что в новой версии библиотеки ее автор изменил параметры функций — это ломает обратную совместимость. В такой ситуации можно обновить вторую библиотеку, но тогда первая перестанет работать. Она рассчитывала на одно поведение зависимой библиотеки, а получила — другое.</li>
<li>Нужно стандартизировать способ создания библиотек, чтобы автоматизировать их соединение. Типичный веб-проект может зависеть от сотни библиотек, которые в свою очередь зависят от других библиотек. Общее число зависимостей может легко перевалить за тысячу — вручную управлять таким зоопарком невозможно.</li>
<li>Из-за проблемы выше нужно автоматизированное средство управления зависимостями — для их обновления, установки и удаления.</li>
</ol>
<p>Всеми этими вопросами занимаются <strong>пакетные менеджеры</strong>. Обычно пакетный менеджер поставляется вместе с языком программирования, потому что сложно представить себе современный код без единой зависимости.</p>
<h2 id="heading-2-1">Терминология</h2>
<p>В PHP есть два важных понятия:</p>
<ul>
<li><strong>Пакет</strong> — это та самая библиотека, которую мы пишем или используем в проекте как зависимость</li>
<li><strong>Репозиторий</strong> — это хранилище пакетов PHP, которое называется <a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://packagist.org/" rel="noopener noreferrer" target="_blank">Packagist</a>. Любой пользователь может за пару минут опубликовать пакет в Packagist, а все остальные смогут его использовать. Сейчас в хранилище больше трехсот тысяч пакетов, и их количество растет. Обычно исходный код пакетов хранится на GitHub, но это не обязательно.</li>
</ul>
<h2 id="heading-2-2">Глобальная установка пакетов</h2>
<p>Многие пакеты в PHP — это законченные программы. Их можно установить и запустить как обычную утилиту командной строки. Эти пакеты ставятся в системные директории и не связаны с конкретным проектом.</p>
<p>Попробуем установить утилиту <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">phpcs</code>, которая анализирует код на соответствие стандартам. Инструкция по установке подобных пакетов обычно есть на странице <a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://github.com/PHPCSStandards/PHP_CodeSniffer/" rel="noopener noreferrer" target="_blank">репозитория</a> на GitHub:</p>
<div style="margin-bottom:var(--mantine-spacing-lg)" class="m_e597c321 mantine-CodeHighlight-codeHighlight" dir="ltr"><div class="m_be7e9c9c mantine-CodeHighlight-controls"><button style="--ai-bg:transparent;--ai-hover:transparent;--ai-color:inherit;--ai-bd:none" class="mantine-focus-auto mantine-active m_d498bab7 mantine-CodeHighlight-control m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="none" type="button" aria-label="Copy code"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"></path><path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path></svg></span></button></div><div style="--scrollarea-scrollbar-size:calc(0.25rem * var(--mantine-scale));--sa-corner-width:0px;--sa-corner-height:0px" class="m_f744fd40 mantine-CodeHighlight-scrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden;overscroll-behavior-inline:none" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><pre class="m_2c47c4fd mantine-CodeHighlight-pre" style="padding:0"><code class="m_5caae6d3 mantine-CodeHighlight-code"># Composer скачает исходный код этого пакета и положит его куда-то к себе
# Конкретный путь зависит от настроек и операционной системы
composer global require 'squizlabs/php_codesniffer=*'</code></pre></div></div></div><button class="mantine-focus-auto m_c9378bc2 mantine-CodeHighlight-showCodeButton m_87cf2631 mantine-UnstyledButton-root" data-hidden="true" type="button">Expand code</button></div>
<p><a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://asciinema.org/a/1qE5Er4aSJuAQbvj5U7UM4n8J" rel="noopener noreferrer" target="_blank"><img style="--image-object-fit:contain;width:auto" class="m_9e117634 mantine-Image-root" src="/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6OTAwOSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b7c4f863892944a1c5105907cd408c6948c4026/1qE5Er4aSJuAQbvj5U7UM4n8J.gif" alt="asciicast" loading="lazy"/></a></p>
<ul>
<li>Здесь <em>global</em> означает, что установка глобальная, то есть пакет ставится в операционную систему как обычная программа</li>
<li>Чтобы командный интерпретатор увидел программу, установленную глобально, нужно правильно настроить переменную окружения <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">$PATH</code>, добавив в нее путь к исполняемым файлам Composer. Его можно узнать, выполнив в терминале команду <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">composer global config bin-dir</code></li>
</ul>
<p>Установка занимает некоторое время, в течение которого видно, как скачивается сам пакет и его зависимости. Дальше ничего делать не нужно — <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">phpcs</code> создан утилитой командной строки, он сразу готов к использованию:</p>
<div style="margin-bottom:var(--mantine-spacing-lg)" class="m_e597c321 mantine-CodeHighlight-codeHighlight" dir="ltr"><div class="m_be7e9c9c mantine-CodeHighlight-controls"><button style="--ai-bg:transparent;--ai-hover:transparent;--ai-color:inherit;--ai-bd:none" class="mantine-focus-auto mantine-active m_d498bab7 mantine-CodeHighlight-control m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="none" type="button" aria-label="Copy code"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"></path><path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path></svg></span></button></div><div style="--scrollarea-scrollbar-size:calc(0.25rem * var(--mantine-scale));--sa-corner-width:0px;--sa-corner-height:0px" class="m_f744fd40 mantine-CodeHighlight-scrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden;overscroll-behavior-inline:none" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><pre class="m_2c47c4fd mantine-CodeHighlight-pre" style="padding:0"><code class="m_5caae6d3 mantine-CodeHighlight-code"># Как аргумент эта утилита принимает путь до файла или директории с исходным кодом
# Здесь в качестве опции мы указываем также и стандарт PSR12
phpcs --standard=PSR12 path/to/file
FILE: /home/hexlet/projects/test/test.php
-------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------
12 | ERROR | [x] Each imported trait must have its own "use" import statement
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------
Time: 21ms; Memory: 6MB</code></pre></div></div></div><button class="mantine-focus-auto m_c9378bc2 mantine-CodeHighlight-showCodeButton m_87cf2631 mantine-UnstyledButton-root" data-hidden="true" type="button">Expand code</button></div>
<p>Если что-то пошло не так, убедитесь, что вы все правильно настроили:</p>
<ul>
<li>
<p>Изучите вывод <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">echo $PATH</code> и поищите, есть ли там путь до исполняемых файлов Composer:</p>
<div style="margin-bottom:var(--mantine-spacing-lg)" class="m_e597c321 mantine-CodeHighlight-codeHighlight" dir="ltr"><div class="m_be7e9c9c mantine-CodeHighlight-controls"><button style="--ai-bg:transparent;--ai-hover:transparent;--ai-color:inherit;--ai-bd:none" class="mantine-focus-auto mantine-active m_d498bab7 mantine-CodeHighlight-control m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="none" type="button" aria-label="Copy code"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"></path><path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path></svg></span></button></div><div style="--scrollarea-scrollbar-size:calc(0.25rem * var(--mantine-scale));--sa-corner-width:0px;--sa-corner-height:0px" class="m_f744fd40 mantine-CodeHighlight-scrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden;overscroll-behavior-inline:none" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><pre class="m_2c47c4fd mantine-CodeHighlight-pre" style="padding:0"><code class="m_5caae6d3 mantine-CodeHighlight-code">echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/hex/.composer/vendor/bin</code></pre></div></div></div><button class="mantine-focus-auto m_c9378bc2 mantine-CodeHighlight-showCodeButton m_87cf2631 mantine-UnstyledButton-root" data-hidden="true" type="button">Expand code</button></div>
</li>
<li>
<p>С помощью команды <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">which phpcs</code> проверьте, все ли установилось:</p>
<div style="margin-bottom:var(--mantine-spacing-lg)" class="m_e597c321 mantine-CodeHighlight-codeHighlight" dir="ltr"><div class="m_be7e9c9c mantine-CodeHighlight-controls"><button style="--ai-bg:transparent;--ai-hover:transparent;--ai-color:inherit;--ai-bd:none" class="mantine-focus-auto mantine-active m_d498bab7 mantine-CodeHighlight-control m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="none" type="button" aria-label="Copy code"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"></path><path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path></svg></span></button></div><div style="--scrollarea-scrollbar-size:calc(0.25rem * var(--mantine-scale));--sa-corner-width:0px;--sa-corner-height:0px" class="m_f744fd40 mantine-CodeHighlight-scrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden;overscroll-behavior-inline:none" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><pre class="m_2c47c4fd mantine-CodeHighlight-pre" style="padding:0"><code class="m_5caae6d3 mantine-CodeHighlight-code">which phpcs
/home/hex/.composer/vendor/bin/phpcs</code></pre></div></div></div><button class="mantine-focus-auto m_c9378bc2 mantine-CodeHighlight-showCodeButton m_87cf2631 mantine-UnstyledButton-root" data-hidden="true" type="button">Expand code</button></div>
</li>
</ul>
<h2 id="heading-2-3">Ошибки</h2>
<p>Во время установки пакетов Composer может ругаться на различные ошибки. Например, так:</p>
<div style="margin-bottom:var(--mantine-spacing-lg)" class="m_e597c321 mantine-CodeHighlight-codeHighlight" dir="ltr"><div class="m_be7e9c9c mantine-CodeHighlight-controls"><button style="--ai-bg:transparent;--ai-hover:transparent;--ai-color:inherit;--ai-bd:none" class="mantine-focus-auto mantine-active m_d498bab7 mantine-CodeHighlight-control m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="none" type="button" aria-label="Copy code"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"></path><path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path></svg></span></button></div><div style="--scrollarea-scrollbar-size:calc(0.25rem * var(--mantine-scale));--sa-corner-width:0px;--sa-corner-height:0px" class="m_f744fd40 mantine-CodeHighlight-scrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden;overscroll-behavior-inline:none" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><pre class="m_2c47c4fd mantine-CodeHighlight-pre" style="padding:0"><code class="m_5caae6d3 mantine-CodeHighlight-code">- Installation request for phar-io/manifest 1.0.x-dev -> satisfiable by phar-io/manifest[1.0.x-dev].
- phar-io/manifest 1.0.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 2
- Installation request for phar-io/manifest dev-master -> satisfiable by phar-io/manifest[dev-master].
- phar-io/manifest dev-master requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 3
- Installation request for phpunit/php-code-coverage 7.0.x-dev -> satisfiable by phpunit/php-code-coverage[7.0.x-dev].
- phpunit/php-code-coverage 7.0.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 4</code></pre></div></div></div><button class="mantine-focus-auto m_c9378bc2 mantine-CodeHighlight-showCodeButton m_87cf2631 mantine-UnstyledButton-root" data-hidden="true" type="button">Expand code</button></div>
<p>Эти ошибки говорят нам, что устанавливаемые библиотеки хотят использовать PHP-расширение, которое не установлено в систему. Это прямо написано в выводе:</p>
<blockquote>
<p><em>requires ext-dom * -> the requested PHP extension dom is missing from your system</em></p>
</blockquote>
<p>Когда вы встречаете такую ошибку, то первым делом нужно посмотреть на название расширения. Здесь это <em>dom</em>. Затем нужно поискать инструкцию, которая объяснит, как установить это расширение в вашу операционную систему. Проще всего это сделать таким запросом: <em>php <название операционной системы> <название расширения> install extension</em>.</p>
<h2 id="heading-2-4">Проект</h2>
<p>Composer – это универсальный способ описывать любой код на PHP, который подходит для работы и с библиотекой, и с полноценным сайтом. В любом случае внутри будет Composer. Фактически любой новый проект начинается не с написания кода, а с инициализации Composer. Для этого нужно запустить команду <code style="margin-bottom:var(--mantine-spacing-lg)" class="m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight m_e597c321 mantine-CodeHighlight-codeHighlight m_dfe9c588 mantine-InlineCodeHighlight-inlineCodeHighlight">init</code>. Она задаст несколько вопросов и на основе ваших ответов сформирует файл <em>composer.json</em>.</p>
<p>Если вы не понимаете значение некоторых вопросов, смело жмите Enter — потом все можно будет поправить:</p>
<div style="margin-bottom:var(--mantine-spacing-lg)" class="m_e597c321 mantine-CodeHighlight-codeHighlight" dir="ltr"><div class="m_be7e9c9c mantine-CodeHighlight-controls"><button style="--ai-bg:transparent;--ai-hover:transparent;--ai-color:inherit;--ai-bd:none" class="mantine-focus-auto mantine-active m_d498bab7 mantine-CodeHighlight-control m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="none" type="button" aria-label="Copy code"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"></path><path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path></svg></span></button></div><div style="--scrollarea-scrollbar-size:calc(0.25rem * var(--mantine-scale));--sa-corner-width:0px;--sa-corner-height:0px" class="m_f744fd40 mantine-CodeHighlight-scrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden;overscroll-behavior-inline:none" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><pre class="m_2c47c4fd mantine-CodeHighlight-pre" style="padding:0"><code class="m_5caae6d3 mantine-CodeHighlight-code">composer init
Welcome to the Composer config generator
This command will guide you through creating your composer.json config.
Package name (<vendor>/<name>) [hex/hex]: hex/example
Description []: example package
Author [, n to skip]: hex <hex@hexlet.io>
Minimum Stability []:
Package Type (e.g. library, project, metapackage, composer-plugin) []:
License []:
Define your dependencies.
Would you like to define your dependencies (require) interactively [yes]? n
Would you like to define your dev dependencies (require-dev) interactively [yes]? n
{
"name": "hex/example",
"description": "example package",
"authors": [
{
"name": "hex",
"email": "hex@hexlet.io"
}
],
"require": {}
}
Do you confirm generation [yes]?</code></pre></div></div></div><button class="mantine-focus-auto m_c9378bc2 mantine-CodeHighlight-showCodeButton m_87cf2631 mantine-UnstyledButton-root" data-hidden="true" type="button">Expand code</button></div>
<p>Когда вопросы закончатся, Composer покажет конечный результат в виде <a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://ru.wikipedia.org/wiki/JSON" rel="noopener noreferrer" target="_blank">JSON</a> — это текстовый формат для представления структурированных данных. Если вы не знакомы с ним, это не критично. Достаточно выучить несколько правил формирования данных в виде JSON, чтобы чувствовать себя комфортно:</p>
<div style="margin-bottom:var(--mantine-spacing-lg)" class="m_e597c321 mantine-CodeHighlight-codeHighlight" dir="ltr"><div class="m_be7e9c9c mantine-CodeHighlight-controls"><button style="--ai-bg:transparent;--ai-hover:transparent;--ai-color:inherit;--ai-bd:none" class="mantine-focus-auto mantine-active m_d498bab7 mantine-CodeHighlight-control m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="none" type="button" aria-label="Copy code"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"></path><path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path></svg></span></button></div><div style="--scrollarea-scrollbar-size:calc(0.25rem * var(--mantine-scale));--sa-corner-width:0px;--sa-corner-height:0px" class="m_f744fd40 mantine-CodeHighlight-scrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden;overscroll-behavior-inline:none" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><pre class="m_2c47c4fd mantine-CodeHighlight-pre" style="padding:0"><code class="m_5caae6d3 mantine-CodeHighlight-code">{
"name": "hex/example",
"description": "example package",
"authors": [
{
"name": "hex",
"email": "hex@hexlet.io"
}
],
"require": {}
}</code></pre></div></div></div><button class="mantine-focus-auto m_c9378bc2 mantine-CodeHighlight-showCodeButton m_87cf2631 mantine-UnstyledButton-root" data-hidden="true" type="button">Expand code</button></div>
<p>Если вас все устраивает, то Composer создаст файл <em>composer.json</em>. Именно этот файл является ключевым. В нем описывается абсолютно все, что касается зависимостей. С этого момента все команды <em>composer</em>, непосредственно связанные с проектом, выполняются именно в той директории, в которой находится файл <em>composer.json</em>.</p>
<p>Имя пакета в <em>composer.json</em>, состоит из двух частей:</p>
<ul>
<li><em>vendor name</em> — имя, под которым вы зарегистрированы в Packagist</li>
<li><em>project name</em></li>
</ul>
<p>Причем <em>vendor name</em> уникален глобально, то есть все пользователи имеют свое собственное неповторимое имя, а вот <em>project name</em> должен быть уникален только в пределах <em>vendor name</em>.</p>
<p>Composer рекомендует именовать пакет словами в нижнем регистре и в качестве разделителя использовать дефис: например, <em>dependency-injection</em>.</p>
<h2 id="heading-2-5">Проблемы</h2>
<p>Иногда в файле <em>composer.json</em> содержатся синтаксические ошибки — нарушения правила форматирования JSON. В таком случае при попытке сделать что-то с проектом будут появляться подобные ошибки:</p>
<div style="margin-bottom:var(--mantine-spacing-lg)" class="m_e597c321 mantine-CodeHighlight-codeHighlight" dir="ltr"><div class="m_be7e9c9c mantine-CodeHighlight-controls"><button style="--ai-bg:transparent;--ai-hover:transparent;--ai-color:inherit;--ai-bd:none" class="mantine-focus-auto mantine-active m_d498bab7 mantine-CodeHighlight-control m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="none" type="button" aria-label="Copy code"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"></path><path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path></svg></span></button></div><div style="--scrollarea-scrollbar-size:calc(0.25rem * var(--mantine-scale));--sa-corner-width:0px;--sa-corner-height:0px" class="m_f744fd40 mantine-CodeHighlight-scrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden;overscroll-behavior-inline:none" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><pre class="m_2c47c4fd mantine-CodeHighlight-pre" style="padding:0"><code class="m_5caae6d3 mantine-CodeHighlight-code">[Seld\JsonLint\ParsingException]
"./composer.json" does not contain valid JSON
Parse error on line 2:
"name": "mokevnin/myproject",
---------^</code></pre></div></div></div><button class="mantine-focus-auto m_c9378bc2 mantine-CodeHighlight-showCodeButton m_87cf2631 mantine-UnstyledButton-root" data-hidden="true" type="button">Expand code</button></div>
<p>Обычно любые сообщения с неожиданными символами или строками говорят о синтаксической ошибке.</p>
<p>Воспользуйтесь валидаторами JSON для проверки корректности своего файла. Например, для этого подходит <a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://jsonlint.com/" rel="noopener noreferrer" target="_blank">jsonlint.com</a> и другие подобные инструменты, которые можно найти по запросу <em>json validator</em>.</p>
<p><a style="text-decoration:underline" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="https://asciinema.org/a/fmo2z9OYBDY7P3XJ7lF6hSa7q" rel="noopener noreferrer" target="_blank"><img style="--image-object-fit:contain;width:auto" class="m_9e117634 mantine-Image-root" src="/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6OTAxMCwicHVyIjoiYmxvYl9pZCJ9fQ==--6543b74ee05af84a50bff40ea16a3401f5ee0746/fmo2z9OYBDY7P3XJ7lF6hSa7q.gif" alt="asciicast" loading="lazy"/></a></p></div><div style="margin-block:var(--mantine-spacing-xl)" class=""><h2 style="--title-fw:var(--mantine-h2-font-weight);--title-lh:var(--mantine-h2-line-height);--title-fz:var(--mantine-h2-font-size);margin-bottom:var(--mantine-spacing-md)" class="m_8a5d1357 mantine-Title-root" data-order="2">Рекомендуемые программы</h2><style data-mantine-styles="inline">.__m__-_R_2mremqrdub_{--carousel-slide-gap:var(--mantine-spacing-xs);--carousel-slide-size:70%;}@media(min-width: 36em){.__m__-_R_2mremqrdub_{--carousel-slide-gap:var(--mantine-spacing-xl);--carousel-slide-size:50%;}}</style><div style="--carousel-control-size:calc(2.5rem * var(--mantine-scale));--carousel-controls-offset:var(--mantine-spacing-sm);margin-bottom:var(--mantine-spacing-lg);padding-block:var(--mantine-spacing-sm);background:var(--app-color-surface)" class="m_17884d0f mantine-Carousel-root responsiveClassName" data-orientation="horizontal" data-include-gap-in-size="true"><div class="m_39bc3463 mantine-Carousel-controls" data-orientation="horizontal"><button class="mantine-focus-auto m_64f58e10 mantine-Carousel-control m_87cf2631 mantine-UnstyledButton-root" type="button" data-inactive="true" data-type="previous" tabindex="-1"><svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" style="transform:rotate(90deg);width:calc(1rem * var(--mantine-scale));height:calc(1rem * var(--mantine-scale));display:block"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg></button><button class="mantine-focus-auto m_64f58e10 mantine-Carousel-control m_87cf2631 mantine-UnstyledButton-root" type="button" data-inactive="true" data-type="next" tabindex="-1"><svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" style="transform:rotate(-90deg);width:calc(1rem * var(--mantine-scale));height:calc(1rem * var(--mantine-scale));display:block"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg></button></div><div class="m_a2dae653 mantine-Carousel-viewport" data-type="media"><div class="m_fcd81474 mantine-Carousel-container __m__-_R_2mremqrdub_" data-orientation="horizontal"><div class="m_d98df724 mantine-Carousel-slide" data-orientation="horizontal"><div tabindex="0" style="cursor:pointer;height:100%"><a style="text-decoration:none" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/programs/php?promo_name=programs_list&promo_position=course&promo_creative=catalog_card&promo_type=card" target="_blank"><div style="height:100%" class="m_e615b15f mantine-Card-root m_1b7284a3 mantine-Paper-root" data-with-border="true"><div style="--group-gap:calc(0.25rem * var(--mantine-scale));--group-align:center;--group-justify:flex-start;--group-wrap:nowrap" class="m_4081bf90 mantine-Group-root"><span style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">10 месяцев</span><span class="mantine-focus-auto m_b6d8b162 mantine-Text-root">·</span><span style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">С нуля</span></div><p style="margin-bottom:var(--mantine-spacing-sm);font-size:var(--mantine-font-size-h5);font-weight:bold" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">РНР-разработчик</p><p class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Изучите PHP и Laravel для разработки и проектирования REST API</p><div style="margin-top:auto" class=""><div class="m_4451eb3a mantine-Center-root"><img style="opacity:0.8;width:70%" class="m_9e117634 mantine-Image-root mantine-visible-from-xs" src="https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6Mzk5MiwicHVyIjoiYmxvYl9pZCJ9fQ==--e9d0f30948ea766a7e6bc3e3d56c192344d45fb8/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Programming-cuate%20(1).png" alt="РНР-разработчик" loading="eager"/></div><div style="--group-gap:var(--mantine-spacing-md);--group-align:end;--group-justify:space-between;--group-wrap:wrap;margin-top:var(--mantine-spacing-xs)" class="m_4081bf90 mantine-Group-root"><p style="font-size:var(--mantine-font-size-xl)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">от 5 650 ₽</p><p style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Посмотреть →</p></div></div></div></a></div></div><div class="m_d98df724 mantine-Carousel-slide" data-orientation="horizontal"><div tabindex="0" style="cursor:pointer;height:100%"><a style="text-decoration:none" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/courses?promo_name=programs_list&promo_position=course&promo_creative=catalog_card&promo_type=card"><div style="height:100%" class="m_e615b15f mantine-Card-root m_1b7284a3 mantine-Paper-root" data-with-border="true"><h2 style="--title-fw:var(--mantine-h2-font-weight);--title-lh:var(--mantine-h2-line-height);--title-fz:var(--mantine-h2-font-size);margin-bottom:var(--mantine-spacing-md);font-size:var(--mantine-font-size-h3)" class="m_8a5d1357 mantine-Title-root" data-order="2" data-responsive="true">Каталог</h2><p style="margin-bottom:auto" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Полный список доступных курсов по разным направлениям</p><div style="margin-top:auto" class=""><div class="m_4451eb3a mantine-Center-root"><img style="opacity:0.8;width:70%" class="m_9e117634 mantine-Image-root mantine-visible-from-xs" src="/vite/assets/development-BVihs_d5.png" alt="Orientation"/></div></div></div></a></div></div></div></div></div></div></div></div></div><style data-mantine-styles="inline">.__m__-_R_1bdub_{--col-flex-grow:auto;--col-flex-basis:8.333333333333334%;--col-max-width:8.333333333333334%;}@media(min-width: 48em){.__m__-_R_1bdub_{--col-flex-grow:auto;--col-flex-basis:16.666666666666668%;--col-max-width:16.666666666666668%;}}</style><div style="min-width:0rem;height:100%;min-height:0rem" class="m_96bdd299 mantine-Grid-col __m__-_R_1bdub_"><div style="margin-inline:var(--mantine-spacing-xs)" class="mantine-visible-from-sm"><a style="--button-color:var(--mantine-color-white);margin-bottom:var(--mantine-spacing-lg);text-decoration:none" class="mantine-focus-auto m_849cf0da mantine-focus-auto m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/courses/php-setup-environment/lessons/composer/finish_unit?unit=theory" data-disabled="true" data-block="true" disabled=""><span class="m_80f1301b mantine-Button-inner"><span class="m_811560b9 mantine-Button-label"><span style="margin-inline-end:var(--mantine-spacing-xs)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Дальше</span>→</span></span></a><a style="padding-inline:0rem" class="mantine-focus-auto m_f0824112 mantine-NavLink-root m_87cf2631 mantine-UnstyledButton-root"><span class="m_690090b5 mantine-NavLink-section" data-position="left"><div style="--ti-size:var(--ti-size-sm);--ti-bg:transparent;--ti-color:var(--mantine-color-indigo-light-color);--ti-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;color:inherit" class="m_7341320d mantine-ThemeIcon-root" data-variant="transparent" data-size="sm"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-list-numbers "><path d="M11 6h9"></path><path d="M11 12h9"></path><path d="M12 18h8"></path><path d="M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"></path><path d="M6 10v-6l-2 2"></path></svg></div></span><div class="m_f07af9d2 mantine-NavLink-body"><span class="m_1f6ac4c4 mantine-NavLink-label">Навигация по теме</span><span class="m_57492dcc mantine-NavLink-description">Теория</span></div><span class="m_690090b5 mantine-NavLink-section" data-position="right"></span></a><div style="margin-block:var(--mantine-spacing-lg)" class="m_3eebeb36 mantine-Divider-root" data-orientation="horizontal" role="separator"></div><div style="margin-block:var(--mantine-spacing-lg)" class=""><div style="justify-content:space-between;margin-bottom:calc(0.1875rem * var(--mantine-scale));color:var(--mantine-color-dimmed);font-size:var(--mantine-font-size-xs)" class="m_8bffd616 mantine-Flex-root __m__-_R_qimrbdub_"><p style="font-size:var(--mantine-font-size-xs)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Завершено</p><p style="font-size:var(--mantine-font-size-xs)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">0 / 9</p></div><div style="--progress-size:var(--progress-size-sm)" class="m_db6d6462 mantine-Progress-root" data-size="sm"><div style="--progress-section-size:0%;--progress-section-color:var(--mantine-color-gray-filled)" class="m_2242eb65 mantine-Progress-section" role="progressbar" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" aria-valuetext="0%"></div></div></div><button style="padding-inline:0rem" class="mantine-focus-auto m_f0824112 mantine-NavLink-root m_87cf2631 mantine-UnstyledButton-root" type="button"><span class="m_690090b5 mantine-NavLink-section" data-position="left"><div style="--ti-size:var(--ti-size-sm);--ti-bg:transparent;--ti-color:var(--mantine-color-indigo-light-color);--ti-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;color:inherit" class="m_7341320d mantine-ThemeIcon-root" data-variant="transparent" data-size="sm"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-message "><path d="M8 9h8"></path><path d="M8 13h6"></path><path d="M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12"></path></svg></div></span><div class="m_f07af9d2 mantine-NavLink-body"><span class="m_1f6ac4c4 mantine-NavLink-label">Обсуждения (архив)</span><span class="m_57492dcc mantine-NavLink-description"></span></div></button><div style="--toc-bg:var(--mantine-color-blue-light);--toc-color:var(--mantine-color-blue-light-color);--toc-size:var(--mantine-font-size-sm);--toc-radius:var(--mantine-radius-sm);margin-top:var(--mantine-spacing-xl)" class="m_bcaa9990 mantine-TableOfContents-root" data-variant="light" data-size="sm"></div></div><div class="mantine-hidden-from-sm"><div style="--stack-gap:0rem;--stack-align:stretch;--stack-justify:flex-start" class="m_6d731127 mantine-Stack-root"><a style="--button-color:var(--mantine-color-white);margin-bottom:var(--mantine-spacing-xs);padding:0rem;text-decoration:none" class="mantine-focus-auto m_849cf0da mantine-focus-auto m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/courses/php-setup-environment/lessons/composer/finish_unit?unit=theory" data-disabled="true" data-block="true" disabled=""><span class="m_80f1301b mantine-Button-inner"><span class="m_811560b9 mantine-Button-label">→</span></span></a><button style="--ai-size:var(--ai-size-sm);--ai-bg:transparent;--ai-hover:var(--mantine-color-indigo-light-hover);--ai-color:var(--mantine-color-indigo-light-color);--ai-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;padding-block:var(--mantine-spacing-lg);color:inherit;width:100%" class="mantine-focus-auto m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="subtle" data-size="sm" data-disabled="true" type="button" disabled=""><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-list-numbers "><path d="M11 6h9"></path><path d="M11 12h9"></path><path d="M12 18h8"></path><path d="M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"></path><path d="M6 10v-6l-2 2"></path></svg></span></button><button style="--ai-size:var(--ai-size-sm);--ai-bg:transparent;--ai-hover:var(--mantine-color-indigo-light-hover);--ai-color:var(--mantine-color-indigo-light-color);--ai-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;padding-block:var(--mantine-spacing-lg);color:inherit;width:100%" class="mantine-focus-auto mantine-active m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="subtle" data-size="sm" type="button"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-message "><path d="M8 9h8"></path><path d="M8 13h6"></path><path d="M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12"></path></svg></span></button></div></div></div></div></div></div></div>
</main>
<footer class="bg-dark fw-light text-light px-3 py-5">
<div class="row small">
<div class="col-12 col-sm-6 col-md-3">
<div class="h5 mb-3">Хекслет</div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/about">О нас</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/testimonials">Отзывы</a>
</li>
<li>
<span class="nav-link link-light py-1 ps-0 external-link" data-href="https://b2b.hexlet.io" role="button">Корпоративное обучение</span>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/blog">Блог</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/qna">Вопросы и ответы</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/glossary">Глоссарий</a>
</li>
<li>
<span class="nav-link link-light py-1 ps-0 external-link" data-href="https://help.hexlet.io" data-target="_blank" role="button">Справка</span>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" target="_blank" rel="noopener noreferrer" href="/map">Карта сайта</a>
</li>
</ul>
</div>
<div class="col-12 col-sm-6 col-md-3">
<div class="h5 fw-normal mb-3">Направления</div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_devops">DevOps
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_data_analytics">Аналитика
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_backend_development">Бэкенд
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_programming">Программирование
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_testing">Тестирование
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_front_end_dev">Фронтенд
</a></li>
</ul>
</div>
<div class="col-12 col-sm-6 col-md-3">
<div class="h5">Профессии</div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/devops-engineer-from-scratch">DevOps-инженер с нуля</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/go">Go-разработчик</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/java">Java-разработчик</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/python">Python-разработчик </a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/data-analytics">Аналитик данных</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/qa-engineer">Инженер по ручному тестированию</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/php">РНР-разработчик</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/frontend">Фронтенд-разработчик</a>
</li>
</ul>
</div>
<div class="col-12 col-sm-6 col-md-3">
<div class="h5">Навыки</div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/python-django-developer">Django</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/docker">Docker</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/php-laravel-developer">Laravel</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/postman">Postman</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/js-react-developer">React</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/js-rest-api">REST API в Node.js</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/spring-boot">Spring Boot</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/typescript">Typescript</a>
</li>
</ul>
</div>
</div>
<hr>
<div class="row">
<div class="col-12 col-sm-4 col-md-2">
<div class="fs-4">
<ul class="list-unstyled d-flex">
<li class="me-3">
<a aria-label="Telegram" target="_blank" class="link-light" rel="noopener noreferrer nofollow" href="https://t.me/hexlet_ru"><span class="bi bi-telegram"></span>
</a></li>
<li>
<a aria-label="Youtube" target="_blank" class="link-light" rel="noopener noreferrer nofollow" href="https://www.youtube.com/user/HexletUniversity"><span class="bi bi-youtube"></span>
</a></li>
</ul>
</div>
<div class="mb-2 d-flex flex-column">
<a class="link-light text-decoration-none" rel="nofollow" href="mailto:support@hexlet.io">support@hexlet.io</a>
<a class="link-light text-decoration-none py-2" target="_blank" href="https://t.me/hexlet_help_bot">t.me/hexlet_help_bot</a>
</div>
<ul class="list-unstyled d-flex">
<li class="me-3">
<span class="link-light text-decoration-none opacity-50 x-font-size-18 external-link" rel="nofollow" data-href="https://hexlet.io/locale/switch?new_locale=en" data-target="_self" role="button"><span class="my-auto">EN</span>
</span></li>
<li class="me-3">
<span class="link-light text-decoration-none opacity-50 x-font-size-18 opacity-100 external-link" rel="nofollow" data-href="https://ru.hexlet.io/locale/switch?new_locale=ru" data-target="_self" role="button"><span class="my-auto">RU</span>
</span></li>
<li class="me-3">
<span class="link-light text-decoration-none opacity-50 x-font-size-18 external-link" rel="nofollow" data-href="https://kz.hexlet.io/locale/switch?new_locale=kz" data-target="_self" role="button"><span class="my-auto">KZ</span>
</span></li>
</ul>
</div>
<div class="col-12 col-sm-4 col-md-3">
<ul class="list-unstyled fs-4">
<li class="mb-3">
<a class="link-light text-decoration-none" href="tel:8%20800%20100%2022%2047">8 800 100 22 47</a>
<span class="d-block opacity-50 small">бесплатно по РФ</span>
</li>
<li>
<a class="link-light text-decoration-none" href="tel:%2B7%20495%20085%2021%2062">+7 495 085 21 62</a>
<span class="d-block opacity-50 small">бесплатно по Москве</span>
</li>
</ul>
</div>
<div class="col-12 col-sm-4 col-md-3">
<div class="small mb-3">Образовательные услуги оказываются на основании Л035-01298-77/01989008 от 14.03.2025</div>
<ul class="list-unstyled small">
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/legal">Правовая информация</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/offer">Оферта</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/license">Лицензия</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/contacts">Контакты</a>
</li>
</ul>
</div>
<div class="col-12 col-sm-12 col-md-4 small">
<div class="mb-2">
<div>ООО «<a href="/" class="text-decoration-none link-light">Хекслет Рус</a>»</div>
<div>108813 г. Москва, вн.тер.г. поселение Московский,</div>
<div>г. Московский, ул. Солнечная, д. 3А, стр. 1, помещ. 20Б/3</div>
<div>ОГРН 1217300010476</div>
<div>ИНН 7325174845</div>
</div>
<hr>
<div>АНО ДПО «<a href="/" class="text-decoration-none link-light">Учебный центр «Хекслет</a>»</div>
<div>119331 г. Москва, вн. тер. г. муниципальный округ</div>
<div>Ломоносовский, пр-кт Вернадского, д. 29</div>
<div>ОГРН 1247700712390</div>
<div>ИНН 7736364948</div>
</div>
</div>
</footer>
<div id="root-assistant-offcanvas"></div>
<script src="/vite/assets/assistant-Bukl1lYy.js" crossorigin="anonymous" type="module"></script><link rel="modulepreload" href="/vite/assets/chunk-DsPFFUou.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/init-BrRXra1y.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/ErrorFallbackBlock-naDSYSy9.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/MarkdownBlock-DbyKWoR_.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/gon-D3e4yh1x.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/mantine-CGMYrt2Y.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/shiki-V011pkdv.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/utils-DRqSHbQE.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/routes-CCH8ilKF.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/lib-XR8Qr8kR.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/dist-GCHh59xr.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Box-B5-OOzBf.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/notifications.store-C-3AFSMn.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/useIsomorphicEffect-HJ6VK0D3.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/lib-KSp6QbZ0.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/axios-BEvgo0ym.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/classnames-l6ipYlLR.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/dayjs.min-BkKovM-s.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/debounce-jMQ_Cf4f.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/i18next-BlSq9s7B.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/client-U9M77rxp.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-dom-DaLxUz_h.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/useTranslation-Bx1Cdrkz.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/compiler-runtime-6XxiPFnt.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/jsx-runtime-CwjcCKJi.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-CkL4ZRHB.js" as="script" crossorigin="anonymous">
<script defer src="https://static.cloudflareinsights.com/beacon.min.js/v67327c56f0bb4ef8b305cae61679db8f1769101564043" integrity="sha512-rdcWY47ByXd76cbCFzznIcEaCN71jqkWBBqlwhF1SY7KubdLKZiEGeP7AyieKZlGP9hbY/MhGrwXzJC/HulNyg==" data-cf-beacon='{"version":"2024.11.0","token":"d11015b65d11429ea6b4a2ef37dd7e0b","server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}' crossorigin="anonymous"></script>
</body>
</html>