在页面上显示php错误

时间:2018-03-17 10:50:34

标签: php

我有一个名为func fetchArrayOfUsersBlockingTheCurrentUser() { guard let uid = Auth.auth().currentUser?.uid else { return } let db = Firestore.firestore() let docRef = db.collection("Users").document(uid).collection("Users Blocking Me") docRef.getDocuments() { (querySnapshot, err) in if let err = err { print("Error getting documents: \(err)") } else { for document in querySnapshot!.documents { let d = document.documentID self.UsersBlockingCurrentUserArray.append(d) } } } fireStoreFetchUsers() } var UsersBlockingCurrentUserArray = [String]() var users = [User2]() 的页面,想要在表格中显示所有error.php个错误,每个错误都在一行中。确切地显示在root中的error.log文件中。

我用过这个:

php

它可以在打开页面时显示浏览器中的所有错误,但我想要的是以列表格式显示网页上发生的所有错误。

我找不到error_reporting(E_ALL & ~E_NOTICE); 页面中所有错误的方法,并决定从echo文件中获取所有错误:

error.log

但很难修改数据以便正确显示,有没有正确的方法呢?

1 个答案:

答案 0 :(得分:1)

These can help you:

You may use those functions to send errors data to some file, a database, a log service, etc. and retrieve them when requested.

Of course, if there's some fatal error before calling those function, they won't be invoked an the errors won't be registered using your implementation.

Notice also that there's a php.ini directive error_log. You may use ini_get('error_log'), open the file content (if there's any) and parse the content.