# Kirby Built in Server - GD dependency - OSX

**URL:** <https://forum.getkirby.com/t/kirby-built-in-server-gd-dependency-osx/27843>\
**Category:** Questions\
**Tags:** v3\
**Created:** [February 13, 2023, 1:53pm UTC](https://forum.getkirby.com/t/kirby-built-in-server-gd-dependency-osx/27843 "2023-02-13T13:53:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali\_v001](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@ali\_v001](https://forum.getkirby.com/u/ali_v001)\
**Post date:** [February 13, 2023, 1:53pm UTC](https://forum.getkirby.com/t/kirby-built-in-server-gd-dependency-osx/27843/1 "2023-02-13T13:53:27Z")

</div>

Hi is there a dummies guide to using the built in Kirby server… on OSX Ventura?  
Also specifically with the GD dependency, everything works fine until I try and use the images -\>resize function, then my website just errors.  
Im pretty sure it’s something to do with GD from reading around. Just know idea how to install it.  
I am using the built in php server that comes with the Mac OS

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 13, 2023, 2:14pm UTC](https://forum.getkirby.com/t/kirby-built-in-server-gd-dependency-osx/27843/2 "2023-02-13T14:14:32Z")

</div>

First step would be to print `phpinfo()` to check if GD is installed.

> [@ali\_v001](#):
>
> then my website just errors.

That’s pretty vague, what exactly?

---

<div class="post-metadata">

**Author:** ![ali\_v001](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@ali\_v001](https://forum.getkirby.com/u/ali_v001)\
**Post date:** [February 13, 2023, 2:38pm UTC](https://forum.getkirby.com/t/kirby-built-in-server-gd-dependency-osx/27843/3 "2023-02-13T14:38:27Z")

</div>

Hi Apologies,

```auto
php -i | grep 'GD\|ImageMagick'

```

returns…

```auto
GD Support => enabled
GD headers Version => 2.3.3
GD library Version => 2.3.3

```

```auto
phpinfo()

```

returns…

```auto
function>

```

The error I receive from the debug mode is… “Call to a member function crop() on null” Code below… its the line with the crop function which errors, however same if I use resize.

```auto
<ul class="projects">
 
 
    <?php 
    $vari = page('portfolio');
 
    foreach ($vari->children()->listed() as $image): ?>
    <li>
        <a href="<?= $image->url() ?>">
 
            <figure>
 
                <?= $image->image()->crop(200, 200) ?>
 
            </figure>    
        </a>
    </li>
    <?php endforeach ?>            
</ul>

```

Thanks

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 13, 2023, 2:42pm UTC](https://forum.getkirby.com/t/kirby-built-in-server-gd-dependency-osx/27843/4 "2023-02-13T14:42:07Z")

</div>

Your error has nothing to do with GD being present or not. The error tells you that `$image->image()` return null and then you try to call `crop()` on null. You need to check if you have an image before you call any member method.

---

<div class="post-metadata">

**Author:** ![ali\_v001](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@ali\_v001](https://forum.getkirby.com/u/ali_v001)\
**Post date:** [February 13, 2023, 2:47pm UTC](https://forum.getkirby.com/t/kirby-built-in-server-gd-dependency-osx/27843/5 "2023-02-13T14:47:25Z")

</div>

Hi do you know how I would go about that?  
The image is there and the page works when I remove crop or resize,  
I was following the Kirby YouTube video on building a project grid [How to build a project grid - YouTube](https://www.youtube.com/watch?v=op5iP71Bg6w&t=686s)  
Everything works fine until I try to resize the images

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 13, 2023, 3:01pm UTC](https://forum.getkirby.com/t/kirby-built-in-server-gd-dependency-osx/27843/6 "2023-02-13T15:01:26Z")

</div>

> [@ali\_v001](#):
>
> ` <?= $image->image()->crop(200, 200) ?>`

The correct way to go about this is this:

```auto
<?php 
    $vari = page('portfolio');
 
    foreach ($vari->children()->listed() as $p): ?>
       <?php if ($image = $p->image()): ?>
    <li>
        <a href="<?= $p->url() ?>">

            <figure>
 
                <?= $image->crop(200, 200) ?>
 
            </figure>    
        </a>
    </li>
   <?php endif ?>
    <?php endforeach ?>            
</ul>
```

---

<div class="post-metadata">

**Author:** ![ali\_v001](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@ali\_v001](https://forum.getkirby.com/u/ali_v001)\
**Post date:** [February 13, 2023, 3:17pm UTC](https://forum.getkirby.com/t/kirby-built-in-server-gd-dependency-osx/27843/7 "2023-02-13T15:17:50Z")

</div>

Thank you!
