
Ask HN: I can't stand PHP anymore. What else can I choose? - juliend2
All my clients use shared hosting such as iWeb.com (which does'nt have Shell access). Mainly because they don't want to pay a lot for a _reliable_ webhost.<p>My problem is : As a language-snob (i know, it's sad), i'm immensely bored about PHP. I want to learn another back-end language that i can use on my freelance web jobs.<p>I'm considering learning Perl. But Perl needs modules to extends it's possibilities, this i cannot do without Shell access. And it's also better to run it as fastcgi or mod_perl, things that shared hosting does not always support.<p>I know Ruby, but hosting Ruby is not cheap enough, or accessible enough for my clients.<p>Do you guys have any idea of a web stack or shared host that does the job?<p>What do you do when you can't stand PHP anymore?
======
SwellJoe
Unfortunately, the reality is that PHP is dramatically easier to ship out to
crappy shared hosting providers than any other language. Perl, Python, and
Ruby are easy if you just use CGI...but they are increasing degrees of slow
(with Perl generally being the fastest of the lot and Ruby being the slowest,
when used in a pure CGI configuration). Perl is definitely the second most
deploy-able language after PHP, due to its historic popularity, but it is
still way behind when it comes to "untar the directory and everything just
works" style deployment. And it isn't necessarily going to be _fast_ in the
types of Perl deployments many shared hosts allow.

Someone suggested Java, which is way out at the farthest end of the "hard to
deploy on shared hosting" scale. In fact, I doubt you can find any way to host
Java effectively for less than $25/month, and probably more if your app is at
all popular. It's just a horrible choice if deployment is a big factor in your
decision-making process.

FastCGI is getting easier and easier to get in shared hosting environments,
and all of the major web app frameworks in all of the major languages support
it (including Catalyst in Perl, Ruby on Rails in Ruby, and Django in Python).
Since FastCGI is a better way to run PHP in a shared hosting environment
(mod_php has serious security implications), as well, I'd recommend you start
insisting on FastCGI support from your host, no matter what language you use
for development.

So, I think what folks ought to be recommending is that you go with a host
that provides FastCGI and shell access. And then you can decide which
language(s) you want to experiment with.

------
edw519
"What do you do when you can't stand PHP anymore?"

Reevaluate what's really important to you.

I love to program, but it's NEVER about the language. I know many of them, and
AFAIC they all have their pros and cons. I suppose that if I was a "language-
snob", I'd be "immensely bored" too, no matter which language I was using.

So if it's not about the language, then what is it about? You already answered
your own question with the first 3 words of your post.

It's about your clients. Always. They have needs far beyond their ability to
express them. And they need you.

Stop being a "language-snob" and start being a "solutions-snob". You'll never
be bored again. Promise.

~~~
juliend2
What do you mean by being "solution-snob"? Looking for the appropriate
tool(language) for the given task? Thanks in advance.

~~~
tptacek
I'm guessing no, that instead he means thinking more about what you're going
to write than about what you're going to write it in.

------
tracy
Learn python. It's an excellent all-round language, you can also create
desktop stuff later. Hosts like webfaction just cost $10 a month, surely your
clients can afford that.

~~~
siong1987
Try Google App Engine if you want to use python.

------
j_baker
Look for webfaction as a hosting provider. It's cheap and you have lots more
options than just PHP. Plus you get shell access. You can even set up your own
apache instance.

Other than that, don't worry too much about the language. Find something you
like and stick to it. Just remember to always learn new things and don't get
set in your ways.

~~~
iamelgringo
++ for web faction. They're really inexpensive, straight forward to use, and
you can use Rails, Django, Merb, Pylons, etc... Plus, you get shell access,
and you don't have to do a lot of the server admin stuff if you don't want to.

------
wooby
If you're comfortable with Linux, an option for you is running a Linode or
Slicehost ($20/month) and hosting your clients on it. This will give you total
control of the hosting environment, and a residual income. You'll have plenty
of horsepower for Rails or whatever else you want to use, and as you grow, you
can buy more nodes.

Beware, though: when you put on a system administration hat you're taking on a
lot of new responsibilities, including backups and security. It's also a good
idea to bring your friends in on it, so if something goes wrong they can look
into it for your client if you're away.

So, it really depends on your level of comfort with sys admin stuff, and the
kind of relationship you have with your clients. Good luck!

~~~
jrockway
A basic $20/month Slicehost or Linode is probably going to be good enough for
2 "real" applications and maybe a few CGI pages, but not much more. The
limiting factor is memory -- modern languages like to use a lot of it.

~~~
radu_floricica
Remember the 80/20 rule. Most of the sites only have a couple of clicks per
day. Right now we have around 15 sites and two rather heavy apps on a 512
slice. We always intended to upgrade it, but it turned out not to be the case.
On a 256 slice we had all the sites confortably.

As for the few sites which get a lot of traffic... they should also generate a
bit more income and an upgraded slice.

------
Zak
You might want to have a look at haXe - a language that compiles to multiple
backends including PHP, Javascript and Flash. It's not my favorite language by
a long shot, but it's not PHP.

~~~
juliend2
I think that it's Exactly what i was looking for! Thanks a lot. I will
definitely look at it! :)

~~~
tptacek
Delivering work for paying clients in a vanity language because you're bored
of PHP sounds pretty close to malpractice.

~~~
Zak
It does, but using haXe based on its merits isn't. It's not hard to find good
reasons to avoid PHP as an implementation language; PHP is popular mostly
because it's as easy platform for deployment. If a superior language[0] allows
targeting that platform, it's a win-win situation. The obvious counterargument
is that it makes finding developers harder, but I don't think that's the case.
The Python Paradox applies here, and there are likely dozens of developers
available who would jump at the chance to get paid to use haXe.

[0] I am not, at this point arguing that haXe is a better language than PHP. I
don't have enough experience with haXe to make that claim, but it's not an
especially high bar to clear.

~~~
tptacek
We don't have to get into a debate about PHP (I don't use it either); its
virtue in this scenario is that after this guy gives up on the client, someone
else can easily step in and pick up the project, because everybody knows PHP.

