|
ChartDirector for PHP 7 in ubuntu 16.04 |
Posted by Satyaki on Mar-25-2017 17:53 |
|
Hi All,
We are trying to run ChartDirector on PHP 7.0 in ubuntu 16.04. I'm using non thread-safe PHP. I have paste all files including fonts directory to php extension directory located in /usr/lib/php/20151012/ and updated php.ini file with extension=phpchartdir700.dll located in /etc/php/7.0/apache2/, but still getting error. Any help is appreciated.
I'm getting this error when I' trying to install from phpdemo/index.php
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 user-To-be-filled-by-O-E-M 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64
PHP version : 7.0.15-0ubuntu0.16.04.4
PHP / Web Server interface : apache2handler
PHP configuration file location : "/etc/php/7.0/apache2/php.ini"
PHP extension directory : "/usr/lib/php/20151012"
Thanks,
Satyaki |
Re: ChartDirector for PHP 7 in ubuntu 16.04 |
Posted by Peter Kwan on Mar-27-2017 03:07 |
|
Hi Satyaki,
I have just tried it myself with Ubuntu 16.04, and it works normally in my case.
(a) First, please make sure you have downloaded the "Linux (x86_64)" edition of ChartDirector for PHP (not "Linux (i386/i686)").
(b) Copy everything in "ChartDirector/lib" to "/usr/lib/php/20151012". After the copying, please double check that you have the files "/usr/lib/php/20151012/phpchartdir700.dll" (12840 bytes) and "/usr/lib/php/20151012/libchartdir.so" (4801672 bytes). Make sure the files are "readable" by everyone.
Note that simply dragging and dropping the files using the "File Manager" may not work, as you need to have superuser privilege to copy the files to "/usr/lib/php/20151012". In my case, I use "sudo cp" to copy the files.
(c) Modify "/etc/php/7.0/apache2/php.ini" by adding the line:
extension=phpchartdir700.dll
Also, note that you need superuser privilege to successfully modify "/etc/php/7.0/apache2/php.ini". After modification, it is best to open the file again to check the line "extension=phpchartdir700.dll" is in fact in the "php.ini".
(d) Restart Apache. In my Ubuntu 16.04, the command line is:
sudo service apache2 restart
After the above steps, the ChartDirector works normally in my case.
If the above still cannot solve the problem, is it possible to look at the Apache error log (for Ubuntu 16.04, it is at /var/log/apache2/error.log) to see if there is an error message when the Apache is restarting?
Regards
Peter Kwan |
Re: ChartDirector for PHP 7 in ubuntu 16.04 |
Posted by Satyaki on Mar-28-2017 12:33 |
|
Hi Peter,
Thanks for reply. A permission issue was there in my php extension folder. Everything is fine now. Just help me one more thing, I'm using a shared server with godaddy, do you know anything if godaddy supports custom php.ini or not?
If not, then what should I do? |
Re: ChartDirector for PHP 7 in ubuntu 16.04 |
Posted by Peter Kwan on Mar-28-2017 14:24 |
|
Hi Satyaki,
I searched our previous support record, and find that around 1 year ago, there was a support request in using ChartDirector for PHP with GoDaddy hosting. We investigated, and from online godaddy help pages, we found that GoDaddy support custom php.ini and our customer confirmed that it worked. Below is part of our previous email response with our customer:
=========== Our previous email response ============
For GoDaddy, I searched their web site and find the following page that describes how to use custom PHP configuration file:
https://sg.godaddy.com/help/what-filename-does-my-php-initialization-file-need-to-use-8913
(Note: I found the above page using Google and the pages seem to be from GoDaddy Singapore. I am not sure if it fits your hosting plan. Please contact GoDaddy for more details on how to set up a custom PHP configuration file.)
In the custom PHP configuration file (according to the above page, it can be called “php.ini” or “.user.ini”), you can configure the PHP extension directory to any directory you like. For example:
extension_dir=/home/my_account/public_html/my_web_site/ChartDirector/lib
extension=phpchartdir???.dll
In the above example, I set up the PHP extension directory to be the ChartDirector/lib directory on your web server.
After the change, you may need to restart the PHP process for the modified PHP configuration to take effect. I found a GoDaddy page on how to do this. (Again, I am not sure if this fits your hosting plan.)
https://sg.godaddy.com/help/phpiniuserini-changes-not-taking-effect-5647
=========================================
*** NOTE ***: Because the above is one year ago, and I am not sure which hosting plan you are using or our customer was using, so we are not sure if the above is applicable to you.
There is also an old thread 2 years ago in this forum, which confirmed ChartDirector can work on GoDaddy's host:
http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&pattern=GoDaddy&thread=1437722108#N1438001507
Regards
Peter Kwan |
Re: ChartDirector for PHP 7 in ubuntu 16.04 |
Posted by Satyaki on May-08-2017 14:22 |
|
Hi Peter, I'm working on Bluehost VPS account. I found php.ini but cant able to find where is the extension folder. Can you please help me? |
Re: ChartDirector for PHP 7 in ubuntu 16.04 |
Posted by Peter Kwan on May-08-2017 17:34 |
|
Hi Satyaki,
You can use phpinfo to determine where is your extension folder. Just create a PHP page with one line:
<?php phpinfo(); ?>
then access the above page. It will list out the configuration of your PHP, including where is the extension directory.
If you can control the "php.ini", please examine the "php.ini" and find the "extension_dir" line. This line sets the location of the PHP extension directory. If there is no such line, the PHP is using the "default" PHP extension directory. The default depends on how the PHP is compiled and you would need to use phpinfo to find out the exact directory.
If you are new to PHP configuration, the followings are some points to note:
(a) From the phpinfo, you can determine where is the "php.ini" used by your PHP. There can many multiple "php.ini" in your machine, and the PHP only uses one of them. The phpinfo can be used to determine which one.
(b) From the phpinfo, determine the PHP extension directory, and copy *everything* (including the fonts subdirectory) inside the "ChartDirector/lib" to the PHP extension directory. If you cannot write to the PHP extension directory (due to lack of admin privilege), but you can modify the "php.ini", please modify the "extension_dir" to change the PHP extension directory to a directory under your control.
(c) In some PHP configurations (such as those using FastCGI or Apache PHP modules), you may need to restart the Apache web server for any changes to "php.ini" to take effect. Many hosting companies have a "control panel" that allows you to restart the Apache/PHP so that the "php.ini" can take effect.
Regards
Peter Kwan |
Re: ChartDirector for PHP 7 in ubuntu 16.04 |
Posted by Satyaki on May-08-2017 17:50 |
|
Hi peter,
Yes I tried that approach to copy files to `/opt/cpanel/ea-php56/root/usr/lib64/php/modules' but shows permission denied. Can I paste that files in root folder and write something in php.ini to get that library files? |
Re: ChartDirector for PHP 7 in ubuntu 16.04 |
Posted by Satyaki on May-08-2017 20:18 |
|
Can you help me please which server I should purchase to setup CHartDirector |
Re: ChartDirector for PHP 7 in ubuntu 16.04 |
Posted by Peter Kwan on May-09-2017 01:49 |
|
Hi Satyaki,
If you can modify the "php.ini", you can set the PHP extension directory to any directory you like by using the extension_dir statement. See:
http://php.net/manual/en/ini.core.php#ini.extension-dir
You mentioned about placing the files in the "root folder". I assume you mean the "root" of your web document directory, not the "root" of the file system. (Since you cannot access "/opt/cpanel/ea-php56/root/usr/lib64/php/modules", I think it is unlikely you can access the root of the file system "/".) You can just modify the "extension_dir" to point to the path corresponding to the root of your web documentation directory:
extension_dir = /path/to/root_of_web_document
If you are not sure where is your web document root, please use phpinfo to find out. After changing the extension_dir, please use phpinfo to confirm that it has actually changed. As explained in my previous message, depending on your PHP configuration, sometimes you would need to restart Apache/PHP for the "php.ini" to take effect.
There are probably millions of hosting plans available from thousands of hosting companies, and every company configures their hosting plans differently. Usually, you just read the documentation of your hosting plan to see how to use it. For bluehost, I searched the Internet and found a page about using custom php.ini. I am not sure if it fits your plan.
https://my.bluehost.com/cgi/help/128#new
If you are not familiar with PHP configuration, I can try to set up ChartDirector for you, but you would need to create an account to allow me to login and configure your system. If this is possible, you can email the details to me at pkwan@advsofteng.net
Regards
Peter Kwan |
|