0

Current situation: I have a website that requests data from an external (Raspberry Pi) database via php. When I run the website on my computer (Mac OS) everything works perfectly, data is supplied from the external server and then displayed on the website. However, if I run the website on the Raspberry, I cannot access the external server.

No matter what I do, whenever in the php file the line mysqli_connect($host, $user, $pw, $database); nothing happens afterwards, even if I execute the line in a Try Catch block nothing happens after calling this line. However, if I run the php file on my MacBook, everything works perfectly again. Does anyone have an idea why that is?

n1klas
  • 1
  • 1
  • Yes. Mysqli has an exact idea, why it is. All you need is ask. However, adding a Try Catch block *doesn't make* a programming language to throw an exception. It makes no sense to use this operator in order to get the error message. You need to properly configure mysqli instead. – Your Common Sense Mar 27 '23 at 07:14
  • what did I configure wrong? Everything works perfectly on my MacBook – n1klas Mar 27 '23 at 07:22
  • There is a link pinned at the top of your question that leads to answer that explains - what exactly you need to configure. – Your Common Sense Mar 27 '23 at 07:32

0 Answers0