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

PHP Error log not available. #1770

Closed
7 tasks done
odiea opened this issue Jan 3, 2018 · 33 comments
Closed
7 tasks done

PHP Error log not available. #1770

odiea opened this issue Jan 3, 2018 · 33 comments
Assignees
Labels

Comments

@odiea
Copy link
Collaborator

odiea commented Jan 3, 2018

Background information

IMPORTANT: If you choose to ignore this issue report template, your issue will be closed as we cannot help without the requested information.

Please make sure you tick (add an x between the square brackets with no spaces) the following check boxes:

  • Reporting an issue of an unmodified OSPOS installation
  • Checked open and closed issues and no similar issue was already reported (please make sure you searched!)
  • Read README, WHATS_NEW and UPGRADE
  • Read the FAQ for any known install and/or upgrade gotchas (in specific PHP extensions installed)
  • Read the wiki
  • Executed any database upgrade scripts if an upgrade pre 3.0.0 (e.g. database/2.4_to_3.0.sql)
  • Aware the installation code is in bintray (see README), and GitHub master is for developers only and therefore not complete nor stable

Installation information

  • OSPOS version is:3.2.0
  • OSPOS git commit hash is:
  • PHP version is: (e.g. 5.5, 5.6, 7.0, 7.1) 7
  • MySQL or MariaDB version is: (e.g. MySQL 5.5, MySQL 5.6, MySQL 5.7, MariaDB 10.0, MariaDB 10.1, MariaDB 10.2) MariaDB
  • OS and version is: (e.g. CentOS 6.9, Ubuntu 16.4, Windows 10) Windows 10
  • WebServer is: (e.g. Apache 2.2, Apache 2.4, Nginx 1.12, Nginx 1.13)
  • (If applicable) Docker installation:
  • (If applicable) Installation package for the LAMP/LEMP stack is: (e.g. WAMP, XAMPP) XAMPP

Issue / Question

If at login time you read "The installation is not correct, check your php.ini file.", please check the error_log in public folder to understand what's wrong. Any PHP extension related issue is due to one of the point below.

I cannot find any error log in the public folder nor can I see any error logs in the application/logs folder.

@mckaygerhard

This comment was marked as abuse.

@SteveIreland
Copy link
Collaborator

SteveIreland commented Jan 3, 2018

I think everyone sees it .... but everyone's target platform architecture can be different.

So the best that can be recommended is to refer to your platform's documentation as to how to achieve this or that.

