php.ini in hhvm environment #2523

Closed
danmichaelo opened this Issue Jul 13, 2014 · 26 comments

Comments

Projects
None yet
10 participants

I'm using the one-line from the php docs to set my timezone. It works great with all environments except hhvm. From job 29823606:

$ echo 'date.timezone = "UTC"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
/home/travis/build.sh: line 201: /home/travis/.phpenv/versions/hhvm/etc/conf.d/travis.ini: No such file or directory
Owner

BanzaiMan commented Jul 13, 2014

Is this supposed to work on hhvm?

henrikhodne added the php label Jul 14, 2014

Owner

BanzaiMan commented Jul 14, 2014

It seems that hhvm's path is different (https://github.com/travis-ci/travis-cookbooks/blob/master/ci_environment/hhvm/recipes/package.rb#L24)

@loicfrering Do you have any insight on this?

Owner

joshk commented Jul 22, 2014

Hmmm.... Still seems broken. I'm not using the oneliner but the complete travis.yml way of doing it via phpenv:

Using worker: worker-linux-4-2.bb.travis-ci.org:travis-linux-12
git.1
0.07s$ git clone --depth=50 --branch=master git://github.com/fruitl00p/php-mt940.git fruitl00p/php-mt940
Cloning into 'fruitl00p/php-mt940'...
remote: Counting objects: 348, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 348 (delta 2), reused 0 (delta 0)
Receiving objects: 100% (348/348), 54.04 KiB | 0 bytes/s, done.
Resolving deltas: 100% (121/121), done.
Checking connectivity... done.
$ cd fruitl00p/php-mt940
git.4
$ git checkout -qf 09f71391985cb254faa6f96d47ab754f660c9473
0.03s$ phpenv global hhvm
0.15s$ php --version
HipHop VM 3.2.0 (rel)
Compiler: tags/HHVM-3.2.0-0-g01228273b8cf709aacbd3df1c51b1e690ecebac8
Repo schema: c52ba40f4a246d35a88f1dfc1daf959851ced8aa
2.02s$ composer --version
Composer version 4ecdbf89c4a3d1e5dfe73c57e3202a5e2a18c87e 2014-07-28 20:12:27
0.04s$ phpenv config-add test/phpconfig.ini
cp: cannot create regular file `/home/travis/.phpenv/versions/hhvm/etc/conf.d': No such file or directory
The command "phpenv config-add test/phpconfig.ini" failed and exited with 1 during .
Your build has been stopped.

Thus breaking my build ?

Owner

BanzaiMan commented Aug 25, 2014

@fruitl00p Ah. There is no directory /home/travis/.phpenv/versions/hhvm/etc. Could you try creating it before phpenv config-add? (Wouldn't it be nice if phpenv took care of this?)

In that case i might as well just use the oneliner ;) Strange sice using phpenv for the other PHP versions worked like it should i just assumed this should've worked too 😄

@fruitl00p fruitl00p added a commit to fruitl00p/php-mt940 that referenced this issue Aug 25, 2014

@fruitl00p fruitl00p Update .travis.yml
does this work (travis-ci/travis-ci#2523)
acdeb09

BanzaiMan self-assigned this Aug 25, 2014

Owner

BanzaiMan commented Aug 25, 2014

@fruitl00p That this method works for other PHP versions suggests to me that there is something lacking in the cookbooks we should look at. I'll take a look.

Owner

joshk commented Aug 25, 2014

Contributor

loicfrering commented Aug 26, 2014

Hi guys, sorry for the delay. HHVM environment is a bit different than the other regular PHP environments which we are compiling. HHVM is installed system wide by a package. Right now, the only solution if you want a particular configuration for HHVM is to tweak /etc/hhvm/php.ini when your build is running against HHVM,

I'll try to see what can be done to make it easier and to make the configuration of HHVM uniform with regular PHP's configuration.

Thanks @loicfrering. Hope to see this alignment between PHP engines / versions soon so running a testsuite against various PHP engines is all the same from the travis.yml part ;)

Owner

joshk commented Aug 26, 2014

@loicfrering you rock! don't be sorry for the delay, your help is much appreciated!

until we tweak this setup, maybe we can just document it?

@joshtronic joshtronic added a commit to joshtronic/pickles that referenced this issue Oct 3, 2014

@joshtronic joshtronic Added script to set up extension
As per travis-ci/travis-ci#2523 it appears that the
php.ini on hhvm is in a different place. Created a script to write the
extensions to the right php.ini based on the environment.
5b2f483
Owner

BanzaiMan commented Oct 16, 2014

Note that we are no longer adding /etc/hhvm/php.ini (with which we used to set the time zone) in the cookbooks due to #2812.

@BanzaiMan we are having date.timezone issues now on HHVM. See here. I guess that is because you removed the explicit setting of the timezone from the HHVM .ini file.
What would be the correct solution to set the timezone on HHVM again?

Owner

BanzaiMan commented Oct 16, 2014

@deeky666 Sorry about the issue. For now, create your own ini file with desired content, and then invoke hhvm with -c. For example:

before_install:
  - echo 'timezone = "UTC"' > travis.hhvm.ini # or commit this file to the repo

script:
  - hhvm -c travis.hhvm.ini STUFF

@BanzaiMan great but how with hhvm -c I can run phpunit?

Owner

BanzaiMan commented Oct 18, 2014

This is untested, I think hhvm -c travis.hhvm.ini $HOME/.phpenv/versions/hhv/bin/phpunit … would work.

Ok, I found typo in this. Works fine. Thanks.

hhvm -c travis.hhvm.ini $HOME/.phpenv/versions/hhvm/bin/phpunit

@nijel nijel added a commit to nijel/phpmyadmin that referenced this issue Nov 3, 2014

@nijel nijel Set timezone in PHP snippet
There is no clean way to adjust HHVM settings from Travis, see
travis-ci/travis-ci#2523

Caused by HHVM configuration no longer including timezone settings, see
travis-ci/travis-ci#2812

Signed-off-by: Michal Čihař <michal@cihar.com>
a5337bf
Owner

BanzaiMan commented Nov 6, 2014

I have a possible fix for this issue. Could someone point to a particular build that exhibits this issue so that I can test it?

BanzaiMan referenced this issue in travis-ci/travis-build Nov 6, 2014

Merged

Inject /etc/hhvm/php.ini in PHP's configure for HHVM #322

@BanzaiMan BanzaiMan added a commit to travis-ci/travis-build that referenced this issue Nov 6, 2014

@BanzaiMan BanzaiMan Inject /etc/hhvm/php.ini in PHP's configure for HHVM
We need to run this before paranoid_mode disables sudo

This fixes travis-ci/travis-ci#2863 and
travis-ci/travis-ci#2523.
58a63be
Owner

BanzaiMan commented Nov 6, 2014

OK, the time zone fix has been deployed. Please test your HHVM jobs without the workaround. Thank you!

BanzaiMan closed this Nov 6, 2014

stof commented Nov 7, 2014

HHVM-nightly still misses the timezone: https://travis-ci.org/phpspec/phpspec/jobs/40279263

Owner

BanzaiMan commented Nov 7, 2014

@stof nightly is a separate issue, unfortunately. php.ini needs to be modified after the package is installed. I have another fix in mind, but not sure if we'd be rolling it out.

Thanks, works fine with HHVM now! (I'm not testing with HHVM-nightly)

Owner

BanzaiMan commented Nov 8, 2014

Sorry, the fix has been lost during a deploy. We'll fix this Monday.

@andreausu andreausu added a commit to andreausu/CodiceFiscale that referenced this issue Nov 8, 2014

@andreausu andreausu Removed hhvm from Travis CI because of travis-ci/travis-ci#2523 52628d6

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 4, 2015

@photodude photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
482fbb2

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 8, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
895ef76

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 11, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
16a61c5

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 11, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
85e3f32

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 13, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
a694aad

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 15, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
95b844b

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 15, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
32d0d80

This still doesn't work with custom .ini files:

$ phpenv config-add .travis.php.ini
cp: cannot create regular file `/home/travis/.phpenv/versions/hhvm/etc/conf.d': No such file or directory
The command "phpenv config-add .travis.php.ini" failed and exited with 1 during .

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 24, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
e0d8121

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 25, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
b327cf8

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 25, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
d3f5541

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue May 29, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
40b762c

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue Jun 13, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
977cca8

