Skip to content
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

Ubuntu 20.04 fmt and sublime installed via flatpak #70

Open
mpmont opened this issue Jun 7, 2020 · 2 comments
Open

Ubuntu 20.04 fmt and sublime installed via flatpak #70

mpmont opened this issue Jun 7, 2020 · 2 comments

Comments

@mpmont
Copy link

mpmont commented Jun 7, 2020

At first I thought that had something to do with the fact that Ubuntu 20.04 ships with php 7.4. So I uninstalled that and installed php 7.2 and then went as far as installing 7.1.

Here's my config:

{
	"enable_auto_align": false,
	"format_on_save": true,
	"indent_with_space": true,
	"passes":
	[
		"ConvertOpenTagWithEcho",
		"PrettyPrintDocBlocks",
		"ReturnNull",
		"OnlyOrderUseClauses"
	],
	"psr1": false,
	"psr2": true,
	"version": 2
}

This gives the following error:

  File "/home/marco/.var/app/com.sublimetext.three/config/sublime-text-3/Packages/phpfmt/phpfmt.py", line 122, in dofmt
    p = subprocess.Popen(cmd_ver, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'php'

So I tried to specify the absolute path like so:

{
	"php_bin":"/bin/php",
	"enable_auto_align": false,
	"format_on_save": true,
	"indent_with_space": true,
	"passes":
	[
		"ConvertOpenTagWithEcho",
		"PrettyPrintDocBlocks",
		"ReturnNull",
		"OnlyOrderUseClauses"
	],
	"psr1": false,
	"psr2": true,
	"version": 2
}

Same error:

  File "/home/marco/.var/app/com.sublimetext.three/config/sublime-text-3/Packages/phpfmt/phpfmt.py", line 122, in dofmt
    p = subprocess.Popen(cmd_ver, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: '/bin/php'

But the file is there because when I go to the terminal and type:

$ /bin/php -v

I get the following output.

PHP 7.1.33-16+ubuntu20.04.1+deb.sury.org+1 (cli) (built: May 14 2020 08:27:53) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.33-16+ubuntu20.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

Also tried with /usr/bin/php but same result.

@mpmont
Copy link
Author

mpmont commented Jul 4, 2020

Just found out what the problem was. I installed sublime via flatpak. So the plugin can't get to the php binary. Just removed the flatpak and installed sublime normally and now everything works fine.

But documentation on how to get this working when sublime is installed via flatpak would be great.

@mpmont mpmont changed the title Ubuntu 20.04 fmt stopped working Ubuntu 20.04 fmt and sublime installed via flatpak Jul 4, 2020
@kalligator
Copy link

For future reference permission issues like this with flatpaks can be solved with Flatseal .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants