Live data from Hacker News

An Internet of PHP

timotijhof.net

301–310 of 333 posts

Re: An Internet of PHP

#301

From W3Tech; > PHP is used by 77% of all the websites whose server-side programming language we know. I had a quick look at the methodology section, but it’s not clear to me how accurate this data is. Determining whether a site uses PHP can be relatively straightforward (especially with default extensions / if Wordpress is used / etc), but if a site (potentially using a different language) is behind a reverse proxy/u…

I agree. I always doubted these figures (I'm a PHP dev myself, so I wouldn't mind these figures being true). I think the methodology is shady. I wonder if they use what the server indicates. I think some servers like Apache with php mod send this information to the client in a header. But most servers don't. Therefore they maybe use this as "from all the servers giving a backend language information, PHP represents 7…

You could just click a couple of times to find the W3Techs methodology and data gathering process described, here:

https://w3techs.com/faq

No need to speculate about how it works.

tl;dr A lot more than looking at Apache headers or WordPress meta tags.

Re: An Internet of PHP

#302

Earlier quoted context omitted.

that's very true. But it is true for PHP as it is for any other language or tech that is at least a decade old. Interesting fact: chatgpt can recognize old stuff and give better recommendations

Still, somehow it’s more true for php.. maybe because other languages invest more in migrating to newer standards. Maybe because so many projects are self-hosted by non-programmers, in which case it makes sense to be conservative

Can you name one or two "newer standards" that "other languages" have invested more in migrating to, compared to PHP?

Did you mean standard, as in HTML5 or ES6? Or something more like a fashion or fad, like FP or OOP (which PHP has had for a long time)?

People ask the same old questions about PHP on StackOverflow et al. because a lot of people start with PHP and as beginners they will have the same questions every beginner had before them, and the same lack of ability figuring things out themselves or finding their questions already answered. That has nothing to do with PHP per se except that PHP offers a very easy on-ramp to getting started with web development, so a lot of newbs start there.

If you look at the W3Techs methodology, posted on their site for all to see but apparently few to bother with, you will see that self-hosted hobbyist and learning projects aren't going to make it into their results.

Re: An Internet of PHP

#303

I like PHP, because it has a familiar C-like syntax and great tooling, like composer, and frameworks, like Symfony. The language has warts, but it's improving. I think its strength is its architecture, namely shared-nothing state and concurrency at the web-request level. [1] [1] https://slack.engineering/taking-php-seriously/

HHVM is evidence of the weakness of PHP and is a bandaid hack, but the article spins this as justification for PHP. What would you do if HHVM didn't even exist? Admittedly PHP has had recent performance gains, but by no means would it ever be a first choice in any backend service architecture.

You either got hit by an avalanche of bad information or prefer to remain ignorant.

What would any of us do if some innovation never happened? How does Facebook committing heavily to PHP and then giving back in the form of performance enhancements somehow tar PHP as crap? What language or framework with any longevity didn't have something like that happen? Is Javascript crap if not for Typescript, or V8?

You may not make PHP your first choice but plenty of businesses and developers do. If you can point to some actual reasons no one should choose PHP, or widespread failures due solely to flaws in PHP, go ahead.

Re: An Internet of PHP

#304

php runs securely in 5minutes in any web server 3-10$/month. Every other tech, it's complicated servers or complicated billing, not to mention depencies and build tools. thats why php

Well it's not exactly secure by default. I was deploying an app to a new server and some bot grabbed my .env file before I finished the Apache config. Ultimately it's my own stupidity, but you don't have to worry about that with most other languages

That has nothing to do with PHP. If you have .env files in your document root PHP didn't put them there or require them. Every web site back-end can expose .git directories or .env files if not configured correctly -- that has nothing to do with PHP except that way more people use PHP out of the box and don't know about these issues or how to fix them. That's analogous to way more teenagers crashing cars than more experienced drivers, but that has nothing to do with the particular cars.

Re: An Internet of PHP

#306

Earlier quoted context omitted.

For a Production setup we had to configure an nginx container plus the FPM container, let em talk, Configure some more Commands to enable/disable xdebug (that requires a restart of the containers since it needs a php estension) and i think that’s all. Other langs we use are literally “run the app” then kube will handle the rest.

Why would you enable xdebug in production?

I wouldnt but the container setup was the same to prod

Re: An Internet of PHP

#307

I like PHP, because it has a familiar C-like syntax and great tooling, like composer, and frameworks, like Symfony. The language has warts, but it's improving. I think its strength is its architecture, namely shared-nothing state and concurrency at the web-request level. [1] [1] https://slack.engineering/taking-php-seriously/

Maybe I'm missing something, but I disagree with the tooling comment. Composer is horrendously slow, taking on the order of multiple minutes just to do a update often times. This is just my experience, but I'd much rather take mix, cargo, or yarn any day.

xdebug, while it works, also feels antiquated. Trying to get it working in a new system or project can take quite a while. Again, compared to python or node's debugging experience or profiling experience, and it feels like something stuck out of the 90s.

Even just getting output from php is difficult for me. Maybe it's because of the webserver I'm using? But python, elixir, node, go, etc, all output logs to stdout while running a local service. Maybe that'd work with the built in webserver, but fpm or modphp, etc, it seems like you have to hunt down logs.

Not to mention that the dev servers almost always require a full apache or nginx setup just to function. Opposed to a node, elixir, python, or go server which all run directly from the directory you're in. (Including things like hot/auto reloading in node and elixir)

I'm not a full time php dev, but my time in php always feels like a grind, and just getting tooling working is not an easy thing. If I'm missing some state of the art alternatives, I'd love to hear them though.

Re: An Internet of PHP

#308

Earlier quoted context omitted.

I agree. I always doubted these figures (I'm a PHP dev myself, so I wouldn't mind these figures being true). I think the methodology is shady. I wonder if they use what the server indicates. I think some servers like Apache with php mod send this information to the client in a header. But most servers don't. Therefore they maybe use this as "from all the servers giving a backend language information, PHP represents 7…

Identifying the technologies behind a web site involves a lot more than looking at Apache's mod_php headers (which you can and should turn off for security reasons). The tools for figuring out what runs a site actually do a really good job by looking for multiple identifying features. Marketers and SEO people use tools like BuiltWith and Wappalyzer (and many others, most of them not free). You may not know about thos…

Thank you for your comment. I was definitely wrong about the different methods used. This is why I love Hacker News. Always nice to learn something.

I still think the stats they provide are a bit weird since there is no "unknown" category. If they can't find the backend technology used for 5% of websites, it changes the whole result, and from what I have seen they don't provide this information.

But your really nice and detailed answer tells me I might be wrong once more.

Re: An Internet of PHP

#309
post #258
post #257

Earlier quoted context omitted.

Arguably 48 == "48" should be true. If this doesn't work for you, stick to ===.

Thank you, I'll stick to languages where you can't just compare numbers and strings without an explicit conversion. Also, should 48 == "48.0" be true? How about "048", "48.", "0x30", " 48 ", "48foo", "3*16", "XLVIII", "forty-eight"?

Once again: just use ===

If you decide languages based on minutiae like this, I can only pity you.

Re: An Internet of PHP

#310
post #309
post #258

Earlier quoted context omitted.

Thank you, I'll stick to languages where you can't just compare numbers and strings without an explicit conversion. Also, should 48 == "48.0" be true? How about "048", "48.", "0x30", " 48 ", "48foo", "3*16", "XLVIII", "forty-eight"?

Once again: just use === If you decide languages based on minutiae like this, I can only pity you.

=== works for equality (if you actually remember to use it), but how about comparison? There's no strict version of <.
Post reply on HN