Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-24-2011, 02:16 PM   #1
LQ Newbie
Registered: Jun 2006
Distribution: Gentoo
Posts: 27

Rep: Reputation: 15
How do I use bashrc to redirect an executable call?


I need to redirect a /usr/sbin/sendmail command to $HOME/bin/msmtp .
The sendmail command would be coming from a PHP5 application.

I'm assuming the best way is to use .bashrc, but .htaccess is also available.

The remote server is a shared web host which is running Debian 4.0.

I do not have root access.
I have SSH access.

Any ideas?

Old 05-24-2011, 02:27 PM   #2
Nominal Animal
Senior Member
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 947Reputation: 947Reputation: 947Reputation: 947Reputation: 947Reputation: 947Reputation: 947Reputation: 947
Originally Posted by georgejc View Post

I need to redirect a /usr/sbin/sendmail command to $HOME/bin/msmtp .
php_value sendmail_path /home/georgejc/bin/msmtp
to the relevant .htaccess file, and make sure /home/georgejc/ and /home/georgejc/bin/ and /home/georgejc/bin/msmtp are all executable (for the Apache user at least).
Old 05-26-2011, 10:03 PM   #3
LQ Newbie
Registered: Jun 2006
Distribution: Gentoo
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks for the quick reply!

Unfortunately, when I put this in the .htaccess file, it causes a server error.

I assume I can use this, or something similar, inside a php.ini file.
I'll try that next, and post back here with my results.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unix Function call to get executable's path vharishankar Programming 13 04-20-2010 12:53 PM
call the C executable inside the C is noname Programming 9 01-09-2010 09:28 AM
problem of function call address in executable file valpa Programming 12 09-05-2008 08:36 AM
Setting path: /etc/profile, /etc/bashrc or ~/.bashrc Swakoo Linux - General 1 08-07-2007 10:59 PM
Redirect Output from execvp( ) call Francinoman Programming 9 11-06-2006 02:26 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration