Environment Path

apps

#1

Hi everyone.

I have been installing ffmepg mencoder et al.

While in the command line I have to use:

export PATH=$HOME/bin:$PATH

In order for the server to pick up the correct path for where mencoder is installed. On logging out and logging back in again I must set the path once more.

Could someone please advise how I set the PATH permanently? My php scripts are calling the same command but NEVER returning any output - which makes me beileve that the app is not being executed as its not present in teh path.

Thanks in advance…


#2

Look at ‘man bash’, section on “Invocation”. Login shell, .bashrc, .bash_profile…

–rekraplr (for Maximum discount, $97 on yearly plans)
101010 For the Win! (110 off!)


#3

thanks for teh quick reply…

Sorry but I failed to point out that I am very much a noob in this area.

Could you please give a little more detail? Like to I have t o edit one of these config files or something??

Sorry but I am a developer - we sometimes lack the capacity to deal with the stuff that actually runs the stuff we do! (the irony)


#4

Would any be so kind as to provide an example on how to edit the .bash_profile so that I can permanantly prepend directories to the $PATH.

Cheers peeps…


#5

[quote]Would any be so kind as to provide an example on how to edit the .bash_profile so that I can permanantly prepend directories to the $PATH.

Cheers peeps…[/quote]
Ok, maybe these steps will help :

  1. Make sure you have a user account which SSH enabled. You can check it via panel. Make sure your user type is “shell”.
  2. Login to your server via ssh. Under windows you can use putty. Download it and run it. Specify your host and use ssh method.
  3. Enter your user and password after login screen.
  4. Edit .bash_profile by typing “nano .bash_profile”
  5. After editing the file. Press CTRL-O (write out) or CTRL-X (write-exit). Giving answer to some prompting message.
  6. Done

Hope it helps :slight_smile:

Supernova

PROMO CODE [color=#CC0000]SUPERNOVA[/color]=$97 OFF ON YEARLY PLAN SIGN UP NOW


#6

Thank you VERY much…

Couple of q’s…

I have seen some tutorials etc. etc. giveing details on how to edit the .bash_profile file.

IN one it uses ‘vi .bash_profile’ - is nano just another editor???

One problem I am having relates to the installation of lame. I have added the line

LD_LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH

to the .bash_profile but when I call mencoder I get an error stating that the libmp3lame.so.o is not a directory of file - i.e. it can’t find it. I installed LAME with -enable-shared and so I am at a bit of a loss as to why it can’t locate the lib.

Could you possible shed any light as to why???

I should add I installed mencoder 1.0rc2 and could only get it to configure using just ./configure…

I tried ./configure --prefix=$home --with-codecsdir=$HOME/lib but it errored (even if I remove either -prefix=$HOME or --with-codecsdir=$HOME/lib)

Cheers…


#7

Yes… nano is another editor that being installed in DH’s server. It is more convenient if you are not familiar with cli based editor like vi.

What did you get when you run echo $LD_LIBRARY_PATH ? And can you get any result with ls $HOME/lib/libmp3lame.so.o ?

I suspect that may be your build is not perfectly successfull, hence libmp3lame.so.o is not in your $HOME/lib/ folder.

Supernova

PROMO CODE [color=#CC0000]SUPERNOVA[/color]=$97 OFF ON YEARLY PLAN SIGN UP NOW


#8

echo $LD_LIBRARY_PATH
/home/USER/lib:/usr/local/lib:

ls $HOME/lib/libmp3lame.so.o
ls: /home/questijn/lib/libmp3lame.so.o: No such file or directory

cd lib
ls
libavcodec.a libavformat.so libavutil.so.49 libmp3lame.la pkgconfig
libavcodec.so libavformat.so.51 libavutil.so.49.5.0 libmp3lame.so vhook
libavcodec.so.51 libavformat.so.51.17.0 libdha.so.1 libmp3lame.so.0
libavcodec.so.51.47.2 libavutil.a libdha.so.1.0 libmp3lame.so.0.0.0
libavformat.a libavutil.so libmp3lame.a mplayer

I see that .so.0 exists but not .so.o

I really need this working as soon as possible - will be willing to donate to your paypal…

The additional stuff I need answered is howe to make this stuff availabel to php.

In my command line if I type ‘which mencoder’ - I get ‘/home/USER/bin/mencoder’ - I pass teh same command via exec in php and prinit the result I get an empty array.

Similarly in the command line if I type which ffmpeg I get ‘/home/USER/bin/ffmpeg’ while php gives ‘/usr/bin/ffmpeg’ - the gloabl one available on dreamhost.

I have edited the .bash_profile file in bothe the root and in /etc AND created /etc/profile and edited the .bash_profile in there.

Non of these has got th ephp exec command pointing to the correct directories for my installed apps.

Help Help Help.


#9

Apparently so.o doesn’t exist there.

[quote]In my command line if I type ‘which mencoder’ - I get ‘/home/USER/bin/mencoder’ - I pass teh same command via exec in php and prinit the result I get an empty array.

Similarly in the command line if I type which ffmpeg I get ‘/home/USER/bin/ffmpeg’ while php gives ‘/usr/bin/ffmpeg’ - the gloabl one available on dreamhost.[/quote]
Have you tried exec(‘home/USER/bin/mencoder’, $arr_output, $return_status) ?

Supernova

PROMO CODE [color=#CC0000]SUPERNOVA[/color]=$97 OFF ON YEARLY PLAN SIGN UP NOW


#10

OK I have just re-installed lame using the following config…

./configure --prefix=$HOME

When I run ./configure --prefix=$HOME --codecsdir=$HOME/lib

cheking the output it states…

Checking for libmp3lame (for mencoder) … no


#11

I don’t quite have a good knowledge at this multimedia things, but is it correct that we need to install - somehow - libmp3lame library instead of just ffmepg, mencoder ?

Supernova

PROMO CODE [color=#CC0000]SUPERNOVA[/color]=$97 OFF ON YEARLY PLAN SIGN UP NOW


#12

I managed to get mencoder installed WITH libmp3lame support by NOT including teh codecsdir in teh config…

./configure --prefix=$HOME

now it runs AOK! :slight_smile:

However… running the following from php

exec(’/home/USER/bin/mencoder /home/USER/quest4fame.com/mediatmp/64.mpg -o /home/USER/quest4fame.com/flvideo/12.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=800:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=390:290 -srate 22050’, $op);
print_r($op);

simply yields empty array - ie the mencoder is not called.

I have edited .bash_profile in my root, /etc AND etc/profile (which I had to create) and still no joy!

Really need to get the call from php to the mencoder working asap…