1

What is the path to the PHP interpreter in the CS50 appliance? I used it a couple times but I forgot what the path is. I think it starts with #/env or something similar.

Thanks, David

1

If I understand correctly you mean the path to php interpreter so that to use a #! to make it executable. It's #!/usr/bin/env php.

3
  • Yes that's it! Thanks!
    – i_am_david
    Aug 7 '15 at 15:05
  • You know what to do. ;)
    – ChrisG
    Aug 7 '15 at 15:06
  • Yep! :) Done! Thanks
    – i_am_david
    Aug 7 '15 at 15:10
1

I think the simplest answer is php <filename>.

So if you have a php file called hello.php that looks like this:

<?php
printf("Hello, world!\n");
?>

you would run php hello.php and you'd get Hello, world! as the output on the screen.

Is that what you mean?

1
  • It's not what I meant, but it works. Chris had what I wanted, sorry I'll have to accept his answer. Either way I'll upvote yours.
    – i_am_david
    Aug 7 '15 at 15:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .