[SOLVED] PHPDashboard Example not working

I get getting the following error when i am opening the index.php file from the library provided by @harrisonhjones .How to solve this problem? I am running the file on WAMP server.
I am new to PHP so kindly bare with me

This is the link of the GitHub

Hi! Thanks for trying out my dashboard. Let’s see if I can help.

If I upload the repo to my server and open I get Unable to load phpSpark class. If I upload the phpSpark class I get the index page (as expected). So I think the issue is with your server config (though probably with my code but it doesn’t appear with my particular server config).

Let’s try this:

  1. Open up index.php
  2. Locate if($_SESSION['accessToken']) and change it to if(isset($_SESSION['accessToken']))
  3. Save and open the page again.

Note, in the future, I would suggest you open up an issue on the GitHub repo (see https://github.com/harrisonhjones/phpSparkDashboard/issues) instead of posting to the Particle community forums.

[Edit] Unfortunately the phpDashboard expects an older version of phpSpark.class.php than what’s currently on the main repo. See https://gist.github.com/harrisonhjones/c9f612457000f3abccb6. We are working on making phpSpark a package so this isn’t so hard for newcomers like yourself.

1 Like

Hi @harrisonhjones
I uploaded the phpSpark Class in my project directory and also changed if(_SESSION['accessToken']) to if(isset(_SESSION[‘accessToken’])) in index.php file but i am getting a blank page.
What would be the problem?
Kindly bare with me as am complete beginner in PHP
Thanks

At the top of the index.php file (inside the <?php part) add

ini_set("display_errors", 1);
ini_set("track_errors", 1);
ini_set("html_errors", 1);
error_reporting(E_ALL);

And report back, that should push all the errors to the browser. (make sure, if it displays anything sensitive, you obscure it)

Hi,
The Problem is solved,Problem was with the server.It is not Running on WAMP server but is running perfectly on MAMP server.
Thanks for your support.You have done a Great Work :smile:

I’d love to know why. Perhaps you could post the issue you found as a GitHub issue? Thanks!

Hey @UmangChheda,

The problem when using wamp is that shorthand tags are off by default.

Ive sent a pull request for @harrisonhjones to add the fix

1 Like

PR pulled. Thanks @Devin

No problem