# Media Optimizer Command sw:media:optimize nicht vorhanden

**URL:** https://forum.shopware.com/t/media-optimizer-command-swoptimize-nicht-vorhanden/54103
**Category:** Administration
**Created:** [16. Juli 2018 um 13:56 UTC](https://forum.shopware.com/t/media-optimizer-command-swoptimize-nicht-vorhanden/54103 "2018-07-16T13:56:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![PK\_Seybold](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@PK\_Seybold](https://forum.shopware.com/u/PK_Seybold)
#### Post date: [16. Juli 2018 um 13:56 UTC](https://forum.shopware.com/t/media-optimizer-command-swoptimize-nicht-vorhanden/54103/1 "2018-07-16T13:56:54Z")

</div>

Hallo zusammen,

ich habe festgestellt, dass auf meiner Shopware Seite ( **Shopware version 5.4.5** ) die Thumbnails nicht optimiert werden. Als ich das ganze per Hand über SSH mit dem _sw:media:optimize_ Befehl (siehe:&nbsp;[https://community.shopware.com/Shopware-Media-Optimizer\_detail\_1994.html](https://community.shopware.com/Shopware-Media-Optimizer_detail_1994.html)) machen wollte, erhielt ich folgende Nachricht:

```
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "sw:media" namespace.

```

Ein Blick in die vorhandenen Commands mittels ./bin/console list zeigt auch keine sw:media Commands an. Der Ordner /engine/Shopware/Bundle/MediaBundle ist aber samt services.xml vorhanden. Woran liegt es nun, dass die Kommandos nicht vorhanden sind? Evtl kann mir hier jemand weiterhelfen, denn aktuell bin ich ziemlich ratlos

Vielen Dank

![](https://img3.picload.org/image/dldrpgll/image.png)

---

<div class="post-metadata">

### Author: ![Raggy](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@Raggy](https://forum.shopware.com/u/Raggy)
#### Post date: [20. Juli 2018 um 09:20 UTC](https://forum.shopware.com/t/media-optimizer-command-swoptimize-nicht-vorhanden/54103/2 "2018-07-20T09:20:16Z")

</div>

Hey Sebold,

wahrscheinlich verdwenst du die&nbsp;Symfony Application. Folgender Code funktioniert einwandfrei.&nbsp;

```
use Shopware\Components\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;

------------------------------------------------------

        $kernel = new Shopware\Kernel('dev', false);
        $application = new Application($kernel);
        $kernel->boot();
        $application->setAutoExit(false);

        $input = new ArrayInput(array('command' => 'sw:cache:clear));

        $output = new BufferedOutput();
        $application->run($input, $output);
        $data = $output->fetch();

```

&nbsp;
