You are here: Re: php-cli for system admin? « PHP Programming Language « IT news, forums, messages
Re: php-cli for system admin?

Posted by Dikkie Dik on 02/25/07 11:10

> For real, could php-cli be useful for system admin tasks?

Theoretically yes, but in practise...

> I doubt php-cli will ever match perl, or python, for a sys admin
> scripting language. But, does php-cli come close enough to the sys
> admin power of those languages that php might actually be useful for
> admins?

I am afraid that all depends on the OS and off course what you want to do.

> As far as I know, nobody seriously uses php for a shell scripting
> language. Is that just because perl is so well established? Or because
> php doesn't have the power?

I *did* try it. There are things that should be done on a web server
with scripts, and PHP is the only language that is guaranteed to exist
on both the development machine and the servers the site has to be run
on. And PHP tends to be pretty OS-inspecific, so I wanted at least some
testscripts done in PHP. There are a few drawbacks:

- Parameters are not passed, unless you specifically call the language
interpreter. so "testdir.php somedir" will not see the somedir
parameter, but "C:\PHP\php.exe testdir.php somedir" will. I think a
sysadmin was able to fix this under linux, but I do not know how.

- When running windows, created directories are read-only. I had to
shell out to dos just to create a directory in a useful way. Off course,
all OS-independence stops here. Under linux, you can give the create
flags, but these are ignored in windows.

> ..., but all I find were "hello world" type examples.

Well, that will work, but the rest may requires som more testing, I'm
afraid.

Best regards

 

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

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