0

I'm getting the following warning printed on the minibuffer when I try to use php-auto-yasnippets by pressing C-c C-y into Emacs

symbol's value as variable is void: php-executable

I'm using Ubuntu 14.04 with php5-cli. I did use setq in my emacs configuration file to set the variable to the proper path

(add-to-list 'load-path "~/.emacs.d/site-lisp")
(add-to-list 'load-path "~/.emacs.d/elpa/yasnippet-0.8.0")
(require 'php-auto-yasnippets)
(setq php-auto-yasnippet-php-program "~/.emacs.d/site-lisp/Create-PHP-YASnippet.php")

I know this issue has been addressed with other modules but I'm not skilled with lisp programming to fix php-auto-yasnippets module. Any help is greatly appreciated

1 Answers1

0

It looks like the php-auto-yasnippets code has a dependency on php-mode written by the same author. You could either follow the instructions provided in the php-mode repository for installing it and then require it ahead of the php-auto-yasnippets package, like this:

(add-to-list 'load-path "~/.emacs.d/site-lisp")
(add-to-list 'load-path "~/.emacs.d/elpa/yasnippet-0.8.0")
(require 'php-mode)
(require 'php-auto-yasnippets)
(setq php-auto-yasnippet-php-program "~/.emacs.d/site-lisp/Create-PHP-YASnippet.php")

Or you might instead just try setting the php-executable variable first, but not sure this will address other as-yet-unknown dependencies:

(add-to-list 'load-path "~/.emacs.d/site-lisp")
(add-to-list 'load-path "~/.emacs.d/elpa/yasnippet-0.8.0")
(setq php-executable "/usr/bin/php")
(require 'php-auto-yasnippets)
(setq php-auto-yasnippet-php-program "~/.emacs.d/site-lisp/Create-PHP-YASnippet.php")
Steve Vinoski
  • 19,847
  • 3
  • 31
  • 46
  • OK, your second method solves the problem. Thank you! – Tetravalente Feb 22 '15 at 16:47
  • @Tetravalente: In that case, please consider accepting the answer that helped you, so that it is taken off the list of unanswered questions, and so that users can find it as helpful info. – Drew Feb 23 '15 at 00:40