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 -c {custom php.ini} doesn't work #595

Closed
3 of 5 tasks
ttskch opened this issue May 25, 2022 · 4 comments
Closed
3 of 5 tasks

php -c {custom php.ini} doesn't work #595

ttskch opened this issue May 25, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ttskch
Copy link

ttskch commented May 25, 2022

Describe the bug

$ cat php.ini
date.timezone=Asia/Tokyo

$ php -c php.ini | grep timezone
Default timezone => UTC
date.timezone => UTC => UTC # This should be overwritten with Asia/Tokyo

Version

  • I have checked releases, and the bug exists in the latest patch version of v1 or v2.
  • v2
  • v1

Runners

  • GitHub Hosted
  • Self Hosted

Operating systems

ubuntu-latest (Ubuntu 18.04 LTS)

PHP versions

8.1

To Reproduce

name: CI

on: push

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: shivammathur/setup-php@v2
        with:
          php-version: 8.1

      - uses: actions/checkout@v2

      - name: debug
        run: |
          echo " "
          echo "$ php -i | grep php.ini"
          php -i | grep php.ini
          echo " "
          echo "$ php -i | grep timezone"
          php -i | grep timezone
          echo " "
          echo "$ cat php.ini"
          cat php.ini
          echo " "
          echo "$ php -c php.ini -i | grep php.ini"
          php -c php.ini -i | grep php.ini
          echo " "
          echo "$ php -c php.ini -i | grep timezone"
          php -c php.ini -i | grep timezone

Result of the debug step of above workflow is following.

image

Loaded Configuration File is correctly overwritten with /home/runner/work/{repo}/{repo}/php.ini, but date.timezone is not changed🤔

Expected behavior

$ php -c php.ini -i | grep timezone
Default timezone => UTC
date.timezone => Asia/Tokyo => Asia/Tokyo

Screenshots/Logs

See above.

Additional context

Are you willing to submit a PR?

@ttskch ttskch added the bug Something isn't working label May 25, 2022
@shivammathur
Copy link
Owner

@ttskch I pushed a fix, instead of v2 can you test with the develop branch and let me know.

- uses: shivammathur/setup-php@develop
  with:
    php-version: 8.1

@ttskch
Copy link
Author

ttskch commented May 25, 2022

@shivammathur It works well !! 👍

# output

$ php -i | grep php.ini
Configuration File (php.ini) Path => /etc/php/8.1/cli
Loaded Configuration File => /etc/php/8.1/cli/php.ini
 
$ php -i | grep timezone
Default timezone => UTC
date.timezone => UTC => UTC
 
$ cat php.ini
date.timezone=Asia/Tokyo
 
$ php -c php.ini -i | grep php.ini
Configuration File (php.ini) Path => /etc/php/8.1/cli
Loaded Configuration File => /home/runner/work/{repo}/{repo}/php.ini
 
$ php -c php.ini -i | grep timezone
Default timezone => Asia/Tokyo            # Great! 
date.timezone => Asia/Tokyo => Asia/Tokyo # Great!

@shivammathur
Copy link
Owner

Awesome, the fix will be in the next release.

@shivammathur shivammathur added the awaiting-release Added/Fixed and tested, awaiting release label May 25, 2022
@shivammathur
Copy link
Owner

shivammathur commented May 30, 2022

Released 2.19.0 with the fix.
https://github.com/shivammathur/setup-php/releases/tag/2.19.0

@shivammathur shivammathur removed the awaiting-release Added/Fixed and tested, awaiting release label May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants