Atom php error

Hello, I've seen this error discussed before but don't understand from previous issues what the solution was. When I check the path listed with this error message I find helpers.js, index.j...

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

Comments

@TrustedSamurai

Hello,

I’ve seen this error discussed before but don’t understand from previous issues what the solution was.

When I check the path listed with this error message I find helpers.js, index.js and types.js but nothing that says php (C:Usersjanderson.atompackageslinter-phpnode_modulesatom-linterlibhelpers.js:102:24)

I’ve checked Atom packages and see that I have language-php installed.

But I don’t know what to try next?

Thank you,

John.

@Arcanemagus

The message is talking about the system wide %PATH% environment variable that determines where executables should automatically be found.

Do you have PHP installed on your system and have you modified your environment to make it available? You should be able to type where.exe php in a command prompt and get back a path.

@TrustedSamurai

Hey Arcanemagus,
Thanks for writing.

When I execute a where.exe php from my Windows 10 Command Prompt I get the message
INFO: Could not find files for the given pattern(s).

When I open the Environment Variables window there is a variable called ‘Path’. it contains two values:
C:UsersOwnerAppDataLocalMicrosoftWindowsApps
C:UsersOwnerAppDataLocalatombin

Thanks.

@Isaactmh

This is very easy to fix.

you need to edit the atom’s config.cson file.
It’s locate in C:UsersYOURUSERNAME.atom (For Windows users only)

open with notepad and then add at the end of the file the section like the following:

«linter-php»:
‘executablePath’: YOURPHPLOCATION Example: C:php7.0

Save, restart atom and will start to work.
atom

@TrustedSamurai

Hi Isaac,

Thank you for writing back directly. I thought it was a noob question but appreciate you taking the time.

I have located the config.cson file in c:usersowners its obviously the right file because as soon as I save it Atom (which is open) brings up an error saying Failed to Load.

The only php I could find was installed with Xamplite. I was thiking that Atom would have its own reference or lookup. Do you agree that I can use this? I believe it only has php5+ but I can’t actually find where it is. I suspect I need to download/install php for Atom yes?

My config file currently looks like this.

«*»:

core:

disabledPackages: [

«wordpress-api»

«autocomplete-wordpress-hooks»

]

telemetryConsent: «limited»

editor:

fontSize: 21

«exception-reporting»:

userId: «b5d282c1-230f-4c96-a4b2-995bf34baf03″

welcome:

showOnStartup: false

linter-php»:

‘executablePath’: C:xamppliteds-pluginsds-clivendorcomposercomposertestsComposerTestAutoloadFixturesphp7.0

Atom complains but that’s probably because it can’t fine php 7 at that location.

Thanks again for your time.

@Isaactmh

Hi TrustedSamurai.

If you are using Xampp the PHP executable it’s on C:xamppphp

If you can see a blue PHP icon you are on the right folder. I don’t know if the plug-in can work or not with PHP5 because I have the php7 I think so but you have to try.

In case you can’t make it work, try to download the php7 standalone version and set the path in your config.cson. let me know what happen.

@Arcanemagus

@Isaactmh and @TrustedSamurai: Unless you know exactly what you are doing, you should always use the Settings within Atom to modify that file, it’s easy to break things if you don’t follow exactly how that file is supposed to work.

@TrustedSamurai within the settings it sounds like you just need to set the «Executable Path» option to C:xamppphpphp.exe.

I don’t know if the plug-in can work or not with PHP5

@Isaactmh the package definitely works with PHP 5 😉.

@TrustedSamurai

Ok, sounds straight forward. :)

I open the environment variables window and add a new path to the PATH variable. I can see PHP.EXE sitting at ‘C:xamplitephpphp.exe’ so I add this to PATH. Restart Atom and the following message appears.

I also went to Atom > Settings > Packages > php-integrator-base and added the path to PHP as c:/xamplite/php

But still get this message.

@Arcanemagus

@TrustedSamurai The PATH environment variable expects a directory, while the «Executable Path» setting expects a full path (confusing terminology, I know).

If your PHP is located at C:xamplitephpphp.exe then you would need to do one of the following:

  • Add C:xamplitephp to your PATH environment variable to make php available system wide
  • Set «Executable Path» to C:xamplitephpphp.exe to make just linter-php work

@TrustedSamurai

Thank you, adding the path of the php executable to the environment variable ‘Path’ worked.

@braday

I have similar problem getting php works because am using wamp for local host. I also tried placing all the PHP version but it gave me this error msg

Failed to load config.cson
[stdin]:15:47: error: unexpected newline
  # php path. run 'which php' to find the path