@photodude photodude added a commit to photodude/joomla-cms that referenced this issue Jun 26, 2015

@photodude @photodude photodude + photodude Create travis.sh
adapted from information found at travis-ci/travis-ci#2523
1943d80

@relaxnow relaxnow added a commit to relaxnow/OpenConext-engineblock-metadata that referenced this issue Aug 17, 2015

@relaxnow relaxnow Dear Travis,
Allow failures from PHP7 and HHVM, but try to get HHVM to at least run by creating the config directory that you created for other versions but not HHVM?
See also: travis-ci/travis-ci#2523 . Why must you be so mean?

Yours Regretfully,
Boy
d63e067

@glensc glensc added a commit to eventum/eventum that referenced this issue Jun 27, 2016

@glensc glensc travis: avoid hhvm early failure due missing dir
don't really care if ldap gets enabled in hhvm, it should not fail with
env-prepare step

See also: travis-ci/travis-ci#2523
5717ea3

@ggirtsou ggirtsou added a commit to trivialmatters/square-matrix that referenced this issue Aug 20, 2016

@ggirtsou ggirtsou Fix Sensiolabs violations, do not fail HHVM in travis
- Add test suite in PHPUnit configuration file
- travis: avoid hhvm early failure due missing dir travis-ci/travis-ci#2523
f2635f0

Ocramius referenced this issue in doctrine/dbal Oct 1, 2016

Merged

Normalize method signatures for `fetch()` and `fetchAll()` #2527

1 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment