Skip to content

Commit

Permalink
Update PHP error logging setup in Github workflow
Browse files Browse the repository at this point in the history
The commit updates the process of setting PHP error logging in the build Github action. It now fetches the directory of the loaded PHP INI file and writes the error logging configurations there. The update ensures that the error logging configurations apply to the correct PHP INI file. Additionally, the content of the PHP INI file is displayed for debugging purposes.
  • Loading branch information
koriym committed Jun 27, 2024
1 parent 4c41956 commit dcc97b0
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,22 @@ jobs:
- name: Set PHP error logging
run: |
echo "error_log = /tmp/php_errors.log" | sudo tee -a /usr/local/etc/php/php.ini
echo "log_errors = On" | sudo tee -a /usr/local/etc/php/php.ini
PHP_INI_DIR=$(php -i | grep "Loaded Configuration File" | sed -e "s|.*>\s*||")
PHP_INI_DIR=$(dirname "$PHP_INI_DIR")
echo "PHP INI directory: $PHP_INI_DIR"
if [ ! -d "$PHP_INI_DIR" ]; then
echo "Creating PHP INI directory"
sudo mkdir -p "$PHP_INI_DIR"
fi
echo "error_log = /tmp/php_errors.log" | sudo tee -a "$PHP_INI_DIR/php.ini"
echo "log_errors = On" | sudo tee -a "$PHP_INI_DIR/php.ini"
echo "PHP INI content:"
cat "$PHP_INI_DIR/php.ini"
- name: Display PHP Info
run: php -i

- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y autoconf automake libtool bison re2c
Expand Down

0 comments on commit dcc97b0

Please sign in to comment.