0

I have an android app that communicates with a php script that do some database operations.My problem is that i need to prevent the server from echoing to the app any server errors or warnings.I know there will be security issues if someone see any sensitive data in those errors.I tried a lot of things wrote in some posts like turn off error display in php.ini,error_reporting(0),ini_set("display_errors", 0) and ini_set("log_errors", 1)`.I triger some errors and i keep getting something like "received
Parse error: syntax error, unexpected ......in line...".

I don't know if I miss something.I am new to php and serverside things so if its something stupid forgive me.

I must say again that i dont need a solution for the errors....because i trigger them on purpose.I only need to prevent someone that use my application to see sensitive data from errors that may occure.

Konstantinos.T
  • 93
  • 1
  • 11
  • 2
    you should not aim to hide the errors you get, use them to make the code work! – Jeff Jan 07 '16 at 17:08
  • I definitley agree with @Jeff – B001ᛦ Jan 07 '16 at 17:20
  • If your PHP server is on a shared hosting service such as GoDaddy then you might not have the permissions to change various `ini_set()` parameters. Hiding these errors should only be done on a production server and ALL OF THEM SHOULD BE LOGGED. On a dev box, do whatever floats your boat. – MonkeyZeus Jan 07 '16 at 17:22
  • u missunderstand me there....i dont want a solution to hide some errors...I just think of the security of my application and I trigger some random errors.I dont want the user to see any sensitive data from any random error that may occure so I try to prevent the server from sending errors on my app.Is there any way? – Konstantinos.T Jan 07 '16 at 17:25
  • I do understand you, you don't understand me. If your server is not obeying `ini_set("display_errors", 0);` then that means you do not have sufficient privileges and you will need to use a different hosting provider. – MonkeyZeus Jan 07 '16 at 17:34
  • yes sorry monkeyzeus i were already typing for the other commends...i just use an apache localhost untill now...I am still testing my app. – Konstantinos.T Jan 07 '16 at 17:41

0 Answers0