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

Message ListMessage List     Post MessagePost Message

  setup issues / questions
Posted by rodger on Oct-14-2014 14:09
I am on a shared server, and no access to php.ini... No options to backtrack to pre 5.2.4
as the earliest my host has is 5.2.17...

I can create a .user.ini (Site5.com) - but not sure how this helps, if at all...

I tried the PGP CGI option - but I think I just did not do something right... Is there some
set of simple files that might help set this option up?

Thanks!
Rodger

  Re: setup issues / questions
Posted by rodger on Oct-14-2014 14:12
Sorry, forgot the error message (I am sure you have seen this a few times before)...

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

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 xxxxxxxxxxxxxxxx.com 3.2.51-grsec.39.el5 #1 SMP Fri May 16
14:24:08 EDT 2014 x86_64
PHP version : 5.3.28
PHP / Web Server interface : cgi-fcgi
PHP configuration file location : "/usr/local/lib/php.ini"
PHP extension directory : "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"

  Re: setup issues / questions
Posted by Peter Kwan on Oct-14-2014 20:48
Hi rodger,

If your hosting company supports custom php.ini (the actual file can be called other name, and .user.ini is possible), you should be able to use this file as the PHP configuration file.

First, please use phpinfo to determine which file system directory your web directory root  are in. Then put the following lines in .user.ini:

extension_dir=/path/to/your/webdirectory/ChartDirector/lib
extension=phpchartdir530.dll

In the above, please change /path/to/your/webdirectory/ChartDirector/lib to the actual directory that contains the ChartDirector PHP extension. The extension above assumes you are using PHP 5.3.x. Also, from your message, it seems your Linux is of type x86_64, so make sure you are using ChartDirector for PHP for Linux (x86_64).

You can then try the ChartDirector sample code. If it still does not work, please use phpinfo to check if your .user.ini is actually being used (for example, Does the extension_dir really change to the directory that you specified?)


In the past, PHP ca load extensions from any directory. Since PHP 5.2.5, PHP can only load extensions from the PHP extension directory configured in php.ini. This causes issues in many scripts. To address these issues, many hosting companies began to support custom "php.ini", and this has become quite common nowadays. As a result, the CGI method is must less often used nowadays. If in your case you need to use the CGI method, you may refer to the followings thread for some more details:

http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1276081280#N1276179191

If you can provide me with a guest account so that I can upload files to your web site, I can try to install ChartDirector for you. My email is pkwan@advsofteng.net

Regards
Peter Kwan

  Re: setup issues / questions
Posted by Rodger on Oct-15-2014 07:33
No luck. The phpinfo updated, however the error still shows pointing to the other
location. Not sure why this is the case... If you do not see something simple (why would
the two locations be different) I might take you up on your offer...

/home/xxxxxxx/public_html/php.ini
extension_dir=/home/xxxxxxx/public_html/id_charting/ChartDirector/lib
extension=phpchartdir530.dll

phpinfo() reports:
extension_dir: /home/xxxxxxx/public_html/id_charting/ChartDirector/lib

The test file reports the same error as before:

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 arden.accountservergroup.com 3.2.51-grsec.39.el5 #1 SMP
Fri May 16 14:24:08 EDT 2014 x86_64
PHP version : 5.3.28
PHP / Web Server interface : cgi-fcgi
PHP configuration file location : "/usr/local/lib/php.ini"
PHP extension directory : "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"

  Re: setup issues / questions
Posted by Peter Kwan on Oct-15-2014 16:03
Hi Rodger,

If you web site is accessible from the Internet, is it possible to provide me with the URL of
the phpinfo your web site? You may email me at pkwan@advsofteng.net. I will try to study
the phpinfo in more details to see if I can find any clue.

Regards
Peter Kwan

  Re: setup issues / questions
Posted by Peter Kwan on Oct-15-2014 16:05
Hi Rodger,

I am thinking, is it possible the custom "php.ini" only works on the directory that contains
the "php.ini". So if your "php.ini" is in your web document root, it only applies to the web
document root, but not to the ChartDirector sample code subdirectory. That may explain
why the PHP extension directory is reported differently by ChartDirector.

Regards
Peter Kwan

  Re: setup issues / questions
