Skip to content
New issue

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

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

Already on GitHub? # to your account

Fatal error when you try to install on PHP 8 #349

Closed
adrianolmedo opened this issue Aug 10, 2021 · 4 comments
Closed

Fatal error when you try to install on PHP 8 #349

adrianolmedo opened this issue Aug 10, 2021 · 4 comments
Labels

Comments

@adrianolmedo
Copy link

adrianolmedo commented Aug 10, 2021

Describe the bug
Trying to install Osclass 5.0.0 with PHP 8 I get a Fatal error.

To Reproduce
Steps to reproduce the behavior:

  1. Run Docker environment with PHP 8+Apache+MySQL 8
  2. Click on http://172.17.0.1:5000/
  3. See error:
Fatal error: Uncaught Error: Undefined constant "WEB_PATH" in /var/www/html/oc-includes/osclass/helpers/hDefines.php:48 Stack trace: #0 /var/www/html/oc-includes/osclass/classes/utility/FileSystem.php(640): osc_base_url() #1 /var/www/html/oc-includes/osclass/utils.php(872): mindstellar\utility\FileSystem->getContents('https://raw.git...', NULL, false) #2 /var/www/html/oc-includes/osclass/install.php(66): osc_file_get_contents('https://raw.git...') #3 {main} thrown in /var/www/html/oc-includes/osclass/helpers/hDefines.php on line 48

osclass-v5 0 0-fatal-error

Expected behavior
Get installation page.

@adrianolmedo
Copy link
Author

Well, this bug could be fixed removing osc_ from oc-includes/osclass/install.php#L66:

$jsonLocales = osc_file_get_contents(osc_get_languages_json_url());`

To:

$jsonLocales = file_get_contents(osc_get_languages_json_url());`

@navjottomer
Copy link
Member

I have identified the issue, a fix is ready will upload it asap. The issue is that the function using a constant which is not has been defined. 'file_get_contents' can cause other error as some host disable 'allow_url_fopen'.

@navjottomer
Copy link
Member

Please test the latest release, I have successfully installed it on PHP 8.0 using docker.

@adrianolmedo
Copy link
Author

It works well! good job

navjottomer added a commit that referenced this issue Aug 13, 2021
(cherry picked from commit d91872e)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants