News for hackers. Stuff that matters.
Re:Zend Framework 3 Released by jmspring on Wednesday June 29, 2016 @11:47PM (#12006427)
Interesting. It doesn't amaze me the continued popularity of PHP. The language, framework, and ecosystem just work. Plenty of people well versed in it. It's not sexy, and I've done more than a few years of consultancy there.

New energy in an ecosystem is never a bad thing.

Re:Zend Framework 3 Released by onion2k on Thursday June 30, 2016 @01:56AM (#12006850)
When I started out making web software 20 years ago the choices for server-side code were essentially C, Perl, or ASP with VBScript. Then PHP came along and made things a great deal easier because managing a server was hard, and PHP just worked pretty much everywhere. In that sense PHP was amazing.

We aren't working in that environment any more. What software runs on a server is no longer up to the hosting company. A developer/devop can configure a server far more easily, with no input from a sysadmin. The process can be completely automated. That change has opened up development options considerably. That doesn't mean writing code in PHP is a bad choice, but it does mean there is a choice. PHP's primary advantage has been eroded to the point where it should no longer impact the decision making process when you're figuring out what to use. Everything else has caught up.

Re:Zend Framework 3 Released by collyw on Thursday June 30, 2016 @03:30AM (#12007088)
As a Django dev, I don't think its anywhere as easy to deploy Django as PHP.
Re:Zend Framework 3 Released by mrweasel on Thursday June 30, 2016 @03:48AM (#12007144)
I would rather work with Pythons virtualenv and pip for dependency management, than I would PHPs Composer.

In terms of initial setup of an application than doesn't use anything but the standard library in either language I would completely agree with you.

Edit: Composer, not Artisan as dependency manager in PHP.

Re:Zend Framework 3 Released by zeitg3ist on Thursday June 30, 2016 @04:19AM (#12007224)
Having worked with both I can say that composer feels way more modern than pip.
Re:Zend Framework 3 Released by jbrooksuk on Thursday June 30, 2016 @05:31AM (#12007454)
As in Laravel Artisan? That's not a dependency manager.

Granted, Composer is slow, but it works so well, mainly when package developers tag and release packages properly though. What issues do you have with it?

Re:Zend Framework 3 Released by trebor on Thursday June 30, 2016 @09:17AM (#12008263)
If you have XDebug enabled it will slow Composer, but also several patches near the official 1.0 release improved speed massively. If you haven't tried it recently, you should try Composer again.
Re:Zend Framework 3 Released by ifduyue on Friday July 01, 2016 @12:17AM (#12013842)
Hit CTRL+C in the middle of composer install, and you will probably get an inconsistent state. Following composer commands will throw exceptions and exit. This is not a problem when it's pip.
Re:Zend Framework 3 Released by spdionis on Thursday June 30, 2016 @07:27AM (#12007790)
Except some performance issues composer is GREAT though.
Re:Zend Framework 3 Released by Navarr on Thursday June 30, 2016 @10:23AM (#12008733)
I install prestissimo[1] everywhere now. It improves speed so much.

"composer parallel install plugin" is what it calls itself - it downloads all the repositories before composer gets to the install step and then composer just loads everything from cache - super fast!

[1]: https://github.com/hirak/prestissimo

Re:Zend Framework 3 Released by spdionis on Thursday June 30, 2016 @10:37AM (#12008833)
Wow, didn't know about that, thank you.
Re:Zend Framework 3 Released by ergo14 on Thursday June 30, 2016 @08:21AM (#12007977)
Have you ever configured a secure setup for php+httpd? Because it is much easier to deploy a secure userspace python app outside of context of webserver and just proxy to it.
Re:Zend Framework 3 Released by fredsted on Thursday June 30, 2016 @09:28AM (#12008322)
Just run php cgi/fpm as another user? What am I missing?
Re:Zend Framework 3 Released by ergo14 on Thursday June 30, 2016 @03:35PM (#12011062)
Open basedir config, separate /tmp, insecure function blacklisting... tons of stuff, php-fpm is the starting point - yes.

It takes much more manual work to set everything correctly than running a python application.

Re:Zend Framework 3 Released by ben_jones on Thursday June 30, 2016 @04:56AM (#12007344)
It's literally six or seven lines in an Ansible playbook
Re:Zend Framework 3 Released by djm_ on Thursday June 30, 2016 @05:03AM (#12007371)
Learning Ansible is not easier than dragging and dropping a file onto a server and having it run with no extra work.

They weren't saying it was hard but that it is not as easy as PHP. PHP is one level up from a static site for most beginners, you can simply drag and drop a file on many shared web hosts and get going. That is the attraction.

Re:Zend Framework 3 Released by onion2k on Thursday June 30, 2016 @06:08AM (#12007555)
That's was the attraction. I guess it still is for very simple web apps that one person can build. It's been a while since I've worked on anything like that. It's probably been a few years since I've even signed up for any service like that. The web has moved on to building more scalable things.

If you're writing something moderately complex then you're very likely to be running it on a virtual instance (maybe more than one) on AWS/Digital Ocean/etc, and if that's the case then you'll go much faster if you have a testable, reproducible build process that your development team can tear down and build back up easily. That is much more complicated than FTP'ing a few scripts to a server and importing a SQL script with PHPMyAdmin, but at the same time, as soon as your service hits a few thousand users with hundreds of them accessing it concurrently, your PHP script FTP'd to a shared server probably isn't going to work very well.

Learning new things is not a reason to avoid moving forwards. If anything, it's why I got in to web dev in the first place. New things are what make it interesting. I don't learn all of them, and I don't switch tools very often, but sometimes something comes along that makes life better. Reproducible builds with Ansible/Puppet/Chef/etc is one of those things.

Re:Zend Framework 3 Released by coldtea on Thursday June 30, 2016 @08:51AM (#12008133)
>That's was the attraction. I guess it still is for very simple web apps that one person can build.

It's better to insist on simplicity at every level, whether you're building "simple one-person web apps" or "complex large-team" ones. In fact simplicity at every level would be even more beneficial in the latter case.

So I find this "dead easy deploy is only beneficial for small apps" dichotomy false.

Re:Zend Framework 3 Released by onion2k on Thursday June 30, 2016 @09:14AM (#12008251)
It's a great deal simpler to have a process that runs when code is merged in to a repo than to have a manual process of copying files to a server that relies on a human getting things right. "Dead easy to deploy" these days means "create a process that can run automatically, that checks things worked correctly, and rolls back changes if things go wrong". Doing those things manually is not simple.

If a deploy fails and a client is panicking because their app isn't available, the last thing you want is a team of stressed developers trying to work out which files they need to revert.

"Simple" doesn't mean "easy".

Re:Zend Framework 3 Released by coldtea on Thursday June 30, 2016 @07:57PM (#12012868)
>It's a great deal simpler to have a process that runs when code is merged in to a repo than to have a manual process of copying files to a server that relies on a human getting things right.

Who said it's has to be either one or the other?

The "manual process of copying files to a server" can be done simply by a person for a small scale project, and it also can be automated any way one likes -- e.g. to "automatic copy files to a server when code is merged in to a repo".

"Copy a file to a directory and the server just works and shows it" doesn't imply manual ftp uploading or manual editing of any kind -- it's just so flexible and easy that can it work that way too.

And if anything breaks, it's still simpler to find out what went wrong -- as opposed to some convoluted server deployment process with more moving parts.

Re:Zend Framework 3 Released by kijin on Thursday June 30, 2016 @09:04AM (#12008205)
> We aren't working in that environment any more.

"We" are a minority.

The vast majority of websites out there are still hosted on shared servers over which the customer has very little control other than installing and updating WordPress. You might be able to convince cPanel to let you run a Rails app, but the system as a whole was designed with PHP in mind.

The owners of those websites have absolutely zero interest in messing with the server environment. They're not developers. They've probably never heard of devops. They're totally allergic to SSH and can barely even use FTP. And yet, these are the people who, whether knowingly or not, help keep the web as decentralized as it is. PHP was the only language that catered to them 15 years ago, and it still is the only language that makes this possible on a large scale.

I host my blog with NearlyFreeSpeech.net. The whole site is just a couple of PHP scripts. I haven't updated it in almost a year, but it keeps working, no maintenance required. If I had to host it on DigitalOcean like all the cool kids do, it would cost me 10x more in monthly fees (even with the smallest droplet) and 100x more in time. This kind of setup is what I call "It just works." Not dockerfiles and bootstrapping commands and all sorts of dependency management tools.

Re:Zend Framework 3 Released by epimetheus on Thursday June 30, 2016 @10:47AM (#12008898)
>10x more in monthly fees

The smallest droplet is 5 dollars a month, do you pay 50 cents a month for your shared hosting?

>100x more in time

Have you even looked into DO or are you just making assumptions? You can create a ton of apps with one click (One-click apps) and install a full stack with WordPress, Drupal, Django, and much, much more, and it just works. If anything, it's the same amount of effort as some cPanel shared hosting.

Re:Zend Framework 3 Released by kijin on Thursday June 30, 2016 @11:29AM (#12009209)
> The smallest droplet is 5 dollars a month, do you pay 50 cents a month for your shared hosting?

Yes.

> Have you even looked into DO or are you just making assumptions? You can create a ton of apps with one click (One-click apps) and install a full stack with WordPress, Drupal, Django, and much, much more, and it just works.

My company manages servers for non-technical people whose small business or hobby websites have outgrown shared hosting. I often get clients who found out a little too late that running a Linux machine securely and efficiently is much more complicated than deploying a one-click app on DigitalOcean (or a similar service). I sweep in, optimize the hell out of everything, and occasionally patch some gaping security holes. So no, it doesn't "just work". At least not in the long term.

Re:Zend Framework 3 Released by wiremine on Thursday June 30, 2016 @09:37AM (#12008390)
> Then PHP came along and made things a great deal easier because managing a server was hard, and PHP just worked pretty much everywhere. In that sense PHP was amazing.

This. My first web programming was in Perl [1], and using PHP was much simpler to get into. You just uploaded it and it worked.

I think the biggest problem with PHP was it was a hammer and everything looked like a nail. That created a lot of spaghetti code.

[1] I still have a soft spot in my heart for Perl. I don't think it was an issue of "PHP is better than Perl", just that PHP was easier/faster.

Re:Zend Framework 3 Released by onion2k on Thursday June 30, 2016 @10:07AM (#12008611)
There are features of Perl I miss even now. tie for example. ES6's proxies can do something very similar, and that makes me happy.
Re:Zend Framework 3 Released by mrweasel on Thursday June 30, 2016 @03:45AM (#12007128)
I would mostly agree, but given my latest attempt at getting PHP based media server (Spotify clones) working, I wouldn't say that "it just works". Even with the documentation fairly good for all three solutions I tried, I managed to get non of them working.

Wordpress is an example of a PHP application that just works and deploys easily, but it also not using a lot of libraries. My take, and it may very well be wrong, is that the ecosystem is a nightmare in terms of deploying application. There's everything you could ever want though.

Of cause my experience may be down to the applications I tried to deploy.

Re:Zend Framework 3 Released by pekk on Thursday June 30, 2016 @01:34AM (#12006785)
What doesn't "just work" to the same standard? What, among the things anyone uses, are you saying that PHP works better than?
Re:Zend Framework 3 Released by siegecraft on Thursday June 30, 2016 @02:15AM (#12006908)
PHP doesn't have the library fragmentation of nodejs or the deployment friction of compiled languages like C# and Java. So when someone says "its just works" they mean they can clone a repo onto a server and see results immediately, without the intermediate steps that other languages and frameworks impose on you.