---
url: 'https://metadrop.net/en/articles/phantomjs-v2-some-useful-commands'
title: 'PhantomJS v2 some useful commands'
author: 'Carlos Montes'
date: '2016-05-31T09:21:37+00:00'
updated: '2026-08-04T07:58:12+00:00'
type: article
summary: 'In this article we show some very useful command to better configure our PhantonJS v2.'
tags:
  - PhantomJS
  - Testing
published: true
og:
  determiner: Automatic
  site_name: Metadrop
  'image:alt': 'PhantomJS v2 some useful commands'
  street_address: 'Calle Manuel Luna, 12, 3 Dcha'
  locality: Madrid
  region: Madrid
  postal_code: '28020'
  country_name: España
  email: hola@metadrop.net
  phone_number: '910053180'
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      '@type': Article
      '@id': 'https://metadrop.net/en/articles/phantomjs-v2-some-useful-commands#article'
      name: 'PhantomJS v2 some useful commands'
      headline: 'PhantomJS v2 some useful commands'
      description: "In this article we show some very useful command\_to better configure our PhantonJS v2."
      about:
        - PhantomJS
        - Testing
      datePublished: '2017-01-20T11:15:15+0100'
      dateModified: '2026-08-04T09:58:12+0200'
      author:
        '@type': Person
        name: 'Carlos Montes'
      publisher:
        '@type': Organization
        '@id': 'https://metadrop.net/#organization'
      mainEntityOfPage: 'https://metadrop.net/en/articles/phantomjs-v2-some-useful-commands'
    -
      '@type': Organization
      '@id': 'https://metadrop.net/#organization'
      url: 'https://metadrop.net/'
      name: Metadrop
      sameAs:
        - 'https://www.drupal.org/metadrop'
        - 'https://twitter.com/metadrop'
        - 'https://asociaciondrupal.es/partner/metadrop'
        - 'https://www.linkedin.com/company/metadrop'
      logo:
        '@type': ImageObject
        url: 'https://metadrop.net/themes/custom/mdrop_radix/logo-metadrop-500-500.jpg'
        width: '500'
        height: '500'
    -
      '@type': ItemPage
      '@id': 'https://metadrop.net/en/articles/phantomjs-v2-some-useful-commands'
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: Home
            item: 'https://metadrop.net/en'
          -
            '@type': ListItem
            position: 2
            name: 'Expert Drupal & Tech Articles'
            item: 'https://metadrop.net/en/articles'
      publisher:
        '@type': Organization
        '@id': 'https://metadrop.net/#organization'
---
 1. [Articles](https://metadrop.net/en/articles)
 
  

# PhantomJS v2 some useful commands

Friday, January 20, 2017

 

 



In this article we show some very useful command to better configure our PhantonJS v2.



   



As we already know PhantonJS is a browser with no graphical interface used for the automation of web page interaction.

Here are some command that will help us configure our browser more efficiently according to our needs.

```ini
--debug=[true|false] 
```

Prints warning and debug message, the default value is false.
It will help us with possible faults you have, errors of JavasSript, libraries, classes, and much more.

```ini
--ignore-ssl-errors=[true|false]
```

Ignore SSL errors, such as expired or self-signed certificate errors, default false.
Very useful if we have problems with certificates with false we can avoid some headaches.

```ini
--load-images=[true|false]
```

Load all images online, the default is true.
With false we can avoid loading, not always, unnecessary images.

```ini
--config=[path]
```

Specifies a JSON-formatted configuration file.
We can specify different configurations according to our needs.

Example of custom configuration for our environment:

```ini
--config=/path/to/config.json
```

```coffeescript
{
  "ignoreSslErrors": true,
  "outputEncoding": "utf8",
  /*Degug*/
  "printDebugMessages":true,
  /*Load images*/
  "autoLoadImages":false,
}

```

Sources:

[PhantomJs command line ](https://phantomjs.org/api/command-line.html "PhantonJS API Comand")



[PhantomJS](https://metadrop.net/en/articles?text=PhantomJS)

[Testing](https://metadrop.net/en/articles?text=Testing)

 

[Quality Assurance](https://metadrop.net/en/methodology/quality-assurance " See Quality Assurance")

Metadrop enforces quality through CI/CD pipelines, automated testing (Behat, PHPUnit), static code analysis, and peer review on every project.

 

 See more