changed errors to php pages
updated line numbers with magic constants