~~~
Zak
I think the degree to which this works depends on the sophistication of the
code. If it's a simple form handler, then sure, it's an advantage to be using
a language that millions of people know. If it's more sophisticated, it may
actually be a disadvantage; the non-technical client has to sort through
hundreds of responses to a job posting with no useful means of telling
applicants apart. A language like haXe currently only attracts those who are
genuinely interested in better languages. Such people tend to be decent
programmers, so any of the 5 or so people who respond is likely to be a good
choice.

------
mannicken
Is Ruby hosting that expensive? I've seen hosters that do it under five bucks
a month (like <http://www.hostingrails.com/> ).

~~~
juliend2
Thanks for the info. I did not know about hostingrails.

~~~
nanexcool
<http://www.bluehost.com>

I personally use it for PHP, but it supports Ruby/RoR, it's cheap, and I've
never had any problems with it.

------
radu_floricica
I don't think you should dismiss a language so fast for hosting reasons. Yes,
they are a thing to consider, but "The Thing"?

We offer all our clients hosting on our slicehost server, for at least a year
free (so far we haven't bothered to ask after a year either). It's clean,
fast, cheap, and lets you do development and updates much faster. No system
administration to speak of (long live apt-get).

------
mtarnovan
Prices for hosting Ruby should fall once mod_rails sees more widespread usage.

------
pkeane
Python + Google App Engine

~~~
bemmu
After switching to this combo, I find myself reluctant to continue work on my
apps still using PHP & MySQL. They feel somehow... fragile now. Before I used
to check on my servers all the time, now I feel peace of mind that my app is
still running, even though I haven't checked on it for a while. I feel like I
might even be able to enjoy my coming vacation.

------
keefe
Java! I may be in the distinct minority here and particularly prejudiced since
I started with Java in 98.... Java has the best IDE (eclipse), a slew of open
source libraries, Groovy if you have it up for dynamic language syntax and
with JIT etc. innovations it's pretty much as fast as C++. I think Java is the
perfect OOP trapped inside some slightly ugly, easy to compensate for syntax.
Also, easy to deploy dynamic apps with Tomcat, great user community, stable
API...

------
pmikal
perl:

You do not need shell access to install modules locally. Anything you can do
from the shell, you can do from Perl with system(), backticks, or piped
open(), but really... no shell access?

You want hosting that is reliable, supports shell access, rails, and 100%
uptime, but your not willing to pay more than $5/month ?

~~~
juliend2
i completely get your point. unfortunately i dont choose my webhosts. my
clients does. but when i can, i tell them to take a linode slice.

------
juliusdavies
Dreamhost is cheap and has shell, perl, ruby, and php.

~~~
juliend2
Yes i tried them. That's why i mentioned "_reliable_ webhost" ;) . But yes,
some websites could be hosted with them, it's just not good enough when we
need something to be 100% uptime.

~~~
j_baker
Plus, using things other than PHP is still pretty difficult with dreamhost.

~~~
juliusdavies
It is? Here's a python CGI script:

<http://juliusdavies.ca/svn/viewvc.cgi/not-yet-commons-ssl/>

The viewvc.cgi starts with:

#!/usr/bin/env python

I just dropped the script into my ~/juliusdavies.ca/svn/ dreamhost directory.
Didn't seem hard to me.

~~~
j_baker
Well yeah. For a plain old CGI script it's not terribly difficult. But that
just doesn't scale well nor is the script easy to write. Consider the
instructions for setting up django on the other hand:
<http://wiki.dreamhost.com/Django>

This is much more complicated than it needs to be. Especially when I can just
log into my account with webfaction, click "install django application" and be
done with it.

------
kajecounterhack
Python and Django!

~~~
peterbraden
seriously - this.

Django allows you to do far more with less code, and python is the finest
language in which to code ( :) ).

I've advised loads of people to switch from php to django - and have had no
complaints yet.

------
warhammerkid
What framework are you using for your PHP work? If you aren't using a
framework (because your work doesn't need one), then switching languages
probably isn't going to change much, but if you are, there are several good,
fun PHP frameworks out there. The best PHP framework I've used is Symfony
(<http://www.symfony-project.org/>), which is actively developed, fun to work
with, and really powerful.

~~~
gchucky
I've worked in CodeIgniter, but these days I find myself using the Zend
Framework (<http://framework.zend.com/>). They're actively developing it, and
it has so much built-in functionality that I've been able to get stuff done
much faster than before.

------
wenbert
Why not setup your own hosting for your clients? Problems always arise when
you give the client options on the server. They do not know these things.
Usually they always opt to have the cheaper plan -- they are not technical
people.

I have been using PHP for years now - no problems so far. Especially when Zend
Framework came.

------
abyssknight
Your options are limitless, really but here are a few:

1\. Pick a framework to make your PHP work less boring (CakePHP, CodeIgniter,
Symfony)

2\. Ruby on Rails or Python & Django

3\. Slicehost ftw.

These days you can find a cheap host for just about anything except the
Microsoft stack and even that you can get for a reasonable price.

 _If your clients are that cheap, get new clients._

------
RossM
I don't know whether you'd need shell access for Python (I'm only just
starting to learn it myself) but that could be an idea to consider.

~~~
mooism2
Using Python would have the same problems as using Perl, wouldn't it?

~~~
j_baker
Not necessarily. You just need to put whatever libraries somewhere on your
python path.

~~~
SwellJoe
That's identical to Perl or pretty much any other dynamic language. Just as in
Python, you can even modify your library path within the code itself, and use
relative paths (so you can distribute apps in a directory and not require the
end user to modify their webserver CGI shell execution environment).

e.g. something like:

    
    
        BEGIN { push(@INC, "./lib"); };

------
ropiku
<http://heroku.com> isn't that expensive and it's easy to scale as needed.

------
zealog
Heroku is great (and free) for building and trying Ruby on Rails apps.

------
santacruz
With such approach you will hate your next lang in no time.

------
vyrotek
Asp.net MVC

~~~
keefe
What is the motivation for locking yourself into the micro$oft stack? Why not
use Java with a javascript (jquery/yui/ext etc) front end or even (shudder)
JSPs? Spring framework? Anything but .net lock in...

~~~
jasonkester
The tools.

Spend a week writing C# in Visual Studio.NET with ReSharper installed, then
try to go back to your old language and IDE. You'll understand.

~~~
greggraham
I spent a year writing C# in Visual Studio and ReSharper, and it is nice, but
I'm happier now doing Python with Emacs and the command line.

~~~
Longhorn213
You are the exception rather than the rule. I love VS even without ReSharper.
I haven't found a better IDE than VS.

------
hs
i use newlisp for my web apps

------
abalashov
Java?

------
octane
Become a real solutions provider and lease a colocated server and move your
clients to it by offering them competitive pricing. You might even make a
profit.

------
skwiddor
CGI, then use what you like. A few of my friends are building
<http://werc.cat-v.org/> but it's teaching me CGI still has a lot to offer.