When I develop on my laptop the error log is under my wamp logs folder. I doubt that knowledge would be helpful to you (unless you are running under the wamp platform which isn't very likely).

When I installed the first time I was a bit confused by the architecture because I had never installed anything before where the library folders weren't dropped into the public root folder. But the intent of OSPOS (justifiably so for improved security) is that the library folders are dropped a level higher. In that way I don't have to play any games with the rewrite. You aren't forced to do that but that is where you would need to play games with the rewrite. I installed it that way once but it took 2 or 3 retries to get the rewrite changes correct (plus I wanted it running under a virtual subdomain which added a bit more complexity to the goal).

I think the message is probably true for the configuration of the original developer so it should be corrected to be less specific.

@odiea
Copy link
Collaborator Author

odiea commented Jan 3, 2018

I assumed that when it states that it is written to the OSPOS public folder that it would be there. I have a couple Ubuntu servers and can not locate it there either.

@SteveIreland
Copy link
Collaborator

If it says it should be there then I would assume it would be there too.

I think in most cases the person doing the installation can configure the error log to be dropped anywhere on the system. On a hosted site I think it is usually in the folder just above the public folder but I'm sure that is dependent on the preference of the hosting services.

A public folder is a terrible place for an error log (for reasons of security).

@mckaygerhard

This comment was marked as abuse.

@daN4cat
Copy link
Collaborator

daN4cat commented Jan 3, 2018

error_log under opensourcepos/public folder. It's a PHP thing, please make sure you have not disabled it at PHP configuration level.

@SteveIreland
Copy link
Collaborator

Really? Let me be very clear. Bad attitude gets zip, zero, nada free support from me.

@daN4cat daN4cat mentioned this issue Jan 3, 2018
7 tasks
@daN4cat
Copy link
Collaborator

daN4cat commented Jan 3, 2018

BTW .htaccess (that useless thing full of stuff...) protects error_log:

  # prevent access to PHP error log
  <Files error_log>
    Require all denied
  </Files>

and this even prevents somebody to see if it's there:

# prevent folder listing
IndexIgnore *

haaaa useless stuff all hardcoded

@mckaygerhard

This comment was marked as abuse.

@aamiritsu
Copy link

Hi Guys,
First of all thank you very much for keeping this product as opensource.
However, like always, opensource comes with a price. (Which i am paying everyday since last 3 days, in terms of time).

i am trying hard to install it in XAMPP on my local machine but every time i get same creepy error. i.e.
"The installation is not correct, please check your php.ini"

When i dig deep further, i've realised that it requires some php extension, which apparently i've installed all but not "mcrypt". Since my php version is 7.2 and PHP has removed this extension decade ago :(

I expect this is the only reason i am not able to log-in. (fingers crossed). My concern is if this extension is dead long ago, why are we still using it in this application?

in last, i would humbly request, if one of the moderators be kind enough to write step by step guide for development. So that upcoming guys do not suffer from this nasty error.

i apologize for my harsh language,if it hurt anybody out there!

Looking forward hearing from you soon!
BR,
Amir

@mckaygerhard

This comment was marked as abuse.

@aamiritsu
Copy link

@mckaygerhard : Thank you for your prompt response. i am still concerned is there any compatible xampp version using which i can be able to run it locally?

@mckaygerhard

This comment was marked as abuse.

@daN4cat
Copy link
Collaborator

daN4cat commented Jan 3, 2018

@aamiritsu Yes, probably PHP 7.2 is not supported due to that issue.
The replacement of mcrypt is something that needs to be investigated, I cannot remember now from the top of my head if it's CodeIgniter that requires it, but I will open an issue.
So for the time being please fallback to PHP 7.1 which works fine.

@daN4cat
Copy link
Collaborator

daN4cat commented Jan 3, 2018

WRT XAMPP that has been discussed again and again, but the point is that I don't use windows and use Ubuntu for development and CentOS for deployment.
My time is limited and I cannot test (nor I'm willing to) all the platform combinations of this world. OpenSource is about community that takes share in the work and contributes in a form or another solving issue not creating one after another.... and wait or whinge

@daN4cat
Copy link
Collaborator

daN4cat commented Jan 3, 2018

OK, I read the following: https://www.codeigniter.com/user_guide/libraries/encryption.html
Please make sure OpenSSL is installed and I will remove now the check for mcrypt that is causing the check php.ini issue since it's deprecated.

@aamiritsu
Copy link

@daN4cat: I appreciate your feedback. I did not mean to hurt you / any of contributors.
Thanks!

@daN4cat
Copy link
Collaborator

daN4cat commented Jan 3, 2018

@aamiritsu no it's not you, don't worry. And actually thank you for the hint because I missed this point in PHP7.2. So it's now fixed and in master as 3.2.0. (Since bintray seems broken, you can take the full installation from my GitHub: https://github.com/daN4cat/opensourcepos)

@daN4cat
Copy link
Collaborator

daN4cat commented Jan 3, 2018

BTW...

@mckaygerhard you must clarify this statement now PLEASE BICHT! be clear! What did you mean with that part in capital letters?

@mckaygerhard

This comment was marked as abuse.

@daN4cat
Copy link
Collaborator

daN4cat commented Jan 3, 2018

@mckaygerhard to be clear the "hardcoded" expression didn't go down well, so please refrain from expressing similar things and control your language and manners!

@SteveIreland
Copy link
Collaborator

SteveIreland commented Jan 4, 2018

@odiea You are probably already aware of these, but I thought I'd mention it here since it seems relevant.

In my php.ini file there is a directive setting shown below that establishes where the php error log will be found. I think this is the error log being referred to in the issue. This explains why this particular error log isn't found in the public folder (in my environment).

error_log ="c:/wamp64/logs/php_error.log"

Under httpd.config I can find the directives for two more logs which have been less useful to me but were helpful in debugging my url rewrite changes.

ErrorLog "${INSTALL_DIR}/logs/apache_error.log"
CustomLog "${INSTALL_DIR}/logs/access.log" common

In config.php we can also set where database logging takes place. Leaving it blank will default the location to .../application/logs. It also needs to be enabled before any logging actually takes place. I used this quite a bit in my first explorations in order to understand the database.

$config['log_path'] = ''; 

@daN4cat
Copy link
Collaborator

daN4cat commented Jan 4, 2018

Thanks @SteveIreland I'll copy and paste it in the FAQ so we have a clear explanation. Or maybe create a wiki page and I reference it from FAQ. That would be even better.

@SteveIreland
Copy link
Collaborator

I'l create a wiki page on the subject of logging (I've been wanting to explore this further anyway) and flesh it out a bit further.

@opensourcepos opensourcepos deleted a comment from mckaygerhard Jan 4, 2018
@daN4cat

This comment has been minimized.

@mckaygerhard

This comment has been minimized.

@odiea

This comment has been minimized.

@mckaygerhard

This comment has been minimized.

@odiea

This comment has been minimized.

@mckaygerhard

This comment has been minimized.

@SpookedByRoaches
Copy link
Contributor

I know this issue is old but I had the same problem and I fixed it by
chown daemon:daemon application/logs

Although I should note that the user name for whatever LAMP/LEMP stack you're using might be different, so do a exec("whoami") in the server side source code somewhere, then replace "daemon" with that process name.

P.S. I never had an issue with logging on my windows configuration so permission probably does not apply there, but good luck!

Installation information

  • OSPOS version is: 3..3.5
  • OSPOS git commit hash is:
  • PHP version is: 7.2
  • MySQL or MariaDB version is: Ver 15.1 Distrib 10.4.21-MariaDB, for Linux (x86_64)
  • OS and version is: Ubuntu 21.04
  • WebServer is: Apache 2.4
  • Installation package for the LAMP/LEMP stack is: XAMPP

@odiea
Copy link
Collaborator Author

odiea commented Oct 19, 2021

Thanks for the late reply. My issue was not enabling error reporting in the config file. After that all went well.

@SpookedByRoaches
Copy link
Contributor

No problem, this is just for whoever might be having the same issue to try this solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants