Skip to main content

Add /usr/local/bin to Environment PATH

Comments

5 comments

  • APatchworkBoy
    You used to set the full path to each of the necessary CLI tools directly within ClipBucket's Admin Panel, which would then be prefixed in front of the executable - is this no longer the case...? (Go to admin_area > Website Configurations > Upload and Conversion Settings)
    0
  • icishoot
    It may in some areas - I haven't gotten that far. Something isn't right with the software - even with it having all the correct paths it won't convert video, and if you go to toolbox -> server modules info, site locks up. When it tries to use shell_exec("PATH=\$PATH:/bin:/usr/bin:/usr/local/bin; bash -c /usr/bin/php --version 2>&1") the site locks up. It was while I was investigating this that I noticed the PATH issue. They could be unrelated - I very well could have gone down a bunny trail trying to fix a minor issue. though having slept on it and taking an other look, I'm wonder if that php issue could be related to the command calling /usr/bin/php, but /opt/cpanel/ea-php70/root/usr/bin/php-cgi is what actually gets run? time for more digging I guess. Thanks for your input - it may have refocused my investigation
    0
  • cPanelMichael
    Hello @icishoot, If you wish to export a system path to the user's environment, you can add a line similar to the one below in the /home/username/.bashrc file: export PATH=/opt/cpanel/ea-nodejs10/bin/:$PATH
    In this example, the modification allows for the use of the "node app.js" command from shell instead of the "/opt/cpanel/ea-nodejs10/bin/node app.js" command. In your example, you may also want to review the document below regarding the ea-php-cli package: EasyApache 4 and the ea-php-cli Package - EasyApache 4 - cPanel Documentation Let me know if this information helps. Thank you.
    0
  • icishoot
    Adding export PATH=/opt/cpanel/ea-nodejs10/bin/:$PATH to /home//.bashrc didn't do any thing. To test, I wrote a simple script: Running it in browser I get: /bin:/usr/bin running echo $path from terminal I get: /opt/cpanel/ea-nodejs10/bin/:/home/*****/perl5/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt/bin:/opt/cpanel/composer/bin:/home/sdbtest/.local/bin:/home/*****/bin ****'s being the username. And yes, I know the path given by cPanelMichal has nothing to do with php - I just threw it in there to see if it would show up. Results: the path that a script uses when run through apache/php is different then when echoed straight from a terminal. And looking at the path echoed at the terminal, the directory I want to add is already there - something must be changing the PATH. In doing a little more searching - it seems apache or the php handler is the one that sets the environment variables for PHP - Some one back in 2012 posted here with my exact same question, the answer then was to use mod_php and add the export path command to /usr/local/apache/bin/envvars - I'm using suphp and and the envvars path doesn't exist. Seth
    0
  • cPanelMichael
    Hello @icishoot, Thank you for sharing the additional information. I believe you're looking for the "putenv" PHP function: [QUOTE]putenv " Sets the value of an environment variable
    Here's a comment from PHP's documentation of this function with background information about how it works: PHP: putenv - Manual Can you confirm if this aligns with what you're attempting to configure? Thank you.
    0

Please sign in to leave a comment.