Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can also do it in one golang file. Or one python file. Or one nodejs file.

With PHP you have more moving parts, Apache/Nginx with their configuration and then the PHP script. With golang/rust/python/nodejs you have direct access to the webserver and more control, but the same simplicity.



>With PHP you have more moving parts, Apache/Nginx with their configuration and then the PHP script. With golang/rust/python/nodejs you have direct access to the webserver and more control, but the same simplicity.

From my limited node experience I had to setup Nginx too and then connect it with node, and setup some manager like "pm" to keep the things running.

When people say PHP is simple to setup they mean the customer buys some web hosting, and then puts the files there (at most you setup the db credentails and table names ). The customer will not need to hire a sys-admin that will have to use latest docker stuff or try to fix the issue that your customers runs RedHat but the developer wants to use X npm package but X needs some new npm and node version and now the sysadmin needs to make it somehow work.

I am not saying PHP is superior, if you are expert in Java, .Net, Python etc continue using that if it makes sense, in reverse if you (your team) are PHP experts then it is a waste to not exploit that experience. You might say that you should fire the good PHP developers that worked for you for years and take a chance on finding some CoolLang experts, from my experience is not easy to find good developers(in all dimensions not only good at reciting best practices), developers that you know that will not leave after 1 year because they want to work on new shit, developers that like to do their job for the end product , for the customer satisfaction and not just like to code because the language is cool, the framework is popular, the IDE colors are shiny and for the CV. If you have a good developer or team , use it.


The OP I responded to was about having a quick script up and running. Of course for a fully fledged app you might have a reverse proxy or similar.

Also PM is just a simple hypervisor, it doesn't have any logic, while Apache and Nginx do.


Are you talking about the dev workflow?

My point was that I already have a cheap webhosting, with a domain and email and I can now just login into cpanel and paste a script.

As a developer as other mentioned there are ways to run stuff from CLI, so IMO PHP is pretty equal with python or ruby , not sure there is a general clear winer so it always depends on the project and the team.

But if you are a new dev and you don't know any of the languages I would say start with Python, even if I prefer the C syntax. I got into PHP indirectly, I worked on desktop applications and I was asked to help with a web project so I learned it by doing (but I was already experienced so I did know what are some good practices), in the end desktop applications are no longer popular so I am still working on SPAs


php -S

if you want a quick script up and running


For someone who's not developer, PHP is way more simple to deal with. Upload to your FTP, follow some script or edit config file, get it up and running.

That's much more complicated with virtually every other language.

I mean, this has been going for decades, I didn't think it was up for debate. There's close to zero sysadmin skills required for dealing with PHP hostings, most of them have CPanel or something similar, most of them are very cheap, and there are plenty.

There's nothing similar for Python or any other language.


Vhost doesn't give you that kind of access, AIUI. They simply serve multiple users from shared webserver infrastructure using Host: header to disambiguate. (User-specific paths like www.vhost.com/~foobaruser/ used to be an option, but modern web security mechanisms rely on the base domain as an indicator of site-level 'context'.) That makes it quite isomorphic to lightweight "serverless" cloud hosting.


For development you don't need apache/nginx: https://www.php.net/manual/en/features.commandline.webserver...


> Or one nodejs file

And 98726354 packages that get pulled when you `npm i express`




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: