|
Error Loading ChartDirector for PHP Extension: On Macbook M1 running MAMP |
Posted by william on Feb-16-2025 03:32 |
|
Hello, I'm trying to install ChartDirector on a MacBook M1, But I'm getting an error loading the PHP extention. Any help would be much appreciated.
I am using MAMP with PHP 8.3.14
I've added a line to php.ini for PHP 8.3.14
extension=/Applications/MAMP/htdocs/ChartDirector/lib/phpchartdir830.dll
But I get error as shown below.
1) When I go here:
http://localhost:8888/ChartDirector/phpdemo/index.php
And select any chart I get this error on the page:
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 : Darwin MacBook-Air.broadband 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:38 PDT 2021; root:xnu-7195.141.8~1/RELEASE_ARM64_T8101 arm64
* PHP version : 8.3.14
* PHP / Web Server interface : cgi-fcgi
* PHP configuration file location : "/Applications/MAMP/bin/php/php8.3.14/conf/php.ini"
* PHP extension directory : "/Applications/MAMP/bin/php/php8.3.14/lib/php/extensions/no-debug-non-zts-20230831/"
===
the file does exist in the path I am using:
$ ls /Applications/MAMP/htdocs/ChartDirector/lib/phpchartdir830.dll
/Applications/MAMP/htdocs/ChartDirector/lib/phpchartdir830.dll
I tried copying the dll files to the extension directory listed above (/Applications/MAMP/bin/php/php8.3.14/lib/php/extensions/no-debug-non-zts-20230831/) but that made no difference. Files in that dir seem to be expected to have suffix ".so"
2) PHP Error log shows this:
PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/MAMP/htdocs/ChartDirector/lib/phpchartdir830.dll' (tried: /Applications/MAMP/htdocs/ChartDirector/lib/phpchartdir830.dll (dlopen(/Applications/MAMP/htdocs/ChartDirector/lib/phpchartdir830.dll, 9): no suitable image found. Did find:
/Applications/MAMP/htdocs/ChartDirector/lib/phpchartdir830.dll: code signature in (/Applications/MAMP/htdocs/ChartDirector/lib/phpchartdir830.dll) not valid for use in process using Library Validation: library load disallowed by system policy), /Applications/MAMP/bin/php/php8.3.14/lib/php/extensions/no-debug-non-zts-20230831///Applications/MAMP/htdocs/ChartDirector/lib/phpchartdir830.dll.so (dlopen(/Applications/MAMP/bin/php/php8.3.14/lib/php/extensions/no-debug-non-zts-20230831///Applications/MAMP/htdocs/ChartDirector/lib/phpchartdir830.dll.so, 9): image not found)) in Unknown on line 0
===
Kind regards
William |
Re: Error Loading ChartDirector for PHP Extension: On Macbook M1 running MAMP |
Posted by Peter Kwan on Feb-16-2025 12:09 |
|
Hi William,
Have you unquarantined the downloaded "chartdir_php_mac.tar.gz" before extracting its content out?
In the ChartDirector download page for macOS, there is a note that the downloaded file must be unquarantined first, with a link to the following page:
https://www.advsofteng.com/macos_unquarantine.html
Modern versions of macOS will mark all shared objects/dynamic library downloaded by a browser as quarantined. Any attempt to use the quarantined object will produce an error message like "not valid for use in process using Library Validation: library load disallowed by system policy". To solve the problem, you can unquarantine it using the method in the link above.
If the file is quarantined, when you use "ls -l *.dll" to display the file, the file attributes will contain a "@" character, like "-rw-r--r--@". If you use xattr to display the extended attributes, you can see it is quarantined. Using "xattr -c" to clear the extended attributes will unquarantine the file.
It is suggested you unquarantine the downloaded "tar.gz", which should unquarantine all the files inside. ChartDirector needs at least two files "phpchartdir???.dll" and "libchartdir.so". Only "phpchartdir???.dll" needs to be in the extension statement. The "libchartdir.so" is a dependency of "phpchartdir???.dll".
Best Regards
Peter Kwan |
Re: Error Loading ChartDirector for PHP Extension: On Macbook M1 running MAMP |
Posted by william on Feb-16-2025 16:01 |
|
Hi Peter, many thanks for that. :-) In my excitement I forgot about the instructions to unquarantine the download (even though the instructions clearly says to do that).... Sorry about that....
Installation is fine now, so many thanks for your help and your patience.
Kind regards,
William |
|