PHP 7 Compatability?

4,347 views
Skip to first unread message

TracerRx

unread,
Oct 25, 2015, 7:37:53 PM10/25/15
to JpGraph
Has anyone tested against PHP 7 yet?

I get: 
JpGraph Error: 13 The installed PHP version (7.0.0RC5) is not compatible with this release of the library. The library requires at least PHP version 5.1.0

Frank Reichel

unread,
Dec 7, 2015, 5:48:35 AM12/7/15
to JpGraph
If you are using version 3.0.7: Locate the file jpgraph.php on your server and load the file in your editor.

Change line 232 from:

    if ($majorC != $majorR) return false;

To:

    if ($majorC > $majorR) return true;

and go!

Disclaimer: Just a quick and dirty hack...
Message has been deleted

Frits

unread,
Dec 8, 2015, 9:11:13 AM12/8/15
to JpGraph
The dirty hack does do the job, but gives me the following notification:

PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; LinePlot has a deprecated constructor in /jpgraph/jpgraph_line.php on line 24
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; GroupBarPlot has a deprecated constructor in /jpgraph/jpgraph_bar.php on line 627

I suppose the notification is likewise using other plots.

Will Asial Corporation ever publish an update of jpgaph that flawlessly supports PHP7 and up ?

Chris Savchick

unread,
Feb 9, 2016, 11:19:42 AM2/9/16
to JpGraph
I asked about support and updates recently, as I am about to recommend purchase for commercial use. I received the below response via email on Feb 3, 2016...

Hello Chirs,

 

Thank you for choosing our JpGraph product.

 

We continue to maintenance and support our JpGraph product.

We are now tying to support for PHP 7.

 

Thank you for your concern.

 

Best regards,

JpGraph support Team

 

 

 

_____________________________________________________________________

Asial Co. Ltd.

201 Spear Street, Suite 1100

San Francisco, CA 94105

_____________________________________________________________________


Philippe PHP

unread,
Mar 4, 2016, 9:39:53 AM3/4/16
to JpGraph
Hi San Francisco,

I'm also interested in the latest version of JPGRAPH library for PHP.
We are currently using PHP 5.x with JPGRAPH version 2.1.3 on a 32 bits windows.
As I am currently upgrading to PHP 7 x64, the constructors won't make it...
My first idea was trying changing all constructors names using  __constructor().
However, might some other deprecated methods are in the numerous files of the library, this won't be worth to start this way.

Do you have a release date for the PHP7 compatible version ?
In between, what would be the best workaround ?
Also, does the latest version  has retro compatibility with v2.1.3 ? will I need to change my PHP code ?

Thanks;

Toma mutemi

unread,
Nov 5, 2017, 5:10:17 AM11/5/17
to JpGraph
dirty hack but worked for me thanks

Claude Deslandes

unread,
Jan 6, 2018, 8:12:27 PM1/6/18
to JpGraph
I use the latest version on Php 7.1.3, everything is working like a charm.

Claude

Ralf Laxina

unread,
Feb 13, 2018, 3:48:59 AM2/13/18
to JpGraph
hi claude,

are you not experiencing issues with jpgraph 4.2.0 specifically in font files?

Claude Deslandes

unread,
Feb 25, 2018, 9:44:11 PM2/25/18
to JpGraph
Good day Ralf,

     No problems with the font files.   I have this directory structure : root://jpgraph/src/fonts and all of my jpgraph are called directly from the jpgraph/src   

     Take a look at your jpg-config.inc.php to see if you would not have to set the value of your TTF_DIR or others.

     Using jpgraph 4.1.0 pro with php 7.1.3

     Claude :-)


Jay Rizzi

unread,
Feb 28, 2018, 8:50:36 AM2/28/18
to JpGraph
claude, do you have the examples loaded on your servr? if so can you check  barformatcallbackex1.php?

my install is working but not putting values at the tops of the bars like previous versions have, just want confirmation if pro is working versus regular

Claude Deslandes

unread,
Mar 14, 2018, 11:44:22 PM3/14/18
to JpGraph
Hello Jay,

   Sorry about the delay... yes, the barformatcallbackex1.php works great with PHP 7.x


Claude :-)


Ralf Laxina

unread,
Mar 18, 2018, 10:22:54 PM3/18/18
to JpGraph
thanks for the response claude.. i'm currently using jpgraph 4.2.0 in php 7.2.0

still having trouble making them work together though hehe..

Claude Deslandes

unread,
Mar 18, 2018, 10:33:35 PM3/18/18
to JpGraph
Hello Ralf,
     I am using Jpgraph-4.1.1-pro, I will try to run the graph under 4.2.
     Claude :-)

Ralf Laxina

unread,
Mar 19, 2018, 9:31:31 PM3/19/18
to JpGraph
hello claude,

i got another error in jpg, i think this is compatibility issue on php 7. please see below

Warning: count(): Parameter must be an array or an object that implements Countable ... src\jpgraph.php on line 1300


I wanna how how the following code is being use. this is where the warning error is pointing.

        $n = count($this->iTables);
        for( $i=0; $i < $n; ++$i ) {
            $csim .= $this->iTables[$i]->GetCSIMareas();
        }

Thanks in advance!
Reply all
Reply to author
Forward
0 new messages