Posted by Rodger on Oct-15-2014 16:48
You nailed that one... :-) Needed to be in the same folder as the demo files, and they all
worked great...

Now I am having an issue with running files live. I am using the source code (copy/paste)
and also changing the reference to the include file, so it points correctly, but I only get a
broken image in the upper corner...

I have some text on the top of the file (above the <?php) and that test does not show up.
So I think is did not like something...

Have you ever run this inside of WordPress? This is what I am attempting to do right
now...

  Re: setup issues / questions
Posted by Rodger on Oct-15-2014 17:43
Really odd... Can not find it, but can open it...

Just a broken image when I run actual chart code. When I copied the cdinfo.php this was
the output...

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

Description : ChartDirector
Version : 5.1.1
Copyright : Copyright (c) 2012 Advanced Software Engineering Limited
Boot Log :
2014-10-15 04:34:49> Cannot load license file /usr/lib/ChartDirector/chartdir.lic ? No
such file or directory [error code = 2]
2014-10-15 04:34:49> Cannot load license file
/home/xxxxxxxxx/public_html/id_charting/ChartDirector/lib/chartdir.lic ? No such file or
directory [error code = 2]
Updated license check at 2014-10-15 04:35:42> Cannot load license file
/home/xxxxxxxxx/public_html/id_charting/ChartDirector/lib/chartdir.lic ? No such file or
directory [error code = 2]
Font Loading Test :
Searching for arial.ttf ? No such file or directory [err code = 2]
Searching for /home/xxxxxxxxx/public_html/id_charting/ChartDirector/lib/fonts/arial.ttf ?
No such file or directory [err code = 2]
Searching for helvR10.pcf ? No such file or directory [err code = 2]
Successfully opened
/home/xxxxxxxxx/public_html/id_charting/ChartDirector/lib/fonts/helvR10.pcf

  Re: setup issues / questions
Posted by Peter Kwan on Oct-16-2014 00:09
Hi Rodger,

Are you trying to directly put an image in a HTML web page?

As according to the HTML and HTTP standard, a HTML web page cannot directly include any image. Normally, you can only put <IMG> tags in the web page. The image needs to be a separate file or a separate HTTP connection.

Similarly, you cannot put HTML in an image. For example, if you open Photoshop or Windows Paint to edit an image, there is no mechanism for you to insert HTML in the image.

If your PHP script is delivery a chart, then it is an image. You cannot put this script inside another script that produces HTML, or vice versa, as this violates the HTML and HTTP standard.

You mentioned you have some text before "<?php". In a PHP script, everything that is not included in "<?php .... ?>" is considered as HTML. If your script is outputting a chart image, then it is equivalent to mixing HTML with an image, which is illegal.

I have not use WordPress before, but I think you can indirectly include a chart image to the web page using the same method as including any other image - that is - to use an <IMG> tag. For example:

<!-- code to include a bar chart in WordPress -->
<IMG SRC="simplebar.php">

If the above still does not solve the problem, please obtain the error message inside the broken image and inform me what is the result. See:

http://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_faq&thread=1117817200

Regards
Petere Kwan

  Re: setup issues / questions
Posted by Rodger on Oct-16-2014 05:54
Yeah, that was it. In the file I created I did not think about the text - and that was the
breaker... Good call. I was so tired I would have never caught it.

I see that when I try to right click and save a chart it does not work. Saving just opens a
save as dialog with the php file name. I am assuming that I just need to check the docs to
see how to change this result...

I appreciate your help. Without it, I would have given up on it and just stayed with
highcharts... Really looking to get to something that I can use dynamically as an image a
bit easier...

  Re: setup issues / questions
Posted by Peter Kwan on Oct-16-2014 19:51
Hi Rodger,

The filename is not related to ChartDirector. If your code does not inform the browser the
filename to use, the browser is free to choose any filename it likes. For example, if the chart
image is a PNG image produced by the script "simplebar.php", IE may choose the filename
"simplebar.png", while Chrome may choose the filename "simplebar.php".

If you do not want the browser to choose the filename, you can use use the content
deposition header to specify the filename. For example:

header("Content-Disposition: inline; filename=abc.png")

Hope this can help.

Regards
Peter Kwan