Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Cannot declare class Error #34

Closed
brmoda opened this issue Nov 3, 2019 · 12 comments
Closed

Fatal error: Cannot declare class Error #34

brmoda opened this issue Nov 3, 2019 · 12 comments
Assignees
Labels
bug Something isn't working panel Issue related to the frontend

Comments

@brmoda
Copy link

brmoda commented Nov 3, 2019

i uploaded the panel in www/PHP folder , and created database "uboat" and imported uboat.sql in it the i surfed :

http://localhost/PHP/

it gives :

Fatal error: Cannot declare class Error, because the name is already in use in C:\wamp64\www\PHP\private\controllers\error.php on line 0

@Souhardya Souhardya added bug Something isn't working help wanted Extra attention is needed labels Nov 3, 2019
@matricali
Copy link
Member

@Souhardya I can review this

@Souhardya
Copy link
Member

@Souhardya I can review this

You are more than welcome to review this :D

@matricali
Copy link
Member

It seems that is an error related to namespaces.
Basically we can't redeclare class "Error" outside a namespace, because PHP starting from version 7 has incorporated a native class "Error"

https://www.php.net/manual/es/class.error.php

My theory is that the panel was designed to run using PHP 5.x

@matricali
Copy link
Member

@Souhardya Are you OK with assign to me all the issues related to the panel? I can be a maintainer of the panel if you agree.

@Souhardya
Copy link
Member

Souhardya commented Nov 5, 2019

Sure @matricali
On a side note would it be better to upgrade and adapt the panel to latest PHP versions ?

@Souhardya
Copy link
Member

@matricali Please share a contact medium so we can talk further

@matricali
Copy link
Member

If I implement the use of Namespaces, the current code will support both PHP 5.x and 7.x
Another approach for this particular issue would be to change the name of the class "Error" to another one. So, we don't need to implement the use of namespaces along then project (Although my recommendation is to use namespace)

@matricali
Copy link
Member

@matricali Please share a contact medium so we can talk further

jorgematricali@gmail.com

@Souhardya
Copy link
Member

@matricali Please share a contact medium so we can talk further

jorgematricali@gmail.com

Please check your mail

@matricali matricali added the panel Issue related to the frontend label Nov 6, 2019
@matricali matricali reopened this Nov 6, 2019
@matricali matricali removed the help wanted Extra attention is needed label Nov 7, 2019
@62019
Copy link

62019 commented Jan 19, 2020

same .

@62019
Copy link

62019 commented Jan 19, 2020

how to resolve guys

@matricali
Copy link
Member

@62019 I've fixed this on https://github.com/matricali/UBoat-Panel
Can you check out this and give us feedback?
Thanks in advance

@matricali matricali changed the title Fatal error Fatal error: Cannot declare class Error Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working panel Issue related to the frontend
Projects
None yet
Development

No branches or pull requests

4 participants