sublimetext3 - PHP build system error in sublime text 3 -
system configuration:
ubuntu 14.04 (64 bit) + xampp installed (
/opt/lampp
) + sublime text 3 (build 3065 )
i trying create php build system inside sublime text 3 of this interesting post failed do. please see work , issue far
create new build via tools > build system > new build system ... , save as
php.sublime-build
{ "cmd": ["php", "-l", "$file"], "file_regex": "php$", "selector": "source.php", "working_dir": "${project_path:${folder:${file_path}}}" }
now when press ctrl + b or f7 on .php
file gives below error
[errno 2] no such file or directory: 'php' [cmd: ['php', '-l', '/opt/lampp/htdocs/wish/make.php']] [dir: /opt/lampp/htdocs/chrome] [path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games] [finished]
it seems php path issue , added php path in file
"cmd": ["/opt/lampp/bin/php", "-l", "$file"]
now ctrl+b
gives no error in console but gives info on status bar : file build finished 1 error (see image below )
and not show output in sublime text window expected behavior of build system
what wrong here, please correct me.
reference : sublime text build system
i solved finally. below steps
install
php5-cli
sudo apt-get install php5-cli
while installing , gives php path
update-alternatives: using /usr/bin/php5 provide /usr/bin/php (php) in auto mode
check command line php
.php
file on terminal (ctrl+alt+t):~$ /usr/bin/php /opt/lampp/htdocs/parixan/arr.php
it executed fine
edit
/home/keshav/.config/sublime-text-3/packages/user/
php.build_systemchanged path , remove
"-l"
second argument"cmd": ["/usr/bin/php", "$file"]
restart sublime text , press
ctrl+b
on opened.php
, output of file returns in sublime window.( expected behavior ).
hope someone. :)
Comments
Post a Comment