| Running php and mysql commands at terminal
|
ocon

msg:4228060 | 3:41 pm on Nov 8, 2010 (gmt 0) | I'm trying to run php and mysql commands from the command terminal. I'd like to run commands such as: php mypage.php But I can't because I get this error: -sh: php: not found What I have to do is run: /opt/php5/bin/php mypage.php I can't even find the path to run mysql from the command line, but I know mysql works because it works on the site. How can I configure my Ubuntu 10.04 setup to allow me to use short commands such as php instead of /opt/php5/bin/php and mysql instead of (how do I find the path?).
|
lammert

msg:4228136 | 6:59 pm on Nov 8, 2010 (gmt 0) | The path is in the environment variable PATH. The place where you add an extra directory to your path depends on the shell you use, but it is probably the file .bash_profile or .profile in your home directory. You can extend your path by adding the following two lines to the profile file:
PATH=$PATH:/opt/php5/bin export PATH
Be sure to logout and login again, because the profile file is only read at login.
|
ocon

msg:4228180 | 8:45 pm on Nov 8, 2010 (gmt 0) | Thank you. I located my .bash_profile. Would I add those two lines in verbatim into the document, or do I need to change anything?
|
lammert

msg:4228192 | 9:09 pm on Nov 8, 2010 (gmt 0) | If you add these two lines to the end of the file it should work, even if there are other PATH assignment statements in the profile file.
|
|
|