# Error Chrome Headless PHP

**URL:** <https://travis-ci.community/t/error-chrome-headless-php/3525>\
**Category:** Travis CI Discussions & Feedback\
**Created:** [May 27, 2019, 9:48am UTC](https://travis-ci.community/t/error-chrome-headless-php/3525 "2019-05-27T09:48:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![terabytesoftw](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/terabytesoftw/32/1865_2.png) [@terabytesoftw](https://travis-ci.community/u/terabytesoftw)\
**Post date:** [May 27, 2019, 9:48am UTC](https://travis-ci.community/t/error-chrome-headless-php/3525/1 "2019-05-27T09:48:27Z")

</div>

I have managed to build my acceptance tests with chrome headless without selenium, they work well locally but I can not get them to work in travis.yml.

```
travis.yml:

language: php

php:
  - 7.2
  - 7.3

addons:
  chrome: stable

# faster builds on new travis setup not using sudo
sudo: false

# cache vendor dirs
cache:
  directories:
    - $HOME/.composer/cache

service:
  - mysql

before_install:
  - which google-chrome
  - mysql -e 'CREATE DATABASE ModuleUser;'

install:
  - travis_retry composer self-update && composer --version
  - travis_retry composer update --prefer-dist --no-interaction
 
before_script:
  - wget https://chromedriver.storage.googleapis.com/74.0.3729.6/chromedriver_linux64.zip
  - unzip chromedriver_linux64.zip -d vendor/bin
  - vendor/bin/chromedriver --url-base=wd/hub > /dev/null 2>&1&
  - vendor/bin/yii migrate --migrationPath=@TerabyteSoft/Module/User/Migrations --interactive=0

script:
  - |
    cd tests
    php -S 127.0.0.1:8080 -t public > /dev/null 2>&1&
    cd ..
    vendor/bin/codecept build
    vendor/bin/codecept run

after_script:
  - |
    if [$TRAVIS_PHP_VERSION = '7.3']; then
      travis_retry wget https://scrutinizer-ci.com/ocular.phar
      php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml
    fi

```

Error TravisCI:

```
1) SignUpCest: Sign up register success data test
 Test tests/acceptance/SignUpCest.php:signUpRegisterSuccessDataTest
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
  [Facebook\WebDriver\Exception\UnknownServerException] unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.4.0-101-generic x86_64)  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
#1 /home/travis/build/terabytesoft/app-user/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:114
#2 /home/travis/build/terabytesoft/app-user/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:326
#3 /home/travis/build/terabytesoft/app-user/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:126
#4 /home/travis/build/terabytesoft/app-user/vendor/symfony/event-dispatcher/EventDispatcher.php:212
#5 /home/travis/build/terabytesoft/app-user/vendor/symfony/event-dispatcher/EventDispatcher.php:44
Artifacts:
Png: /home/travis/build/terabytesoft/app-user/tests/_output/ModuleUser.SignUpCest.signUpRegisterSuccessDataTest.fail.png
Html: /home/travis/build/terabytesoft/app-use

```

[[https://travis-ci.org/terabytesoft/app-user/jobs/537436601](https://travis-ci.org/terabytesoft/app-user/jobs/537436601)](php 7.2 travisci)  
[[https://travis-ci.org/terabytesoft/app-user/jobs/537436602](https://travis-ci.org/terabytesoft/app-user/jobs/537436602)](php 7.2 travisci)

---

<div class="post-metadata">

**Author:** ![BeyondEvil](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/beyondevil/32/1885_2.png) [@BeyondEvil](https://travis-ci.community/u/BeyondEvil)\
**Post date:** [May 30, 2019, 9:24pm UTC](https://travis-ci.community/t/error-chrome-headless-php/3525/2 "2019-05-30T21:24:17Z")

</div>

I’m seeing the same issue. ☹

> E selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally  
> E (unknown error: DevToolsActivePort file doesn’t exist)  
> E (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)  
> E (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.15.0-1028-gcp x86\_64)

[Link](https://travis-ci.org/pytest-dev/pytest-selenium/jobs/539374174) to job and config.

I noticed you’re missing this in your config @terabytesoftw:  
`google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &`

Found [here](https://docs.travis-ci.com/user/gui-and-headless-browsers/#using-the-chrome-addon-in-the-headless-mode)

Edit:

Managed to solve my issue. The “google-chrome-stable” stuff was not needed.  
What I needed to do was to set “–headless” from chrome was actually being launched (test code).