Here is what I set for the php.

"linter-php":
  # php path. run 'which php' to find the path
  'executablePath': D:wampbinphpphp7.1.9

Appreciated for any advises, thanks

@Arcanemagus

@braday Don’t edit your config.cson directly unless you know exactly what you are doing. Remove those lines and use the Settings view within Atom to change the value 😉. Note that when setting this, as explained above, you need the full path of php.exe, in this case it looks like it would be:

D:wampbinphpphp7.1.9php.exe

You attempted to set a folder, which wouldn’t work anyway.

Note: If you were curious about the several different things wrong with what you attempted above go back into the file after setting it in the UI to see all the differences.

@braday

@Arcanemagus Thanks for prompt reply. After I change the path setting inside your package is still saying

Linter Error running PHP

I wonder is that something wrong rather than this package installation?
Regards

@Arcanemagus

I couldn’t really say without seeing the rest of the error 😉.

@braday

@Aimanski12

@chaitu111

«
screenshot_4

@TetraMiyazaki

Время прочтения
4 мин

Просмотры 197K

Редактор Atom от GitHub после установки поддерживает подсветку синтаксиса для основных языков программирования. Однако для более полноценной работы — валидации кода, проверки синтаксиса, базовой отладки и снипетов, как и в большинстве редакторов кода, необходимо подключение дополнительных пакетов и ряд действий.
Под катом так же дополнительно расскажем:

  • про запуск скриптов
  • работу в терминале прямо из интерфейса Atom
  • и чуть-чуть про заявленную поддержку Swift от Apple

Внимание трафик — кликабельные картинки и анимированые gif. (~3МБ)

Изначально считаем что у Вас установлена поддерживаемая операционная система, Node.JS и Atom. В примерах мы работаем в OpenSUSE (13.1) в нём (и вообще в дистрибутивах *nix) уже «из коробки» обычно есть не только Python но PHP и другие языки программирования. Так же исправно работает на Ubuntu (>12.04). Если у Вас Windows 7 или 8, а раньше Вы с ними (языками) не работали то их предварительно необходимо скачать и установить.
Примечание: перед началом работы желательно запускать Atom под root.
опыт показывает — работает стабильнее

Linter

Идеология Atom к подсветке в том, что основным пакетом для работы с синтаксисом и его анализа будет Linter, который является верхним уровнем в API для других линтеров кода. Это сделано для прекращения «войны между плагинами» (The idea is to stop the linter plugins war, by providing a top level API for linters to parse and display errors in the Atom editor). Тем не менее, не все сторонние разработчики придерживаются этой идеологии и пишут свои плагины.

image

На текущий момент доступно для 21 языка :

  • linter-php , для PHP `php -l`
  • linter-phpcs , для PHP, `phpc`
  • linter-phpmd , для PHP, `phpmd`
  • linter-pylint , для Python, `pylint`
  • linter-pyflakes , для python, `pyflakes`
  • linter-pep8, для python, `pep8`
  • linter-flake8, для python, `flake8`
  • linter-javac , для Java, `javac`
  • linter-jshint , для JavaScript and JSON, `jshint`
  • linter-jscs , для JavaScript, `jscs`
  • linter-scss-lint , для SASS/SCSS, `scss-lint`
  • linter-coffeelint , для CoffeeScript, `coffeelint`
  • linter-csslint , для CSS, `csslint`
  • linter-rubocop , для Ruby and Ruby on Rails, `rubocop`
  • linter-tslint , для Typescript, `tslint`
  • linter-xmllint , для XML, `xmllint`
  • linter-shellcheck , для Bash, `shellcheck`
  • linter-scalac , для Scala, `scalac`
  • linter-clang , для C / C++, `clang`
  • linter-ruby , для ruby, `ruby -wc`
  • linter-lua , для Lua, `luac -p`

Пакет Script: запуск программ из Atom

Script — пакет для запуска кода в atom.

Установка пакета Script, возможна из командной строки:

apm install script

или меню
Packages->Settings View->Install->Packages

В результате должны поддерживаться следующие языки (26):

AppleScript
Bash
Behat Feature
Coffeescript
CoffeeScript (Literate) ^
Cucumber (Gherkin) *
Elixir
Erlang †
F# *
Go *
Groovy
Haskell
Javascript
Julia
LilyPond
LiveScript
Lua
MoonScript
newLISP
Perl
PHP
Python
RSpec
Ruby
Scala
Swift

Каждый язык работает, при наличии предварительно установленного компилятора / интерпритатора.
Пакет Script обновляется довольно часто. Например поддержка Swift появилась менее двух недель назад. Так что скорее всего в ближайшее время появится поддержка новых языков.

