Reply to Re: run php directly at shell

Your name:

Reply:


Posted by bobmct on 06/03/06 10:07

vito wrote:

> how to config the linux to know the path of /usr/bin/php so no need to
> type it before running a php script every time?

You need a "shabang" at the top of your script. That is... a line to tell
the shell which program to use to run this script.

First, determine the path of your php interpreter with this command:

"which php"

and it should print out something like "/usr/bin/php"

what ever it states, use it verbatim at the top of your script (the VERY
FIRST statement) similar to this:

#!/usr/bin/php
<?php


Then save your script and it will run as you expect.

Good luck,

Bob

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация