Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change/hide server directory name?

I have question. I have some app on facebook and getting this error

Fatal error: Uncaught OAuthException: An active access token must be used to query 
             information about the current user. thrown in 
             /home/xxx/public_html/domain/lib/base_facebook.php on line 1024

but no matter at this time.. the matter is that, is it possible to change/hide this "xxx" name? you understand? for example, instead this I would have /public_html/domain/... OR completely hide the path ??

thanks in advance =)

like image 695
Indy Avatar asked Feb 21 '23 04:02

Indy


2 Answers

The recommended action would be to disable the public display of all PHP errors when you are in production mode.

To do that, edit your php.ini file and set display_errors to 0. You can still set the error_reporting level to something suitable and all errors will be logged to the error_log file, but the actual errors themselves are not visible to the end user.

Otherwise, there is no way to modify PHP's built in error messages to hide the path. Doing so would render the error message much less helpful.

See display_errors and error_reporting PHP directives.

EDIT: In the case of the exact error message in your question, you could handle the error (try/catch) and then display a more friendly error that helps you but also doesn't expose your path. The reason it is displaying like that is because an exception that was thrown was uncaught.

like image 59
drew010 Avatar answered Feb 23 '23 00:02

drew010


No. If you don't want the complete debug backtrace in case of an uncaught exception, you'll need to catch it every time. There are no shortcuts here.

like image 22
Madara's Ghost Avatar answered Feb 22 '23 23:02

Madara's Ghost