3 ms·
> The reality is almost any language allows you to create a single file and run it and see a web page these days. That's not something unique to PHP at all. T
by jordanlev 12y ago
> The reality is almost any language allows you to create a single file and run it and see a web page these days. That's not something unique to PHP at all.
This is not what the parent means. In PHP you get a crappy shared hosting account, and copy a file up to the server via FTP and it works. This is not possible with Python, Ruby, etc... you need to do more server setup in most cases. Sure this is due to historical reasons and maybe not specific to "PHP the language", but that is the situation that most beginners face. It's a very simple mental model as well. Services like Heroku kinda/sorta make it simpler for Ruby/Rails/etc., but understanding how those work and getting the command line tools set up is mentally more complex to a beginner.
- nkozyra 12y ago> This is not what the parent means. Well let's be fair, it's what the parent says. Even so, that's a largely outdated piece of "common knowledge" in 2014. Five years ago? Sure. Today? Not as much.
- jordanlev 12y agoGenuinely curious... can you explain to me how to get a single-file ruby or python app up and running on a normal shared host (basically anything that uses "CPanel" or "Plesk")? With PHP: 1. log in to server via FTP or CPanel "File Manager" 2. find the publicly-accessible document root (htdocs, public_html, etc) 3. upload an "index.php" file to that directory with "<?php echo 'hello world';" in it 4. visit http://yoursite.com/ http://yoursite.com/ How would I achieve this most-basic web page on a common shared host in ruby or python?
- nkozyra 12y agoIt's been a very long while since I've been in either of these, but I recall Plesk having a shell. With that the case, the Python/Ruby file could be dumped somewhere (ideally the vhost root) and then just run through the command line in a long-lived process or daemon. Port 80 is obviously taken by Apache, but other than that ...
- briatparallels 12y agoHi Jordan, I'd recommend the following. The Plesk hoster or VPS owner can prepare the environment by himself. See: http://devblog.plesk.com/2014/09/plesk-and-ruby-on-rails/ http://devblog.plesk.com/2014/09/plesk-and-ruby-on-rails/ http://devblog.plesk.com/2014/10/plesk-and-django/ http://devblog.plesk.com/2014/10/plesk-and-django/ (full disclosure, I work for Parallels & had our dev team take a look at this question.)