Show PHP error in Atom

Asked

Viewed 516 times

2

Colleagues.

I am using the Atom editor for development, I have already installed some packages, but I noticed that Atom does not show syntax errors. Does anyone know of any Atom packages that do this service? I tried to use linter-php, but the error appears below:

inserir a descrição da imagem aqui

  • 2

    For programming errors do you say syntax errors? If yes, you can use the package Linter PHP.

  • Hi Anderson. Thanks for the fix. I installed linter-php, but it gives the error in the image I put in the post.

  • 2

    Substitute executablePath for /usr/bin/php, being like this: "linter-php": '/usr/bin/php'

  • the error is gone. Forgive my ignorance, but '/usr/bin/php' would be the PHP directory on my computer or I leave it with this same nomenclature?

  • 1

    It is the path to where PHP is installed on your machine.

  • Perfect. Thank you very much Anderson.

Show 1 more comment

2 answers

2

Version used: Atom 1.14.4 x64. Some details may vary depending on the editor’s version and configuration, such as language.

Linter PHP

To display syntax errors, you can make use of the package Linter PHP.

You will need to have PHP installed on the machine. After that, just install the package by running the command:

apm install linter-php

Or go into Edit / Preferences (Ctrl + Comma), enter the tab Install, searching for the name linter-php. Press Install. If necessary, allow adding all package dependencies.

inserir a descrição da imagem aqui

Depending on your PHP installation, you may have to configure the path of the executable to the package. To do this, go to Edit / Config... and add, if not already existing, the:

'linter-php':
  # php path. run 'which php' to find the path 
  'executablePath': /usr/bin/php

Remembering that /usr/bin/php should be the way to install PHP. In Linux environments, usually this path will be given.

Once done, the package should already be working.

inserir a descrição da imagem aqui

1


Linter PHP would be a good solution, but it was a temporary gambiarra. Thanks to Nuclide, a very active and powerful community adopted by Facebook, now what was only an editor, has turned into a true IDE.

To make your Atom Editor become an official IDE, it’s very easy. Come with me and follow the steps below:

  1. Install the package Atom-ide-ui
  2. Install your favorite language pack. In this case, PHP: ide-php

I wrote an article doing a review and a more cool comment of the tool. Visit this link for more information.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.