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

Message ListMessage List     Post MessagePost Message

  Re:Error Loading ChartDirector for PHP Extension
Posted by Deval on Mar-25-2025 00:08
Hello,
I am new with this `ChartDirector` extension and I am facing some issue to configure this extension for one of my codebase.
I am trying to install this extension via docker:
here is my script:
`chartdir.sh`
-------------------------
# Download ChartDirector (ARM64)
cd /tmp
wget https://www.advsofteng.net/chartdir_php_linux_arm64.tar.gz
tar -xzf chartdir_php_linux_arm64.tar.gz -C /tmp

# Copy extension to PHP ext dir
PHP_EXT_DIR=$(php-config --extension-dir)
cp /tmp/ChartDirector/lib/libchartdir.so "$PHP_EXT_DIR"
cp -r /tmp/ChartDirector/lib/* "$PHP_EXT_DIR"
*******************************************
in DockerFile:
--------------------
# Copy ChartDirector installer script
COPY chartdir.sh /tmp/chartdir.sh
RUN chmod +x /tmp/chartdir.sh && /tmp/chartdir.sh
RUN echo "extension=libchartdir.so"  >> "$PHP_INI_DIR/php.ini"
*******************************************************

I already checked past threads regarding this error and performed all steps which are mentioned. Still I am getting this error:
------------------------------------
Error Loading ChartDirector for PHP Extension

It appears this PHP system has not loaded the ChartDirector extension by using an extension statement in the PHP configuration file (typically called "php.ini"). An attempt has been made to dynamically load ChartDirector on the fly, but it was not successful. Please refer to the Installation section of the ChartDirector for PHP documentation on how to resolve this problem.

Error Log

The version and type of PHP in this system does not support dynmaic loading of PHP extensions. All PHP extensions must be loaded by using extension statements in the PHP configuration file.

System Information
Operating System : Linux 474bb07e3164 6.10.14-linuxkit #1 SMP Mon Feb 24 16:35:16 UTC 2025 aarch64
PHP version : 7.4.33
PHP / Web Server interface : apache2handler
PHP configuration file location : "/usr/local/etc/php/php.ini"
PHP extension directory : "/usr/local/lib/php/extensions/no-debug-non-zts-20190902"
***********************************************************
I am sure I am doing something silly mistake here. Appreciate your guidance in advance

regards
Deval

  Re:Error Loading ChartDirector for PHP Extension
Posted by Peter Kwan on Mar-25-2025 02:07
Hi Deval,

The extension statement should be:

extension=phpchartdir???.dll

where ??? depends on your PHP version and type. See:

https://www.advsofteng.com/doc/cdphp.htm#phpinstall.htm

If the above still cannot solve the problem, please manually check if the files are in the correct place, and whether the php.ini is correct.

(a) Please open a terminal window or telnet/ssh to your docker machine, and check the directory "/usr/local/lib/php/extensions/no-debug-non-zts-20190902" to see if it contains all the phpchartdir???.dll files and the libchartdir.so, and that they are readable by the web server.

(b) Please example the file "/usr/local/etc/php/php.ini" to confirm the extension statement is in a valid line. Your code currently append the extension statement to the end of the php.ini file. It may or may not work depending on the lines before it. You can consider to put the extension statement at the same place as other extension statements in the php.ini.

(c) You can examine the Apache error log file. If the PHP extension cannot be loaded, there will usually an error message in the log file explain the cause of the problem (eg. insufficient privilege, file not found, etc).

Best Regards
Peter Kwan

  Re:Error Loading ChartDirector for PHP Extension
Posted by Deval on Mar-25-2025 17:35
Hi Peter

Thank you for your response. I am able to load ChartDirector library now.

Well actually I already gone through this link:
https://www.advsofteng.com/doc/cdphp.htm#phpinstall.htm

I also changed this as well:
extension=phpchartdir???.dll

I am not sure what I was doing wrong before. I did all these changes as suggested in previous threads but I believe I was doing something minor mistake here.

For now I am not getting that error. If I will find any trouble in future, I will post it here.


Again thanks for your time and response.

Have a good day!

Deval