# Updated to Modx 3, error 503

**URL:** <https://community.modx.com/t/updated-to-modx-3-error-503/5244>\
**Category:** Getting Started\
**Created:** [April 20, 2022, 8:03pm UTC](https://community.modx.com/t/updated-to-modx-3-error-503/5244 "2022-04-20T20:03:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franc999](https://community.modx.com/letter_avatar_proxy/v4/letter/f/4bbf92/32.png) [@Franc999](https://community.modx.com/u/Franc999)\
**Post date:** [April 20, 2022, 8:03pm UTC](https://community.modx.com/t/updated-to-modx-3-error-503/5244/1 "2022-04-20T20:03:41Z")

</div>

Updated to version Modx 3.  
The site has a news section, examples of work, employees, etc.  
Everything is displayed through Collection 4.0.0. Error 503 occurs when you go to the page of the full material. Pictures for the materials are displayed through the additional TV img field.

```auto
<img src="[[*img:phpthumbon=`w=540&h=480zc=1`]]" alt="[[*pagetitle]]">

```

If you disable the additional img field, then the page of the full material opens normally. If enabled then error 503

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [April 20, 2022, 8:55pm UTC](https://community.modx.com/t/updated-to-modx-3-error-503/5244/2 "2022-04-20T20:55:27Z")

</div>

The problem is probably the extra [phpThumbOn](https://modx.com/extras/package/phpthumbon).

I installed it (version 1.3.1-pl) to test it and get an error too (“Call to a member function make() on null …”).  
`$this->modx->getService('fileHandler','modFileHandler');` doesn’t seem to work anymore in MODX3.

* * *

Maybe try using [pThumb](https://modx.com/extras/package/pthumb) instead.  
According to [this site](https://www.sitedash.app/extras) it should be compatible with MODX3.

---

<div class="post-metadata">

**Author:** ![pescefresca](https://community.modx.com/letter_avatar_proxy/v4/letter/p/ecccb3/32.png) [@pescefresca](https://community.modx.com/u/pescefresca)\
**Post date:** [June 22, 2023, 5:41pm UTC](https://community.modx.com/t/updated-to-modx-3-error-503/5244/3 "2023-06-22T17:41:18Z")

</div>

Or you can rewrite code a bit of the phpthumbon extension.  
All bellow changes are in the file core/components/phpthumbon/model/phpthumbon/phpthumbon.class.php

So for example this part

```auto
$this->modx->getService('fileHandler','modFileHandler');

```

Should become this

```auto
$fileHandler = $this->modx->getService('fileHandler', modFileHandler::class);

```

And then to create dir you can do it like that

```auto
$dirObj = $this->modx->fileHandler->make($dir, array(), modDirectory::class);

```

Also need to add this at the top fo the file

```auto
 use MODX\Revolution\File\modFileHandler;
 use MODX\Revolution\File\modDirectory;
 use MODX\Revolution\modPhpThumb;

```

Hope it will help someone
