If you just want it curved, there is a demo here with the code below.
$draw = new \ImagickDraw();
$draw->setFont("../fonts/Arial.ttf");
$draw->setFontSize(48);
$draw->setStrokeAntialias(true);
$draw->setTextAntialias(true);
$draw->setFillColor('#ff0000');
$textOnly = new \Imagick();
$textOnly->newImage(600, 300, "rgb(230, 230, 230)");
$textOnly->setImageFormat('png');
$textOnly->annotateImage($draw, 30, 40, 0, 'Your Text Here');
$textOnly->trimImage(0);
$textOnly->setImagePage($textOnly->getimageWidth(), $textOnly->getimageheight(), 0, 0);
$distort = array(180);
$textOnly->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);
$textOnly->setImageMatte(true);
$textOnly->distortImage(Imagick::DISTORTION_ARC, $distort, false);
$textOnly->setformat('png');
header("Content-Type: image/png");
echo $textOnly->getimageblob();
If you actually want it along a path, then I don't think you can in Imagick. You would need to create an SVG file and convert that to a PNG and overlay it on an image Example of a textpath taken from https://developer.mozilla.org/en/docs/Web/SVG/Element/textPath
<svg width="100%" height="100%" viewBox="0 0 1000 300"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<path id="MyPath"
d="M 100 200
C 200 100 300 0 400 100
C 500 200 600 300 700 200
C 800 100 900 100 900 100" />
</defs>
<use xlink:href="#MyPath" fill="none" stroke="red" />
<text font-family="Verdana" font-size="42.5">
<textPath xlink:href="#MyPath">
We go up, then we go down, then up again
</textPath>
</text>
<rect x="1" y="1" width="998" height="298"
fill="none" stroke="black" stroke-width="2" />
</svg>
which also needs an SVG converter that supports textpath. The one built into ImageMagick does not support textpath apparently.