Userfrosting did not detect nodejs? 【SOLVED】


#21

QQ%E6%88%AA%E5%9B%BE20190504124524

I tried PHP 7.2.18 && Nodejs 10.15.3
Still not working


#22

I don’t know if it’s a permission issue. . .


#23

Have you tried disabling SELinux with sudo setenforce 0?


#24

I did not install apache.
I use nginx


#25

What user is nginx running on? Can try to get the version as this user. For www-data for example : sudo -u www-data node -v

This would at least point out if it’s related to system / user, or PHP exec function.


#26

I believe SELinux could be causing issues even if you are running nginx. I am not sure Security-Enhanced Linux has anything to do with Apache specifically? This is the first suggestion in the troubleshooting section for CentOS https://learn.userfrosting.com/installation/other-situations/centos


#27

QQ%E6%88%AA%E5%9B%BE20190506100942

QQ%E6%88%AA%E5%9B%BE20190506100805


#28

Then what should I do? Operating Apache that doesn’t exist?


#29

I am talking about this:


#30

Hey, you are talking about this! I want to try it, but can you tell me how to view the current settings?


#31

QQ%E6%88%AA%E5%9B%BE20190506115739

Always closed before this
@Amos_Folz


#32

@alexweissman


#33

I’ve just made a quick test using a CentOS 7 Vagrant Box I found online and everything works great after updating NodeJS using theses instructions.

So it’s definitively an issue on your side, not UF one. Check again for permissions issue, or PHP (CLI) config. Might have a setting in your PHP that messes with the exec function, as your issue is strictly related to this core PHP function.

A simple test to see if this work would be to execute this command directly on the command line :

echo "<?php echo exec('node -v'); ?>" | php

Which made me realize, Apache or Nginx won’t have anything to do with your issue. The webserver don’t intervene in the CLI / Bakery execution. Only your PHP CLI version will (and config wise, it can be different from fpm PHP config).

EDIT: This will also apply to permissions. Bakery command are executed with the same permissions as the user that calls the command. So nothing to do with the www user as I previously thought.


#34

Thanks, the exec function is indeed disabled, resulting in no version information for Nodejs being detected.

It is also recommended to add a function function judgment or alternative (if any).