0

I'm hoping someone can help me here. I'm using simple html dom to get some data from a website and everything works fine on my local PC, but i get the 500 internal server error in the console when I uploaded to the ibm bluemix. I have tried tried to add the solution here

Simple html dom file_get_html not working - is there any workaround?

It doesn't work...like I said it works fine on my localhost. With same database connection and everything

Community
  • 1
  • 1
Lateefah
  • 565
  • 1
  • 5
  • 13
  • Go run 'cf logs and let's us know what you find. You can't solve a problem if you don't know what the problem is. – jpapejr Aug 22 '15 at 01:54
  • Can you please post some more information about what you are trying to do? As is the question is not a programming question. Stackoverflow is a community on asking programming questions and showing what you have tried to get help. – Jeff Sloyer Aug 25 '15 at 13:18
  • Thanks Jeff Sloyer, what i finally did won't probably make sense to you but it works now. I tried the cf logs as suggested by jpapejr and got no error. The page just returns blank page, so i started debbuggiing bit by bit, it was a php error after all, i set an array $publications = []; and bluemix didn't like so i used unset($publications) instead and it worked. – Lateefah Aug 25 '15 at 20:22

1 Answers1

0

getting what you described in your comment,

$publications = [];

is not the right sintax for empty/reset a PHP array and this is the reason for having error 500.

The right PHP way to do it is

$publications = array();

You can use also

$publications = null; 

but you then have to check if null when using it again or

unset($publications);

like you have already done, but keep in mind that it destroys the var so you have to initialize it again later.

v.bontempi
  • 1,562
  • 1
  • 9
  • 10
  • Yeah i figured. Somehow it works on my localhost. I'm going with $publications = array() now. Cheers – Lateefah Aug 26 '15 at 20:11