# Fatal error: Uncaught Error: Call to undefined function CommonMark\\Parse()

**URL:** <https://forums.docker.com/t/fatal-error-uncaught-error-call-to-undefined-function-commonmark-parse/135166>\
**Category:** General\
**Created:** [March 20, 2023, 12:24pm UTC](https://forums.docker.com/t/fatal-error-uncaught-error-call-to-undefined-function-commonmark-parse/135166 "2023-03-20T12:24:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tech687](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/tech687/32/34381_2.png) [@tech687](https://forums.docker.com/u/tech687)\
**Post date:** [March 20, 2023, 12:24pm UTC](https://forums.docker.com/t/fatal-error-uncaught-error-call-to-undefined-function-commonmark-parse/135166/1 "2023-03-20T12:24:17Z")

</div>

First of all

```auto
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.1 LTS
Release:	22.04
Codename:	jammy

$ docker-compose -v
docker-compose version 1.29.2, build unknown

```

Let’s get to the point

```auto
$ docker run php -r 'CommonMark\Parse();'
Fatal error: Uncaught Error: Call to undefined function CommonMark\Parse() in Command line code:1

```

Maybe some extension is missing?  
From what I see from the page [PHP: CommonMark\Parse - Manual](https://www.php.net/manual/en/function.commonmark-parse.php) I think it should be the cmark extension.  
Let’s do another test…

```auto
$ cat docker-compose.yml 
services:
    php:
        build: .

$ cat Dockerfile 
FROM php
RUN docker-php-ext-install cmark

$ docker-compose run php -r 'CommonMark\Parse();'
Building php
Step 1/2 : FROM php
 ---> 2d9f89fee2cf
Step 2/2 : RUN docker-php-ext-install cmark
 ---> Running in cd76a3406bd1
error: /usr/src/php/ext/cmark does not exist

usage: /usr/local/bin/docker-php-ext-install [-jN] [--ini-name file.ini] ext-name [ext-name ...]
   ie: /usr/local/bin/docker-php-ext-install gd mysqli
       /usr/local/bin/docker-php-ext-install pdo pdo_mysql
       /usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop

if custom ./configure arguments are necessary, see docker-php-ext-configure

Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv imap intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip

Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Service 'php' failed to build : The command '/bin/sh -c docker-php-ext-install cmark' returned a non-zero code: 1

```

**error: /usr/src/php/ext/cmark does not exist**  
How can I solve?