Для запуска программы необходимо выбрать
Packages—>Script—>Run

Дополнительные опции можно найти в документации либо на страницах Atom`а или проекта.

Для функционирования должен быть создан рабочий каталог.
Путь к нему нужно прописать здесь:
Packages—>Script—>Configure Script—>Current Working Directory
Заявку разработчикам на поддержку нового языка можно оставить здесь (отвечают быстро)

И немного юмора от разработчиков пакета Script,
у которых, судя по всему, спрашивают всё на свете:

первод: Атом не может найти Нод | Руби | Питон | Мои носки

Python

Поддержка подсветки этого языка идёт изначально. Пакеты для работы с синтаксисом и отладки:
Linter + Language Python + Linter Python Pep8 + Script

Script запускает код на Python, а Linter и Linter Python Pep8 покажут синтаксические ошибки.
Возможно Вам, для работы с Python также поможет Atom Python Debugger.
Подсветка ошибок и запуск после установки будут выглядеть так:

PHP

Для PHP мы так же подключали Script и некоторые пакеты:

  • Language php
  • Linter php
  • Php Twig

Atom показывает ошибки синтаксиса и запускает php скрипт:

Swift

Для Mac OS есть по меньшей мере два варианта запуска кода Swift:

  • пакет Swift Playground
  • и уже описанный пакет Script.

К сожалению под Mac ничего не пишем, поэтому этот пункт со слов разработчиков.
Сразу отмечено, что Swift запустится только на Mac OS, другие дистрибутивы его не поддерживают.

Подcветка синтаксиса swift работает на любом дистрибутиве после установки пакета Language Swift:

Терминал

Для запуска исполняемого кода С, C++, Java иногда проще использовать сторонний пакет (не пакет Atom, а пакет вашего дистрибутива), который запускается через терминал, поскольку сам Atom поддерживает большое количество языков. Если Atom выступает в качестве редактора кода, a терминал рядом запускает его — это очень удобно для нас, поскольку терминал не имеет такое преимущество редактирования, как Atom.
Для запуска терминала в окне Atom установите пакет Term. Для запуска терминала в окне Atom выбрать
Packages—>Command Palette—>Toggle и Term
с нужными параметрами.

В заключении ещё один интересный кликабельный анимационный gif от разработчиков script, ссылки.

image

Ссылки

  • Atom.io
  • Linter
  • Term
  • Script
  • Плагины для работы с Python
  • Плагины для работы с php
  • Пакеты для различных языков адаптированые для Atom
  • Этот пост — продолжение предыдущего, про установку Atom на базовые ОС.

Возникла такая проблема:

Ошибка

В консоли было много ошибок, а в GOOGLE ничего на RU не нашёл. На EU краем глаза заметил фикс данной ошибки в пути. Если у вас LocalHost и у вас возникла такая проблема, тогда ответ будет ниже.

задан 8 апр 2018 в 19:16

MoloF's user avatar

В вашем скрипте PHP вы вставляете:

print_r($_SERVER['PATH']);

И смотрите путь где у вас установлен PHP модуль.
В моём случае на OpenServer ‘e это был:

D:ProgrammFilesOpenServerOpenServermodulesphpPHP-5.6php.exe

В итоге вы просто подставляете этот путь в настройки расширения Linter:
Пример

ответ дан 8 апр 2018 в 19:16

MoloF's user avatar

MoloFMoloF

4,3841 золотой знак14 серебряных знаков37 бронзовых знаков

dear fellows, 

first of all — i hope that you are all well and all goes okay 

since it seems to belong all to the same issue and the same thing i add this to this thread. 


the question today is: How can we install the Python package other than using pip?th

i run Python on MX-Linux  — there is

root@mx:/home/martin# python3 --V
unknown option --V
usage: python3 [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
root@mx:/home/martin# python3 -V
Python 3.7.3
root@mx:/home/martin# pip install pandas
bash: pip: command not found.
	

i have no pip on the machine:  if i want to install pandas with the following command it does not work

pip install pandas

well i guess that i first of all need to instal pip

1) Find the package at PyPI — the Python Package Index .

2) Download the source code,
3) Read the INSTALL.txt or README.txt for clue on installation.
4) Usually installation is made of these steps
     $ python setup.py   build
     $ python setup.py  install

If you do not have EasyBuild installed yet, or if you just want to install the most recent version of each of the EasyBuild packages, you can use one of the following simple commands:

using easy_install (old tool, but still works):
easy_install --prefix $HOME/EasyBuild easybuild

Note If we already have easybuild installed, we may need to instruct easy_install to install a newer version, using —upgrade or -U.

using pip (more recent and better installation tool for Python software):

pip install --install-option "--prefix=$HOME/EasyBuild" easybuild

The —prefix $HOME/EasyBuild part in these commands allows you to install EasyBuild without admin rights into $HOME/EasyBuild.

Note For pip v8.0 and newer, pip install —prefix=$HOME/EasyBuild easybuild works too.

but wait: this page tells us that pip should be no my machine: 

pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org or if you are working in a Virtual Environment created by virtualenv or pyvenv. Just make sure to upgrade pip.

Installing with get-pip.py To install pip, securely   download get-pip.py by following this link: get-pip.py. Alternatively, use curl:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Then run the following command in the folder where you have downloaded get-pip.py:

python get-pip.py

Warning Be cautious if you are using a Python install that is managed by your operating system or another package manager. get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state.

so after all i am a bit confused: what  should i do — if i want to install pandas

— the questions are:

— wich options do i have to install pandas without pip 
— besides that: am i able to install pip with a simple method without running into any troubles?!?
— what should i do have to look for the preliminary steps!?
— are there any stepstones or pitfalls here !?

Dear Fellows — sorry for adding this also to the thread — but i guess that this is quite helpful since it belongs to the same area of scope and interest. 


love to hear from you

atom-autocomplete-php Incomplete Error because of missing composer.phar

Atom.io is one of the best development IDE for Java and PHP WordPress. With more than hundreds of plugins/packages it became very popular in no time after launch.

Ever wondered how to make Custom autocomplete in Atom or Atom-autocomplete-php package?

While setting up top plugins on Atom.io I faced wired issue yesterday.

atom-autocomplete-php – Incorrect setup!

Either PHP or Composer is not correctly set up and as a result PHP autocompletion will not work. Please visit the settings screen to correct this error. If you are not specifying an absolute path for PHP or Composer, make sure they are in your PATH. Feel free to look package’s README for configuration examples.

How to install and setup Composer on Mac OS X

Step-1.

bash-3.2$ php composer-setup.php --filename=composer
All settings correct for using Composer
Downloading...

Composer (version 1.4.2) successfully installed to: /Users/ashah/composer
Use it: php composer

You will see composer.phar file created under user directory.

-rwxr-xr-x   1 ashah  staff  1838958 Jun 14 09:57 composer.phar

Step-2.

  • Go to Atom IDE
  • Click on Preferences...
  • Click on Packages Tab
  • Click on Settings link for atom-autocomplete-php package

Step-3.

  • Look for setting for Command to use Composer.
  • Add /Users/ashah/composer.phar as a value. Make sure you change to your username.

successfully install composer on Mac OS X

And you are all set. You should see Green message box saying you have successfully installed composer.


Join the Discussion

If you liked this article, then please share it on social media. Still have any questions about an article, leave us a comment.

Share:

I’m an Engineer by profession, Blogger by passion & Founder of Crunchify, LLC, the largest free blogging & technical resource site for beginners. Love SEO, SaaS, #webperf, WordPress, Java. With over 16 millions+ pageviews/month, Crunchify has changed the life of over thousands of individual around the globe teaching Java & Web Tech for FREE.

Reader Interactions

hi there good day dear folks, hello dear phpBB-experts,

i am currently workin on a script: therefore i have to take care that the PHP-development-Environment is set up correctly:
so this is a question regarding: ATOM-Settings: IDE-PHP could not launch your PHP runtime: how to proceed

i just installed into ATOM the 

— IDE-PHP 
and i followed the recommendation:

Code: Select all

You should also install the [atom-ide-ui](https://atom.io/packages/atom-ide-ui) package to expose the functionality within Atom.


s

o i also installed the **atom-ide-ui**

Now — i got back the complains from the system: 

Code: Select all

  No PHP interpreter found at  **php** .

    If you have PHP 7.0 installed please Set PHP Path correctly. If you do not please Download PHP 7.0 or later and install it.

    `spawn php ENOENT`
    IDE-PHP could not launch your PHP runtime.

    No PHP interpreter found at  **php** .

well — i just need to install PHP — and set the paths

btw: are there some other nice and easy leightweight IDEs or Editors for PHP!? Love to hear from you.

sincerely your ApolloDriver

Понравилась статья? Поделить с друзьями:
  • Atmosphere error code 2162 0002
  • Atmega chip enable program error
  • Audiodg exe ошибка
  • Audioclip error unsupported file format
  • Audio system was not initialized correctly error code 0 mount and blade