Hacker News new | ask | show | jobs
by mschuster91 3666 days ago
I usually write shellscripts in PHP. Works pretty good, and PHP is by far easier to write than either bash scripts or Windows shell script - not to mention that one single syntax can be used for both OSes, which is nice when you do development on both Linux and Windows, and even nicer when you're also developing on OS X which ships a horribly outdated bash (and other coretools).
1 comments

I am by no means a PHP hater (I do some PHP dev for work) but PHP not only has multiple versions (4, 5, 5.3) but has a ton of modules for everything (curl, mbconv, openssl, etc) that have to be setup the same way for you to get the same behavior across OSes. Not sure it makes a great shell script for that reason.
On systems I control, I currently stick with the latest PHP5 release, unmodified - either the distro maintainer version, or in case of Windows, the official binaries.

Configuration customization isn't really needed, only the usual date.timezone to get rid of the warning (and hell, this is annoying! can't PHP just use the OS-provided time zone?!), and in extremely rare cases the memory limit and max_execution_time.