You are here: Re: run php directly at shell « PHP Programming Language « IT news, forums, messages
Re: run php directly at shell

Posted by David Haynes on 06/03/06 11:33

vito wrote:
> "Michael Vilain" <vilain@spamcop.net> wrote in message
> news:vilain-74AD59.02180503062006@comcast.dca.giganews.com...
>> In article <e5rj5q$27d3$1@justice.itsc.cuhk.edu.hk>,
>> "vito" <vitogen2003@yahoo.com.tw> 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?
>> it should be in your path already. try discussing your account with
>> your local sysadmin. they should be able to set your account up to do
>> this without a problem.
>>
>
> well, even though it is added by
>
> set path = ($path /usr/bin/php)
>
> it can't recognize the interpreter and run it directly. the first ? in
> <?php> immediately generates an error.
>
> thanks for your help anyway :)
>
>
This is if you are running the cshell. (echo $SHELL will tell you)
For sh, ksh, bash use: export PATH=$PATH:<path to php directory>

For example:
If your php was installed as /usr/local/bin/php, you would set:
export PATH=$PATH:/usr/local/bin

This will last for the life of the login session. If you want it
permanently you will have to add this command to your shell run-time
commands file (e.g. .bashrc)

-david-

 

Navigation:

[Reply to this 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

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