<p>SVGs are fine, but the <code>brokenImagePath</code> needs to be an absolute file path.</p>
<p>The setting supports <a href="https://craftcms.com/docs/4.x/config/general.html#aliases" rel="nofollow noreferrer">aliases</a>, so if your <code>@webroot</code> alias is properly configured it could be set to</p>
<pre><code>'brokenImagePath' =&gt; '@webroot/assets/ui/default/image_404.svg',
</code></pre>
<p>See <a href="https://craftcms.com/docs/4.x/config/general.html#brokenimagepath" rel="nofollow noreferrer">the official docs on the <code>brokenImagePath</code></a> for more details.</p>

CC BY-SA 4.0
2023-04-25T11:55:07.963Z
Thanks for the answer, that was it :)
mitrol
CC BY-SA 4.0
2023-04-25T07:43:58.437Z
2023-04-25T07:43:58.437Z
Mats Mikkel Rummelhoff
<p>I’ve converted an old site with 15+ years of posts over to Craft from WP. There were a lot of missing images, I’ve handled this with the broken image path setting in the config/general.php.</p>
<p>However, I’m getting numerous missing image errors in the PHP log and each one is accompanied by the following error:</p>
<pre><code>yii\base\InvalidConfigException: Invalid broken image path: /assets/ui/default/image_404.svg in /home/customer/www/[ SITE ]/vendor/craftcms/cms/src/controllers/AppController.php:626
</code></pre>
<p>That path (/assets/ui/default/image_404.svg) is correct, the image is there.</p>
<p>I have a couple of ideas:</p>
<ol>
<li>It needs to be an absolute path</li>
<li>Maybe an SVG is no good and it needs to be a PNG/WebP</li>
</ol>
<p>Can anyone suggest anything else I can try?</p>

<error-message><image>
Invalid broken image path
# Invalid broken image path

(Asked by: username_0 on 2023-04-24)

I’ve converted an old site with 15+ years of posts over to Craft from WP. There were a lot of missing images, I’ve handled this with the broken image path setting in the config/general.php.
However, I’m getting numerous missing image errors in the PHP log and each one is accompanied by the following error:
yii\base\InvalidConfigException: Invalid broken image path: /assets/ui/default/image_404.svg in /home/customer/www/[ SITE ]/vendor/craftcms/cms/src/controllers/AppController.php:626

That path (/assets/ui/default/image_404.svg) is correct, the image is there.
I have a couple of ideas:

It needs to be an absolute path
Maybe an SVG is no good and it needs to be a PNG/WebP

Can anyone suggest anything else I can try?

**Tags:** error-message, image


---

## 1 answers

### Answer by username_1 on 2023-04-25. Score: 1 | Accepted answer

SVGs are fine, but the brokenImagePath needs to be an absolute file path.
The setting supports aliases, so if your @webroot alias is properly configured it could be set to
'brokenImagePath' => '@webroot/assets/ui/default/image_404.svg',

See the official docs on the brokenImagePath for more details.

> **Comments:**
> **username_0**: Thanks for the answer, that was it :)  

---

