Isolation using Pygmentize in Phabricator does not work

I installed Phabricator to work with Python projects. Everything is fine, but viewing the files presents them as plain text. I want to highlight the highlighting provided by the Pygmentize utility.

I installed Pyigs

sudo pip install Pygments 

Tested by all users, the pygmentize script is available and located in / usr / local / bin. I changed

 'pygments.enabled' => true, 

in the myconfig.conf.php file of the fabricator. But that doesn't work? I can not find any glitches in the logs or anything else. Do you have any idea why this might happen?

+4
source share
2 answers

I received a response from Github-Issues. The reason was that the httpd user cannot name this function, here is a sample that extends the $ PATH native environment. I added this to myconfig.conf.php file:

 'environment.append-paths' => array('/usr/local/bin'), 

It is highly recommended that you add a path with pygmentize to your path.

+5
source

configuration file located at:

phabricator/conf/local/local.json

I added to my configuration

 "environment.append-paths": ["\/bin","\/usr\/bin","\/usr\/local\/bin","\/usr\/local\/sbin","\/usr\/local\/bin","\/opt\/local\/sbin","\/opt\/local\/bin","\/usr\/sbin","\/usr\/bin","\/sbin"], 

I use SmartOS ($ PATH finds in / usr / local / sbin: / usr / local / bin: / opt / local / sbin: / opt / local / bin: / usr / sbin: / usr / bin: / SBIN)

0
source

Source: https://habr.com/ru/post/1437073/


All Articles