容器技术交流

 找回密码
 立即注册
查看: 5910|回复: 12

php如何加载ChartDirector扩展

[复制链接]
发表于 2009-6-4 13:13:44 | 显示全部楼层 |阅读模式
我以前(freebsd7.0)手动安装php时,在 php.ini里可以通过
extension=phpchartdir520mt.dll 加载 ChartDirector
现在用famp ,使用apache做服务器,修改/usr/local/php/lib/php.ini 后
;extension=php_zip.dll
extension=phpchartdir520.dll
并且把扩展文件拷贝到 /usr/local/php/lib/php/extensions/no-debug-zts-20060613/
执行/webserver-restart 也不报错,但是访问画图程序时,总是提示出错。。

我又修改/usr/local/php-fcgi/lib/php.ini  并且把扩展文件拷贝到 /usr/local/php-fcgi/lib/php/extensions/no-debug-zts-20060613/下,
执行/webserver-restart

PHP Warning:  PHP Startup: Unable to load dynamic library './phpchartdir520.dll' - Cannot open "./phpchartdir520.dll" in Unknown on line 0
spawn-fcgi.c.197: child spawned successfully: PID: 987

我下载的ChartDirector是for FreeBSD (AMD64)版的。我的系统是amd64,不知道是不因为famp 兼容i386和amd64导致的?

----------------------------------------------------------------------------------------------------------------

Error Loading ChartDirector for PHP Extension

An attempt has been made to dynamically load ChartDirector, but it was not successful. Please refer to your ChartDirector for PHP documentation or click here for how to resolve the problem.


Error Log

Trying to load "phpchartdir520.dll" from the PHP extension directory "./" (note: directory ambiguous).

dl(): Not supported in multithreaded Web servers - use extension=phpchartdir520.dll in your php.ini

Also trying to load "phpchartdir520.dll" from "/home/ftp/chinadm/wwwroot/lib/chart".

dl(): Not supported in multithreaded Web servers - use /home/ftp/chinadm/wwwroot/lib/chart/phpchartdir520.dll in your php.ini


System Information

  • Operating System : FreeBSD www.ppt8.com 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May 1 07:18:07 UTC 2009 root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
  • PHP version : 5.2.9
  • PHP / Web Server interface : apache2handler
  • PHP configuration file location : "/usr/local/php/lib/php.ini"[/td][/tr]
  • PHP extension directory : "./" (note: directory ambiguous)
----------------------------------------------------------------------------------------------------------------------

说明“这里的dll”文件并不是windows下的dll,只是这样命名而已。
Hi Jonathan,

The "libchartdir.so" is not the PHP extension and cannot be loaded by PHP directly. The ChartDirector for PHP extension is "phpchartdir421.dll". (Don't worry about the ".dll" extension. It is a Linux extension, and can be loaded by PHP on Linux normally. It is called ".dll" so that we can use the same ChartDirector code in both Linux and Windows.)

You may refer to the installation section of the ChartDirector documentation for detail steps. In many case, you do not need to install ChartDirector in "php.ini" at all. ChartDirector will attempt to dynamically load itself (unless your PHP is in safe mode or is configured to disable dynamic extension loading). If you want to install it in "php.ini", copy "everything" in "ChartDirector\lib" to your PHP extension directory (not just the .so file, but *everything* and including the fonts subdirectory). Then use "extension=phpchartdir421.dll".

Hope this can help.

Regards
Peter Kwan

[ 本帖最后由 sosofun 于 2009-6-4 13:40 编辑 ]
发表于 2009-6-4 14:30:00 | 显示全部楼层
php 一些扩展没有的。怎么加。。老大能出个教程不、?
发表于 2009-6-4 14:30:10 | 显示全部楼层
php 一些扩展没有的。怎么加。。老大能出个教程不、?
发表于 2009-6-4 14:30:19 | 显示全部楼层
php 一些扩展没有的。怎么加。。老大能出个教程不、?
发表于 2009-6-4 14:30:27 | 显示全部楼层
php 一些扩展没有的。怎么加。。老大能出个教程不、?
发表于 2009-6-4 14:32:12 | 显示全部楼层
论坛也出问题了。。我只发了一个帖子。。。竟然出了这么多。。。!
发表于 2009-6-4 14:32:37 | 显示全部楼层
论坛也出问题了。。我只发了一个帖子。。。竟然出了这么多。。。!
发表于 2009-6-4 14:32:54 | 显示全部楼层
论坛也出问题了。。我只发了一个帖子。。。竟然出了这么多。。。!
发表于 2009-6-4 14:33:47 | 显示全部楼层
是不是真的出问题了。。。
发表于 2009-6-4 16:35:51 | 显示全部楼层
看一下,是不是你的电脑的问题。
发表于 2009-6-4 16:36:45 | 显示全部楼层
extension=phpchartdir520mt.dll 这个文件是不是windows的。*.dll文件是windows 特有的,所有,你文件加错了。
 楼主| 发表于 2009-6-4 22:37:46 | 显示全部楼层
说明“这里的dll”文件并不是windows下的dll,只是这样命名而已。
这是官方的解答说明:

The "libchartdir.so" is not the PHP extension and cannot be loaded by PHP directly. The ChartDirector for PHP extension is "phpchartdir421.dll". (Don't worry about the ".dll" extension. It is a Linux extension, and can be loaded by PHP on Linux normally. It is called ".dll" so that we can use the same ChartDirector code in both Linux and Windows.)
 楼主| 发表于 2009-6-5 00:07:44 | 显示全部楼层
最终解决了。方法是这样的:
修改/usr/local/php/lib/php.ini

extension_dir = "./"  为  extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20060613"
增加 extension=phpchartdir520mt.dll

将ChartDirector lib文件拷贝到 /usr/local/php/lib/php/extensions/no-debug-zts-20060613
重启 /apache-restart



configure: error: Cannot find php-config. Please use --with-php-config=PATH
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|URLOS ( 粤ICP备18087780号 )

GMT+8, 2024-5-15 21:58 , Processed in 0.033396 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表