lando / lando/php

How to access PHP error logs?

Open
#5 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

v4
Dominant language
Dockerfile
Stars
20
Forks
18
PR merge metrics
No merged PRs in 30d

Description

How can I access PHP error logs in Lando?

I've found several similar issues, but none of them allow you access to true error logs. At best they give you access to logs loosely related to PHP but are useless for resolving the cause of errors.

What I want is full access to error logs like you would be able to configure while hosting a site via localhost Apache and PHP.

Here's what I've attempted so far:

.lando.yml
(relevant pieces only)

config:
  framework: drupal7
  php: '7.1'
  via: apache
  database: mysql
  webroot: docroot
  drush: ^8
  xdebug: false
  config:
    # Custom PHP config overrides.
    php: lando/php-conf/php.ini
services:
  appserver:
    build_as_root:
      - touch /var/log/php_errors.log

Note that in the build process I am creating /var/log/php_errors.log.

lando/php-conf/php.ini

error_log = /var/log/php_errors.log

Then I followed these steps:

  • lando rebuild
  • lando ssh
  • php -i | grep error. Here I see error_log => /var/log/php_errors.log => /var/log/php_errors.log. This looks correct.
  • ls /var/log/. Here I see php_errors.log.
  • tail -f /var/log/php_errors.log. I see nothing.
  • I trigger a PHP error. I still see nothing in the tail process.

Am I missing something obvious? Wouldn't this be super useful for everyone? Thanks for any help.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PHP configuration shown in lando/php-conf/php.ini and the appserver build steps in .lando.yml. Reproduce the issue with lando rebuild, php -i | grep error, and tail -f /var/log/php_errors.log; done means a triggered PHP error appears in the expected log.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.