suddenly "Terminal" cannot find any commands. ALL GONE. "command not found" !!!!!! yi


I'm working with the Friends of Ed book PHP 5 for Flash.

I did the "sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.conf.original"

then the:
ls /etc/httpd
sudo pico /etc/httpd/httpd.conf

this was to uncomment the php stuff

sudo apachectl restart

everything good so far

then: pico ~/.profile
move cursor to new line following any content

it wouldn't move so I figured it was where it belonged

then I typed: export PATH="$PATH:/usr/local/mysql/bin"

I figured all was well. I was wrong.
I went to check the version of Apache:
-bash: httpd: command not found

NO commands are found now. Not sudo, not cp, not pico, not even ls. What happened and what do I do to fix it??!!

I restarted... nothing works still. It looks like it's trying use "bash" as a command.


Terminal works fine from a new user that I created but that sucks.

Any Ideas about what I broke or how to fix it?

revert the <your_main_account>/.profile to its original state.

log in your new user account
cd <your_main_account>
sudo cp <your_now_account>/.profile .
command not found

how 'bout I throw out <my_main_account>/.profile ?

none of my other accounts have a .profile file in them and they work fine.
try to rename it .profile.old
quit terminal, relaunch terminal.
You broke the path variable. But you probably already know that...

Looking at what you describe, that should work, so my guess is that you mistyped something in ".profile".

Log in as the new user. Start Terminal, and type "su root". This is rather dangerous, as you now can do anything to your system, and will not be warned if you do something wrong, so proceed with great care.

Move to you old accounts home folder ("cd /Users/your_old_accounts_short_name/"). Type "pico .profile", and check the contents. Chances are that the only thing inside is the line you wrote earlier. Examine it carefully, and you'll probably see that you either forgot something, or mistyped. If you didn't, just exit pico (which is probably nano btw, if you're using Tiger) and remove the file.

My advice, if you're going to be using MySQL, don't bother with the CLI in Terminal. Get MySQL Administrator and MySQL Query Browser from the MySQL site instead.
to hell with su root. Scares the shit out of me. I just went in with text edit and saw that I was missing "$" before "PATH:/usr/local/mysql/bin", put one in there and voila.

Thanks, all better now. Is there a resource on the web that deals mostly with the terminal and it's commands? (I'm new to it.)

Thanks again,

btw, Friends of Ed author, DAVID POWERS, author of the php 5 Flash book, was NO help. his response was:
Bad news, I'm afraid. I don't have the faintest idea what happened. I have checked the instructions in the book. I have checked your post. I have reproduced exactly the same steps on my own test machine. They all work perfectly.

If your Mac uses the bash shell, and you have followed the instructions in the way you describe, nothing should have gone wrong. Have you tried opening a different Terminal window? Restarting your computer?
That forum posting is here.
You did state that you actually typed in the very thing you should've (but didn't) typed, so it should've worked, right? He might not be as used to students misrepresenting what they actually did as we are here...:D

BTW, if you really want a really, really good book, with great support, try the Sitepoint guys. They've written the best PHP5 books out there as far as I know. They are called "PHP Anthology", volume I and II. You can download a couple of chapters for free, to see for yourself what they look like, before you buy. And it isn't snippets either, its the whole chapters, nothing withheld.

You can also download all the code from their site, every last bit of it, so you don't have to type it all in. That way you can concentrate on experimenting with the code instead of taking typing lessons...

The whole approach is object oriented, and it's a good introduction to object oriented PHP even if you've never tried that approach to programming before.
Fair enough. I was frustrated at the time I wrote that and figured that the guy who wrote the book on it...
Anyway, sorry Mr Powers.
And thanks for the tip on PHP Anthology. I'm on my way to check it out.
mermagen said:
Is there a resource on the web that deals mostly with the terminal and it's commands? (I'm new to it.)
I have found very helpful in this respect. They have a fantastic UNIX tutorial in their Learning Centre, but you have to watch out for them using the tsch shell to begin with (since the tutorial was written for Jaguar). It's where I learned all my Terminal skills! The tips of the day are great too.

Not that I'm trying to drag people away from this site, of course! :D