0

I've got this error when launching a php worker on Iron.io :

PHP Fatal error:  Class 'PDO' not found in /mnt/task/...

My PHP script just call the native PDO extension like this :

$db = new PDO (...);

Anybody know if there's a known problem with the docker image iron/php and the PDO extension ?

Thank you.

1 Answers1

2

Try to add php-pdo package into your docker image.

Example of installing php-pdo package via Dockerfile: FROM iron/php ... RUN apk add php-pdo ...

Dmitriy
  • 399
  • 2
  • 6
  • I didn't want to use docker to package my worker. I can't get that iron provide a docker image without pdo pré installed. I tried to use other docker image, but nothing worked. Your advice is the best answer i think. Thank you ! – Baptiste Bouillot Jan 26 '16 at 16:24
  • If you don't want to use docker image you can use iron_worker_ruby_ng gem `https://github.com/iron-io/iron_worker_ruby_ng` for upload and queue your code via cli. Or you can use iron_worker_php lib `https://github.com/iron-io/iron_worker_php/blob/master/src/IronWorker.php#L79` to upload and then queue task via your code. (use php-5.5 stack) – Dmitriy Jan 27 '16 at 06:20