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

Message ListMessage List     Post MessagePost Message

  Error Loading ChartDirector for PHP Extension
Posted by Jian Li on Apr-13-2025 10:06
Hello,
I am installing ChartDirector on my MacBook Sequoia 15.4 with Homebrew installed PHP 8.4.6. I downloaded chardir_php_mac.tar and Unquarantine it following install instruction. Then unzip the file, and add a line to php.ini as extension=/path/ChartDirector/lib/phpchartdir840.dll, restart php. When I use http://localhost/ChartDirector/phpdemo/index.php to check installation, get error like:

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 Jians-MacBook-Pro.local 24.4.0 Darwin Kernel Version 24.4.0: Wed Mar 19 21:16:31 PDT 2025; root:xnu-11417.101.15~1/RELEASE_X86_64 x86_64
PHP version : 8.4.6
PHP / Web Server interface : apache2handler
PHP configuration file location : "/usr/local/etc/php/8.4/php.ini"
PHP extension directory : "/usr/local/lib/php/pecl/20240924"

I checked my extension file as:
$ ls -l  /path/ChartDirector/lib/phpchartdir840.dll
-rwxr-xr-x  1 staff  117896 Dec 13 11:10 /path/ChartDirector/lib/phpchartdir840.dll

Look like everything alright to me and I have no idea what is going on. Please help me to solve this problem.

Any help will be highly appreciated!

Thanks!

Jian Li
April 12, 2025

  Re: Error Loading ChartDirector for PHP Extension
Posted by Peter Kwan on Apr-14-2025 13:25
Hi Jian Li,

According to the error message, you PHP type is "apache2handler". For this type of PHP, after modifying the "php.ini" (at /usr/local/etc/php/8.4/php.ini), it is necessary to restart the Apache web server for the modification to take effect.

If this does not work, please check the Apache error log file. It should contain a line that explains why the "extension=/path/ChartDirector/lib/phpchartdir840.dll" cannot be loaded.

The following are some common reasons:

- The directory /path/ChartDirector/lib/ should contain "phpchartdir840.dll", as well as "libchartdir.so" and some other files. The "phpchartdir840.dll" requires on other files in the ChartDirector/lib folder.

- The directory itself, and all the files inside the directory, should be readable by Apache.  For testing, please ensure the files are readable and executable by "everyone" (use chmod 755 for the files).

- The "phpchartdir.840.dll" is for non-thread safe PHP. Please check if your PHP Is of non-thread-safe type. (use phpinfo to check).

If the above still cannot solve the problem, please try the following method:

(a) Copy everything (all files and the fonts subdirectory) in "ChartDirector/lib" to the PHP extension directory "/usr/local/lib/php/pecl/20240924".

(b) For the extension statement, just specify the filename without the path. (This will default to the PHP extension directory.)

extension=phpchartdir840.dll

The restart Apache.


If all of the above files, would you mind to send the Apache error log file to me (I just need the lines that occur after restarting Apache)? My email address is pkwan@advsofteng.net.

Best Regards
Peter Kwan

  Re: Error Loading ChartDirector for PHP Extension
Posted by Peter Kwan on Apr-16-2025 11:44
Hello Peter Kwan

Thanks for your quickly response to my post. I am sorry to reply late, because do not get time to test everything you suggested. Today I finally get time to figure out the installation problem.

Just like you suggested, after installation, I restart httpd Apache server, then everything works well. The problem solved.

Highly appreciated your help!

The best regard!
Jian Li