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

Message ListMessage List     Post MessagePost Message

  Call to undefined function callmethod() but not everytime
Posted by Steve Thivrier on Jan-10-2018 00:45
Hi,

when I call this page :  https://demo.aclce.fr/acl_controllers/acl_ajax/editions/edition_stats.php?id_temp=694

I have (not everytime ....) the error  "  Call to undefined function callmethod() " but by updating the page, from time to time, the error disappears and the graph is displayed.

Since the image appears at certain times, I suspect there is no problem with the extension of ChartDirector, or call to the .dll in the php.ini file.

Nevertheless, do you have a track to look for why the call to this function does not always happen. I have no idea.

Can this come from the code? php configuration? other?

Thanks in advance !

  Re: Call to undefined function callmethod() but not everytime
Posted by Peter Kwan on Jan-10-2018 15:48
Hi Steve,

The callmethod is a function implemented in "phpchartdir???.dll". It is used by ChartDirector for PHP in all of its methods.

When PHP loads the phpchartdir???.dll extension. the extension will register the "callmethod" function with PHP, so that the PHP interpreter knows the "callmethod" function can be found in "phpchartdir???.dll".

When you include "phpchartdir.php" in your code, all modern versions of "phpchartdir.php" will check if "phpchartdir???.dll" has successfully been loaded, and will produce an error if it does not. If your code can call a ChartDirector method, it means "phpchartdir.php" has successfully been loaded, which means "phpchartdir???.dll" is loaded, and which means "callmethod" is available.

For your case, I can only guess of the following possibilities:

(a) In some web server/PHP type combination, the web server would "fork" out many copies of itself so that it can handle multiple requests concurrently. For example, the Apache web server frequently forks out something like 20 httpd processes. If some of these processes do not load ChartDirector successfully or were corrupted for some reasons, then you can have errors if your HTTP request happens to be processed by that process. So the error is intermittent and may go away if you press "refresh".

One thing you may try is to restart the web server (stop the Apache completely then start it; on Windows with IIS, use the command line iisreset to restart the IIS web server).

(b) In some very old versions of ChartDirector, there is no checking to determine if "phpchartdir???.dll" has successfully been loaded. So this error can occur if the "phpchartdir???.dll" is not loaded. The last time we encountered this error was over 10 years ago. Please make sure you are using newer versions of ChartDirector.

(c) I am not sure what would happen if the "phpchartdir???.dll" or "libchartdir.so" is updated or modified while the web server is running. On Windows, this should be impossible (as Windows will "lock" the DLL to prevent overwriting). But on Linux, it is possible to modify a dynamic module while it is being used. This may cause some unexpected problem. Restarting the web server as per (a) above should solve this problem.

(d) There may be some cache issues on the server or on the browser. Again, restarting the web server as per (a) above may solve this problem.

Regards
Peter Kwan

  Re: Call to undefined function callmethod() but not everytime
Posted by Steve Thivrier on Jan-10-2018 18:42
Hi,

I was using an old version of php 5.4 (server restriction).
I could simply migrate to a more "recent" version (5.6) and it works!

Easy :)

Thank you so much !

I appreciated the speed and the very complete answer

Thank you Peter.