ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  PHP 7.2 Unable to initialize module
Posted by Mike Gibbons on Nov-30-2018 11:59
Hi Peter,

Having been a user of your wonderful software for many years, I'm stumped by my inability to solve this:

PHP Startup: ChartDirector PHP API: Unable to initialize module
Module compiled with module API=20151012
PHP    compiled with module API=20170718

I've downloaded version 6.0 for PHP and copied the lib contents to /usr/lib/php/20170718.

What did I do wrong?

Thank You,

Mike Gibbons

  Re: PHP 7.2 Unable to initialize module
Posted by Peter Kwan on Nov-30-2018 14:17
Hi Mike,

In your extension statement, do you use "extension=phpchartdir700.dll"? For PHP 7.2, it should be "extension=phpchartdir720.dll".

Regards
Peter Kwan

  Re: PHP 7.2 Unable to initialize module
Posted by Mike Gibbons on Dec-01-2018 03:51
Yes, I did

/etc/php/7.2/apache2/php.ini

extension = phpchartdir720.dll

Upgraded my development machine to Ubuntu 18.04 and Apache2 will not start

[Thu Nov 29 16:33:34.677482 2018] [mpm_prefork:notice] [pid 22241] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Thu Nov 29 16:33:34.677508 2018] [core:notice] [pid 22241] AH00094: Command line: '/usr/sbin/apache2'
[29-Nov-2018 16:39:02 Pacific/Honolulu] PHP Warning:  PHP Startup: ChartDirector PHP API: Unable to initialize module
Module compiled with module API=20151012
PHP    compiled with module API=20170718
These options need to match

  Re: PHP 7.2 Unable to initialize module
Posted by Peter Kwan on Dec-01-2018 22:02
Hi Mike,

I happened to encounter the same problem a few days ago in one of my other customers. It turns out to be due to a very unlikely problem - that for some reasons, someone may have renamed or copied the "phpchartdir700.dll" to "phpchartdir720.dll". In other words, in that case, the "phpchartdir720.dll" was actually "phpchartdir700.dll". The "module API" 20151012 is the API for "phpchartdir700.dll", while the 20170718 is the API for "phpchartdir720.dll".

For your case, to troubleshoot the problem, please try to remove the line "extension = phpchartdir720.dll" from "/etc/php/7.2/apache2/php.ini", then restart Apache, and check if the error still occur. If there is no error, please insert the line back and restart Apache to see if the error occurs. This confirms if the error is really due to the line "extension=phpchartdir720.dll".

If the error occurs even if there is no such line, then there may be another line somewhere that causes the error. From my understanding, the Apache/PHP 7.2 in Ubuntu will also load additional ".ini" files from "/etc/php/7.2/apache2/conf.d", and there is a possibility of another line in these additional ".ini" files that causes the problem.

If it is confirmed the "extension=phpchartdir720.dll" causes the problem, please go the PHP extension directory (in our own Ubuntu, the PHP extension directory is at "/usr/lib/php/20170718"), and enter "md5sum phpchartdir720.dll". The MD5 checksum of the file should be "873bb650a833c24625502b13b3e78e71". If the checksum is incorrect, then the "phpchartdir720.dll" is not the same as the one in our distribution. (I assume you are using the latest ChartDirector for PHP for Linux x86_64.) As a second check, you can try "cat phpchartdir720.dll | grep 20170718". It should confirm a match showing that the module API is 20170718, while "cat phpchartdir720.dll | grep 20151012" should not report any match.

If the "phchartdir720.dll" is not the correct one, please replace it with the "phpchartdir720.dll" downloaded from the latest "ChartDirector for PHP for Linux (x86_64)" from our web site.

Please kindly let me know what is the result.

Regards
Peter Kwan

  Re: PHP 7.2 Unable to initialize module
Posted by Mike Gibbons on Dec-02-2018 12:24
Peter,
Thank you for your detailed reply but it was all my fault. Sorry to have taken your time.

I had copied my Ubuntu 16.04 Apache config over my 18.04 Apache config so even though I had the correct extension statement in php.ini. it was insufficient.

Warm regards,

Mike Gibbons