How to access PHP error logs?
Nobody has claimed this yet.
- 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 rebuildlando sshphp -i | grep error. Here I seeerror_log => /var/log/php_errors.log => /var/log/php_errors.log. This looks correct.ls /var/log/. Here I seephp_errors.log.tail -f /var/log/php_errors.log. I see nothing.- I trigger a PHP error. I still see nothing in the
tailprocess.
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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