简体   繁体   中英

Error 127 when running SASS from PHP

I'm trying to use SASS from PHP but I always get a 127 error.

Here is what I'm doing:

$command = 'sass pathtomyfile.scss:pathtomyfile.css';

system($command, $return); 

echo $return; // give me: 127

If I run the exact same command in the terminal, everything work fine. Note that I'm trying to do it on Mac OS X.

Edit: I believe this is a permission issue but I have no idea of how to solve this.

Edit 2: I'm using rvm

127 error is command not found make sure the PATH is set correctly to a place where sass command was installed or full path to the command, you can find the full path to sass by running in your shell which sass .

As you use RVM you can make sure proper environment is used with wrappers:

$ rvm use 1.9.3 --install
$ gem install sass
$ rvm wrapper 1.9.3 php sass
$ which php_sass
/home/user/.rvm/bin/php_sass

and use the returned path to run sass .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM