|
Load ChartDirector with php |
Posted by Guy on Jun-09-2010 19:01 |
|
Hi,
i'm trying to use chartDirector on a hosted linux server (i only rent the site space) and i don't have access to /usr/local...
i only have access to the folder where the site is located.
do i have any way of loading the chartDirector module fro mwithin the directory i use for my site?
here is the error displayed when i'm trying to use chartDirector:
Thanks!!
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 "/usr/local/lib/php/".
dl() has been disabled for security reasons
System Information
Operating System : Linux atl1.powermonster.net 2.6.18-164.15.1.el5 #1 SMP Wed Mar 17 11:30:06 EDT 2010 x86_64
PHP version : 5.2.12
PHP / Web Server interface : litespeed
PHP configuration file location : "/usr/local/lsws/lsphp5/lib/php.ini"
PHP extension directory : "/usr/local/lib/php/" |
Re: Load ChartDirector with php |
Posted by Peter Kwan on Jun-10-2010 01:57 |
|
Hi Guy,
See the followign link on how you may configure a private "php.ini" for your account:
http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1247494914#N1247504541
If you can private a guest account to me to allow me to upload files to your web server document and CGI directories, I can try to install ChartDirector for you. You may email the details to me at pkwan@advsofteng.net. From experience, the success rate is very high.
Hope this can help.
Regards
Peter Kwan |
Re: Load ChartDirector with php |
Posted by Guy on Jun-10-2010 22:13 |
|
Hi Peter,
I think cgi is suppoted as the site root directory contains a "cgi-bin" directory.
could you send me instructions explaining how do i change / create an .htaccess file to make my site use an alternative php.ini that i control?
Thanks
if it works, i will need to buy another license...
Guy |
Re: Load ChartDirector with php |
Posted by Peter Kwan on Jun-11-2010 01:29 |
|
Hi Guy,
Because every hosting company configures the Web Server/PHP system differently, there are thousands of possibilities. They are all described in the Web Server/PHP documentation. It is hard for us to list out all the possibilities (we may need to write a book). That's why we do not publlish the steps.
Another complication in your case is that your site is not using Apache, but using litespeed. This may or may not require different configuration. You may need to refer to litespeed documentation for details. (I have never used litespeed before, but if you allow me to upload to your host, I can read the litespeed documentation and try to install for you.)
Anyway, a common method is like this:
(a) Put the following lines in .htaccess to register /cgi-bin/myphp.cgi as the PHP handler. This redirects all .php requests to /cgi-bin/myphp.cgi. This works provided your litespeed server supports the commands in ".htaccess" and these commands are not disabled by your server administration. If this does not work, you may need to refer to the litespeed documentation to see if it uses different commands for redirection. If there is no way to redirect the PHP requests, you may need to access /cgi-bin/myphp.cgi by explicit URL modification (instead of automatic redirection).
AddHandler php-cgi .php
Action php-cgi /cgi-bin/myphp.cgi
*** Note ***: The above assumes your cgi directory is /cgi-bin.
(b) In the /cgi-bin subdirectory, add a file "myphp.cgi" (which should be readable/executable by the web server anonymous user or by anyone), with the lines:
#!/bin/sh
export REDIRECT_STATUS=200
export PHPRC="/full/file/path/to/your/web/directory/ChartDirector/lib"
export SCRIPT_NAME="$REDIRECT_URL"
export SCRIPT_FILENAME="$PATH_TRANSLATED"
/usr/bin/php-cgi
*** Note ***: You would need to replace the "/full/file/path/to/your/web/directory" with the actual file system path of your web directory (you may use phpinfo to find out). Also, the above assumes your CGI PHP is located at "/usr/bin/php-cgi". Every hosting company tends to put CGI PHP in a different location. You would need to seach for the exact location and use it in the myphp.cgi. (If you do not have tools that can browse the server file system, you may write a short PHP program to browse it. The directory that contains PHP is readable by everyone, so you can always browse it.)
(c) Put the "php.ini" in "/full/file/path/to/your/web/directory/ChartDirector/lib". Inside, please add:
extension_dir="/full/file/path/to/your/web/directory/ChartDirector/lib"
extension="phpchartdir520.dll"
*** Note ***: "/full/file/path/to/your/web/directory/ChartDirector/lib" should be the directory that contains the ChartDirector for PHP extension.
(d) At any time, you can use "phpinfo" to check your progress. For example, you can use phpinfo to check if your have really redirected (the Server API should be using CGI instead of litespeed).
Hope this can help.
Regards
Peter Kwan |
|