News for hackers. Stuff that matters.
Re:PHP 3.0 Final is out (1998) by alberth on Friday May 21, 2021 @06:24PM (#27240728)
It’s hard to explain just how much easier PHP made creating a dynamic web site back in the 90s / early 00s.

You drop a file in your public web server folder and you’re done. Prior was CGI Perl scripts that hacked together how to access session and rest data. Or you had to develop in C. PHP had native support for the web. It also eliminate the need for an app server.

I’m still not certain even today, if anything exists that is faster to get a dynamic site up and running than PHP.

Re:PHP 3.0 Final is out (1998) by dspillett on Friday May 21, 2021 @06:57PM (#27240982)
It basically did for simple web programming what visual basic did for Windows desktop toys: allowed you to throw some UI together (drag & drop components in the VB case, any old HTML with links or forms for PHP) then start stringing bit of code in haphazardly to link it together. No need to learn a more complex compiler or other build tools, worry about configuring CGI or other web server tech (unless running PHP yourself), ...

Great for prototyping, or just to encourage new programmers (as they can see results almost immediately).

Though PHP was essentially thrown together initially so had a massively inconsistent standard library, had some insanely unsafe defaults for a few major versions, and other issues that it is very valid to complain about. It was also closely associated with mysql which at the time played very fast and loose with data integrity (2008-02-31? - perfectly valid date to store! Foreign keys? Let the business layer worry about rules like that! Transactional integrity? Again, sort that elsewhere!) in the name of ease & claims of performance - the two shared bits of each others reputation.

Re:PHP 3.0 Final is out (1998) by chasil on Friday May 21, 2021 @08:52PM (#27242055)
Every Oracle Pro*C application that I could find, I have rewritten as #/bin/php -f. Good riddance to bad rubbish.

I also just trashed an extremely repugnant PDF template processor, first with fpdf.org, then with tcpdf.org - far from perfect, but improvement a thousand fold.

Exaggerate, you say? Can I interest you in COBOL on my VAX (I'm not kidding)? Or perhaps (is this is too new-fangled) assembler under EXEC-8 on OS2200?

I do like the PHP solutions very much, and yes, I work in a museum.

Re:PHP 3.0 Final is out (1998) by marianov on Friday May 21, 2021 @08:39PM (#27241951)
It also launched many information security careers :)
Re:PHP 3.0 Final is out (1998) by tannhaeuser on Saturday May 22, 2021 @02:55AM (#27244185)
Injecting strings from user input into generated HTML? Sure, to hell with checking if it contains script tags and/or onclick= attributes, or perform any kind of escaping alltogether for that matter.
Re:PHP 3.0 Final is out (1998) by dspillett on Monday May 24, 2021 @08:52AM (#27263735)
Worse, automatically adding request variables to the global namespace, in an order that if input validation is implemented but naively/buggily there can be easy ways to bypass it.
Re:PHP 3.0 Final is out (1998) by bruce343434 on Saturday May 22, 2021 @06:44AM (#27245285)
this is the programmer's fault and responsibility
Re:PHP 3.0 Final is out (1998) by dspillett on Monday May 24, 2021 @08:54AM (#27263753)
Unfortunately the low barrier for entry meant that many programmers hit the ground "running" with no knowledge of such issues, so ended up creating much insecure code simply by never knowing any better.
Re:PHP 3.0 Final is out (1998) by tannhaeuser on Saturday May 22, 2021 @08:00AM (#27245676)
Not for a programming language calling itself portable Hypertext processor, no. In fact, it's bordering on criminally negligent.
Re:PHP 3.0 Final is out (1998) by GuB-42 on Saturday May 22, 2021 @09:12AM (#27246176)
PHP have htmlspecialchars() and parameterized queries since 2000.
Re:PHP 3.0 Final is out (1998) by tannhaeuser on Saturday May 22, 2021 @10:00AM (#27246607)
1. XSS != SQL injection

2. Adding a bunch of bogus escaping routines isn't an excuse for an incredibly poorly conceived off language, or continuing using it in production in the presence of superior solutions.

In fact, I'd go so far as to say if you're selling PHP solutions/consulting in this century for apps managing ecommerce or any other kind of PII, you should demand your customer signs a liability waiver. If you can even disclaim liability for gross negligence in your jurisdiction, that is.

Re:PHP 3.0 Final is out (1998) by bruce343434 on Sunday May 23, 2021 @05:27AM (#27253608)
What should php do then? What's the alternative language that handles this better?
Re:PHP 3.0 Final is out (1998) by tannhaeuser on Sunday May 23, 2021 @06:36AM (#27253981)
For traditional PHP apps wishing to continue SSR and server-side templating, integrate HTML-aware templating (PHP has always been half there considering embedded PHP is using SGML processing instructions; it "just" needs to offer additional, more sophisticated, injection-free SGML entity-based mechanisms).

For highly dynamical apps, consider porting to JavaScript on the client side, and use PHP only as a service backend language. That's what I understand newer PHP frameworks are doing; but this will only be attractive for migrating legacy PHP apps rather than bring new users.

Re:PHP 3.0 Final is out (1998) by bruce343434 on Sunday May 23, 2021 @04:49PM (#27258473)
I don't see the upside to the effort of porting to js. You still have all of the same pittfalls. Yes, you can build a DOM with 20x the code and 1/20th the performance ... or you can just call htmlspeciachars() in php. Yup, security is tedious and you need to stay on your toes.
Re:PHP 3.0 Final is out (1998) by Viliam1234 on Saturday May 22, 2021 @02:59PM (#27249289)
When I developed in PHP, the first line of my code was usually renaming "htmlspecialchars" to "h". This significantly reduced the length of code and increased its legibility.
Re:PHP 3.0 Final is out (1998) by Cullinet on Friday May 21, 2021 @08:08PM (#27241648)
If someone proposed a conspiracy theory for why the rapid application development tools of the middle 1990s became extinct in reaction to plotting by corporate interests in perpetuating the value of consulting services and the high salaries of CS graduates, I would buy the hardback edition immediately. VB, Visual Age, Delhi, Genera on Tru64, RDB and RMS and DEC TM giving you schema less (noSQL to taste) wan -clustered ACID time series transactions programmable in BASIC, COBOL, FORTRAN C and DCL on any two of three architectures (VAX, Alpha and Itanium - currently available for running unchanged on x64 VMs) and the OS/2 subsystem bundled (plus the first free beer transaction manager NT provided working with CICS, a feature that I truly believed was capable of giving Microsoft the corporate game by itself) which provided a VBA front end to legacy systems alongside local OS/2 tools running atop the kernel thru W2K.. the day I in place upgraded my overloaded think pad in a hotel room in Köln, and I realised when Slashdot loaded in Netscape 7 that Microsoft couldn't get any respect for anything even as impressive as W2K truly was –

Edit : large part cut for brevity

I really should have composed what I just said, much better than I have done -/so I have cut the bulk from my first too enthusiastic version / I mean to describe how much you can get running with just BASIC language skills and, at least atop of VMS, and buying the right licenses, that answer is "anything almost anything that you can imagine from a power station to a stock exchange ". Stack Overflow and POF running tiny amounts of hardware under Windows Server aren't rare cases of the potential for leveraging commercial tools. If VMS is more palatable than Windows (and certainly I will not compare the two for TCO) and the Intel architecture pricing for RDB holds up I totally believe that SAAS on VMS can be a viable alternative platform capable of making a minor industry of positions for the experienced programming talent for whom ageing has become a invisible barrier to retirement or even employment and if that's possible, then there's right there the environment wherein a generation of younger engineering minds can both take respite from rat race technology change and learn from direct experience to write the reliable systems for replacing what I fear is a current batch of the most fragile infrastructure building in modern history.

edit : incidentally, I think the entry level salaries the FAANG group is paying is a coincidentally perfect match for the price for a consultant from IBM or whoever and I don't think this is a accident by any means, only it didn't seem to work out how the old big firms would have wanted things..

edit, again, mea - my conspiracy being IBM et.al killed the good development tools in hope for being able to bill for consultation only they didn't count on the ability for big tech competitors to dismantle entirely other industries to feed paying salaries at the level of consulting rates and monopolizing the talent in that way.

Re:PHP 3.0 Final is out (1998) by habibur on Friday May 21, 2021 @09:43PM (#27242414)
> why the rapid application development tools of the middle 1990s became extinct

RAD tools were focused on Desktop application development and web suddenly took over everything.

Re:PHP 3.0 Final is out (1998) by goatlover on Saturday May 22, 2021 @01:39AM (#27243831)
Yes, but the web was noticeably inferior as an application platform until html5, jQuery, Node and modern JS frameworks were being leveraged. But the web didn't require expensive licensing, and everyone by the late 90s had a web browser.
Re:PHP 3.0 Final is out (1998) by indymike on Saturday May 22, 2021 @08:07AM (#27245718)
> web was noticeably inferior as an application platform

Nope. The web was both cross platform and insanely easy to use at the same time. It also cost an order of magnitude less because developers didn't have to implement an entire ui, printing and a bunch of code to make little things like the clipboard and resize window actually work. The web was vastly superior to the 1998 4gl scene and it was crystal clear in 98 that it was the future. So sure you could make a order entry crud app with your favorite 4gl and your order entry team could use it. With the web, I could make an order entry system and the whole world could use it...

Re:PHP 3.0 Final is out (1998) by InfiniteRand on Friday May 21, 2021 @09:42PM (#27242406)
I think one thing that killed the RAD market was it became viable to stick together a web application, especially since for a while no one cared if you included a barebones web server in your delivery
Re:PHP 3.0 Final is out (1998) by sam_lowry_ on Friday May 21, 2021 @07:07PM (#27241062)
>Foreign keys? Let the business layer worry about rules like that!

Rails made this approach viable at the time.

Re:PHP 3.0 Final is out (1998) by showerst on Friday May 21, 2021 @07:16PM (#27241130)
> Rails made this approach viable at the time.

Rails didn't get big until 2006, eight years later than this time period =).

Re:PHP 3.0 Final is out (1998) by waheoo on Saturday May 22, 2021 @03:39AM (#27244421)
I still don't like using foreign keys. They just make things harder to work with for very little gain.

Wait for the crows.

Re:PHP 3.0 Final is out (1998) by withinboredom on Saturday May 22, 2021 @04:25AM (#27244645)
Because of sharding, we can’t use them at work. I haven’t thought of foreign keys in years…
Re:PHP 3.0 Final is out (1998) by iforgotpassword on Saturday May 22, 2021 @06:18AM (#27245168)
Care to elaborate? It felt like the best thing ever when switching to InnoDB.
Re:PHP 3.0 Final is out (1998) by waheoo on Sunday May 23, 2021 @01:58AM (#27252755)
Elaborate on what? They're an opinion that data integrity is dependent on foreign keys containing pointers at existing data.

In systems where actual row deletion doesn't actually happen its kind of a pointless kick to the nuts.

Now I have to create things in a specific order for no reason other than foreign keys say so. When you're using uuids for reference keys you're not beholden to what order you insert you can have these things span databases or have separate systems do the insert.

For a naive example, maybe I have an order A, and two orderliness A1, A2, why do I have to create A before I create A1 and A2. Why can't I loadbalance those three operations to different systems that insert at different timings.

Eventually they all line up, and my system is resilient enough to be ok with that.

With foreign keys you're just beholden to some feigned idea about data integrity but it's mostly bullshit.

The other common situation is when you need to backup tables and restore them elsewhere in whatever order you want, foreign keys just get in the way.

Re:PHP 3.0 Final is out (1998) by dspillett on Monday May 24, 2021 @09:18AM (#27263992)
I see your point for decentralised systems, "eventual consistency" is an unavoidable evil in many cases there at least if you don't want a performance hole caused by distributed transaction requirements.

But otherwise, I disagree strongly.

> feigned idea about data integrity but it's mostly bullshit

I call BS on your call of BS.

> The other common situation is...

If that is common in your production environments, then I never want to work with your production environments.

> foreign keys just get in the way.

Disable them, do the jiggery-pokery, and then replace them. Again, but not in production systems.

If FKs are an inconvenience day-to-day then you have something seriously wrong somewhere. They are protection against bugs and other unpredictables causing corruption of data that other code later relied upon being correct.

Re:PHP 3.0 Final is out (1998) by owenversteeg on Friday May 21, 2021 @10:37PM (#27242814)
Not just the early 2000s - up until maybe 2010 or so (probably a bit later) PHP was the clear leader for anyone who wanted to get something done. There was Rails and ASP.net and Java (I don’t remember anything else that was super popular) but PHP was a million times faster to develop in. Anything you wanted was explained in depth in the first Google result. You want auth? A chat server? File management? You could get anything you dreamed of. The most amazing part was how it was so simple and actually worked. Nowadays you look something up, the first few examples are often videos, unnecessarily detailed blog posts, who knows. Then things don’t even work, because one of your dependencies is out of date, or something needs to be restarted, or your linting failed, or who knows what. PHP barely ages - from 1999 or 2010 or 2020, it looks similar and works fine. By comparison I can instantly tell what 4-year timespan any Javascript was written in, because ten trends and frameworks have come and gone and left their mark.

A simpler language for a simpler time.

Re:PHP 3.0 Final is out (1998) by cardanome on Saturday May 22, 2021 @04:20AM (#27244621)
> PHP was the clear leader for anyone who wanted to get something done.

Isn't that still the case?

At least here in Europe the word Backend Developer is basically synonymous with PHP Developer.

Every other language for backend development is pretty niche. Sure there is Java (and C#) for the enterprise but that was already there back then. Ruby had a good run but modern PHP with frameworks like Laravel could reclaim most productivity benefits so not that fierce of a competition. JS with node, sure but I mostly hear it in the context of micro services which is the opposite of wanting to get something done.

> PHP barely ages - from 1999 or 2010 or 2020, it looks similar and works fine.

Yes but no. PHP takes stability and backwards compatibility quite seriously but the language and culture around it has changed tremendously. The wild west days are long gone, it has gotten much more professional and mature while adding many modern language features.

Re:PHP 3.0 Final is out (1998) by noir_lord on Saturday May 22, 2021 @07:21AM (#27245463)
> At least here in Europe the word Backend Developer is basically synonymous with PHP Developer.

Pretty much, I've seen PHP powering traditional companies with revenue in the hundreds of millions (approach billions).

Re:PHP 3.0 Final is out (1998) by 8fGTBjZxBcHq on Saturday May 22, 2021 @08:31AM (#27245882)
Yeah my "niche" right now is consulting for companies that are high revenue but built out their platforms during lean times where they were focused on growth over stability, reliability, or security. "Legacy code" I guess though it's a little more varied than that might imply.

Basically the only two technologies I touch these days are rails and php. I'm not filtering out other tech stacks, these two are just absolutely dominant for this type of company.

Re:PHP 3.0 Final is out (1998) by noir_lord on Saturday May 22, 2021 @09:03AM (#27246109)
Sometimes not just "lean startup" type companies.

The place I'm thinking off that I know uses PHP for everything is a bricks and mortar retailer/manufacturer, I think last time I looked their revenue was ~£500m a year.

Their software was however awful in the worst ways :).

Re:PHP 3.0 Final is out (1998) by eitland on Saturday May 22, 2021 @09:16AM (#27246206)
> Isn't that still the case?

> At least here in Europe the word Backend Developer is basically synonymous with PHP Developer.

Here in Norway backend mostly means JVM or dotNet it seems. Last I touched a PHP installation that wasn't a prototype or a blog or something was in the spring of 2009.

That said: In my opinion PHP has been massively underrated in HN circles.

Re:PHP 3.0 Final is out (1998) by 29athrowaway on Friday May 21, 2021 @11:04PM (#27242982)
If you need to cook an egg, you can serve 1 request per second with PHP and use your CPU as heat source.
Re:PHP 3.0 Final is out (1998) by simon1ltd on Friday May 21, 2021 @11:56PM (#27243289)
Only if your code is poorly written.

Even on basic hardware, hundreds of requests per second are trivial -- assuming you aren't loading a bunch of files ("require") or making 800 trips to the database to load the site.

I've never found PHPs performance to be a limiting factor, even when I was dealing with dynamic page loads coming in at sustained rates between 50 and 100 per second, and this was on PHP4/5, slow (400MHZ), single core, low ram system. FAMP stack.

I assume Java apps are the same way -- I've never encountered (to my knowledge) a java-based website that wasn't slow. I assume anything that relies on a huge framework probably also had that framework to blame for most performance problems.

Re:PHP 3.0 Final is out (1998) by kyriakos on Saturday May 22, 2021 @12:38AM (#27243537)
Performance is the last thing one can blame php for. Its quite fast for a non compiled dynamic language and most bottlenecks are usually I/O and db access
Re:PHP 3.0 Final is out (1998) by seanp2k2 on Saturday May 22, 2021 @11:03PM (#27252091)
+1, once you get the right indices in place, MySQL 4.x would scale just fine to millions of rows per table. Innodb and Percona were even better. Maatkit was amazing for tuning, as was xdebug.

When you just had expensive queries that were already optimized, you’d use IPVS, haproxy, apache, or RR DNS to help. This was before nginx existed. Static caching pages using Perl scripts to crawl the site and write out everything static as html files worked well too. Varnish was a real game-changer when that came out.

Edit: forgot about Gearman for distributing work as well. Now people probably build the same types of things using SQS and functions.

PHP was never the bottleneck, and the web could definitely “feel” faster back then on hardware an order of magnitude or two slower than we have today with these >10MiB index pages, CDNs and parallel downloads be damned.

Re:PHP 3.0 Final is out (1998) by candiodari on Saturday May 22, 2021 @02:48PM (#27249215)
Exactly, if there is one thing that is to blame for cooking CPU's it's an ORM, and those aren't very typical to see in PHP at all.
Re:PHP 3.0 Final is out (1998) by hu3 on Saturday May 22, 2021 @12:43AM (#27243563)
It's funny you say that. I was toying with PHP not long ago and managed to squeze 50k requests per second on an old server using a pure php server library called Workerman.

And by squeze I mean copy 30 lines or so from their hello world tutorial and run: php start.php

Re:PHP 3.0 Final is out (1998) by exikyut on Saturday May 22, 2021 @04:57AM (#27244820)
I reimplemented the speedtest.net backend for fun a number of years ago, right around when it was transitioning from Flash to HTML5 and offered both.

I used a PHP process running in the background using stream_socket_server().

IIRC my computer had a 5Gbps connection to localhost using HTML5, and fractionally less using Flash :>

...which meant that PHP was writing to the web browser at 5Gbps.

Re:PHP 3.0 Final is out (1998) by progforlyfe on Friday May 21, 2021 @11:59PM (#27243304)
I prefer python or ruby, they cook the egg faster
Re:PHP 3.0 Final is out (1998) by forgotpwd16 on Saturday May 22, 2021 @08:49AM (#27245994)
How does perl compare?
Re:PHP 3.0 Final is out (1998) by 101008 on Friday May 21, 2021 @06:47PM (#27240910)
Definitely. I started with PHP when I was only 12 or 13 years old. Adding some logic inside your .html files (mostly includes, that were like magic back then[1]), renaming to .php and upload them to the server using FTP was so simple. A few years later, when I had to set up a lot of things to run Django I was surprised at how hard it was.

PHP was simple to use, and to understand its logic, because it was embeded into HTML itself if you want to. No need to write views, controllers, templates, anything. And most of the shared hosting (paid and free) supported it.

[1]Includes were like magic back then because if you had a heavy content website with a lot of inner pages (fansites), updating the navigation sidebar was a pain in the ass. Originally they were made with framesets, later iframes (with no borders, but if the content changed, a scrollbar appeared). When I (and my friends) started to use PHP and be able to use includes, it was awesome.

(Edited to fix formatting)

Re:PHP 3.0 Final is out (1998) by iammiles on Friday May 21, 2021 @06:58PM (#27240990)
This is the same story for me. Moving from PHP to Python was really difficult conceptually for me. For years fiddling with Apache configs and uploading files via FTP was web development.

I sometimes find myself thinking about teenagers getting started nowadays and the accessibility of development, but I suppose there are a lot more resources now than the early 2000s for some enterprising kids to get started.

Re:PHP 3.0 Final is out (1998) by cronix on Friday May 21, 2021 @07:53PM (#27241484)
Yes, but at the same time, web development was a much simpler process back then to get into and actually start to learn. No virtual machines to have to learn, or npm, or git, or... just code in php/html in notepad and maybe some raw basic javascript until js frameworks started becoming a thing and upload it via ftp. I mean, you didn't even have css to worry about...you just threw everything into a table! (lol!) There were only a few standard screen resolutions you had to worry about, and only desktops/laptops that were always oriented in the same position (landscape). I'm not saying it wasn't crude, but it was a lot faster to go from knowing 0 to building a dynamic web page with a real visitor counter vs everything extra you have to consider using modern devices and tooling.
Re:PHP 3.0 Final is out (1998) by 0xEFF on Saturday May 22, 2021 @01:22AM (#27243743)
Nearly 20 years ago I wrote a dynamic listing page in PHP that renders an html table from data in MySQL.

Today it still works.

Re:PHP 3.0 Final is out (1998) by coliveira on Friday May 21, 2021 @09:36PM (#27242362)
It is important to point out that this simplicity was by design. There was a ton of complex UI frameworks in the 90s, but Tim Berners Lee decided to get away with that complexity. Of course, developers being who they are, decided that simple is not what they wanted, and created probably one of the most complicated development stacks the world has ever seen on the top of the web browser.
Re:PHP 3.0 Final is out (1998) by kaba0 on Friday May 21, 2021 @09:14PM (#27242211)
I mean, the exact same things work now, a beginner don’t have to use docker, don’t have to care about responsive layouts, etc.

Similarly to how one can start writing python scripts without having to know OOP, maintainability, or even functions. It will suck, but it is a valuable learning step.

Re:PHP 3.0 Final is out (1998) by bsharitt on Friday May 21, 2021 @08:01PM (#27241563)
Starting with PHP and Visual Basic got me on the way to making cool stuff really fast, but I think they both made the leap to "real" programing languages later. With web development, I didn't really move on from PHP's "HTML with extra stuff" until I came across Ruby on Rails, and I'm not sure I ever really got past VB for high level GUI desktop stuff, but I was able to get into some lower level C in high school, but I've never really done desktop GUI programming since other than a little bit of Cocoa/Objective-C with earlier version of Mac OS X.
Re:PHP 3.0 Final is out (1998) by lancesells on Friday May 21, 2021 @08:47PM (#27242018)
I learned PHP / MYSQL back in the 2000 because I had a website with ~100 pages. The only reason I had back then was to not have to update ~100 files whenever I changed the navigation.
Re:PHP 3.0 Final is out (1998) by ricardo81 on Saturday May 22, 2021 @04:59AM (#27244826)
Pretty much the same for me. A migration from using MS Access and FP extensions to PHP/MySQL.
Re:PHP 3.0 Final is out (1998) by midasuni on Saturday May 22, 2021 @03:10AM (#27244265)
I used SSI to include things like footers, but pho was great if you were into front end stuff
Re:PHP 3.0 Final is out (1998) by Seattle3503 on Friday May 21, 2021 @06:30PM (#27240787)
> I’m still not certain even today, if anything exists that is faster to get a dynamic site up and running than PHP.

With PHP you can just start typing in your file and produce output. Even with lightweight frameworks like Flask there is boilerplate.

Re:PHP 3.0 Final is out (1998) by dimitrios1 on Friday May 21, 2021 @10:13PM (#27242639)
This ignores the monstrous complexity of setting up PHP (and php-fpm) on a host machine. I prefer fully contained targeted binaries these days.
Re:PHP 3.0 Final is out (1998) by innocenat on Friday May 21, 2021 @11:48PM (#27243239)
`apt install apache2 php libapache2-mod-php` will perfectly set up Apache with PHP all Debian-based distros. What's complex about that?

And if you really need php-fpm (which you should, anyway), at least in Ubuntu (never set up on other distro), the boilerplate nginx config is there.

Re:PHP 3.0 Final is out (1998) by forgotpwd16 on Saturday May 22, 2021 @08:54AM (#27246038)
How bad will be running the built-in web server on public network?
Re:PHP 3.0 Final is out (1998) by innocenat on Saturday May 22, 2021 @03:02PM (#27249323)
You meant PHP built-in server (php -S)? It doesn't even support concurrent connection.

Neither mod_php nor php-fpm is related to the built-in server though. Both are designed for production.

Re:PHP 3.0 Final is out (1998) by tored on Monday May 24, 2021 @05:38AM (#27262514)
Built-in web server has experimental concurrent support since PHP 7.4

> Set the PHP_CLI_SERVER_WORKERS environment variable to the number of desired workers before starting the server

https://www.php.net/manual/en/features.commandline.webserver...

Re:PHP 3.0 Final is out (1998) by candiodari on Saturday May 22, 2021 @03:11PM (#27249432)
This has been debugged for 20+ years now. Not bad at all.
Re:PHP 3.0 Final is out (1998) by FriedrichN on Saturday May 22, 2021 @08:39AM (#27245928)
I have set up PHP on Apache (both php-fpm and mod_php) and Nginx countless times on different Linux distros and never ran into problems. It might have to do with the fact that I have so much experience with web servers but it takes me only a few minutes to set it up on any Ubuntu/Debian based system (download time of the packages excluded).
Re:PHP 3.0 Final is out (1998) by osrec on Friday May 21, 2021 @10:57PM (#27242936)
PHP has to be one of the easiest set ups. Even more so nowadays if you're just grabbing a docker image...
Re:PHP 3.0 Final is out (1998) by robjan on Saturday May 22, 2021 @12:18AM (#27243405)
If you're on Windows you can just install XAMPP and it "just works".
Re:PHP 3.0 Final is out (1998) by welly on Sunday May 23, 2021 @04:54AM (#27253425)
Monstrous? It couldn't be any more simple, if you even have to go through the process of setting up PHP. Hosting options that support PHP are two a penny, probably literally.
Re:PHP 3.0 Final is out (1998) by kbenson on Friday May 21, 2021 @06:53PM (#27240951)
> You drop a file in your public web server folder and you’re done.

The implications of what this meant for security were very important too, but in a negative way. Instead of an application with a single or few small entry points (like CGI), you could just design your PHP app with a bunch of files spread across the exposed public directory structure, and for a long time this was the reigning paradigm for PHP.

This, combined with the extension controlling whether it was processed as a PHP script or a plain text file meant that anyone making a quick and dirty backup of a file they were changing that didn't consider this would often end up exposing files to the public they didn't intend (mv config.php config.php.bak).

Additionally, since most people were running on shared hosting platforms and PHP was usually run as the webserver user, and many applications were designed to be dropped entirely into a public web structure, any capability for writing locally (like allowing file uploads) often consisted of setting a directory world writable to drop files in. Even ignoring how often people screwed up setting permissions and set everything of theirs world writable, even when done correct this usually ended up being security through not-so-obscurity, since common apps had default locations they used more often than not (customizing that required more user interaction and knowledge to set up, which was against the ethos of "drop in and use" PHP heavily leaned on initially).

PHP's ease of use was the ease of use of Windows 95 compared to Windows NT or Windows 2000. Sure, things are easier when you don't have to care about users and permissions and security. But you need to bootstrap any success you have into fixing those problems ASAP.

PHP was always a victim of it's own success in this regard. The thing that made it easy to use for people was that it did away with a lot of the security concerns that were (barely) in place at that time, and the effects of that are what made it a nightmare for those managing it, and often at one point or another those using it as they were bitten by these problems.

I'm glad we've all moved on from that. PHP did a lot to make it easier for people to do stuff online, and that in itself is a good thing and a laudable achievement. I'm unsure if it was a net gain though. It's too complex for me to easily say it was one, nor that it was definitively a net loss.

Re:PHP 3.0 Final is out (1998) by simon1ltd on Saturday May 22, 2021 @12:01AM (#27243314)
I'm not convinced that security is actually that much higher. I agree with your examples, but the complexity of most environments now is such that you almost have to know what you're doing in order to attempt to stay secure.

How often do people leak things via S3 because they couldn't set the permissions properly? Same thing as you mention, except it's yet another layer that has to be maintained.

I went from Perl to PHP, and my productivity definitely improved, and the speed of execution also improved significantly. mod_perl was available, but I was pretty well switched to PHP by the time I really looked into that.

Re:PHP 3.0 Final is out (1998) by kbenson on Saturday May 22, 2021 @02:23AM (#27244042)
> How often do people leak things via S3 because they couldn't set the permissions properly? Same thing as you mention, except it's yet another layer that has to be maintained.

I think the fact that it's another layer and not essential for anything is a pretty good reason why it's not necessarily the same.

What I'm talking about is the default or minimal install complexity and how that affected what was to come. I'm not sure anyone considers S3 a default or minimal config for a website or code execution on the web.

I do agree it's much easier to add complexity these days though, and there are plenty of resources that probably encourage it.

> mod_perl was available, but I was pretty well switched to PHP by the time I really looked into that.

You didn't miss much. While mod_perl was first released within a year or two of the first version of PHP, it works in a fundamentally different way, as wasn't really suitable for shared hosting, so it was never going to have the same popularity. mod_perl keeps a perl interpreter persistent per Apache thread, but it doesn't (can't) really completely separate one request from the next, and given's the prevalence of globals that Perl lets you tweak that affect how many built-ins function (and the ability to redefine portions of the symbol table), it wasn't really suitable for shared environments, just for applications which were mostly the sole purpose of the webserver.

In fact, the way it works is sort of to just take any file set to be handled by it, and eval the content of it in a sub (to deal with some scoping issues), and display the output. As you might imagine, this required special care to not accidentally create closures and pollute subsequent request handling with data in variables from prior requests.

Re:PHP 3.0 Final is out (1998) by that_guy_iain on Saturday May 22, 2021 @05:31AM (#27244962)
I was once asked in an interview for a PHP role what was my favourite feature of PHP and my answer was deployablitiy. In my opinion it can't really be matched on how easy it is to deploy. I can deploy any other language but it is never as easy as deploying PHP.

The guy who was interviewing me was sitting their shaking his head like that wasn't a valid answer.

Re:PHP 3.0 Final is out (1998) by FriedrichN on Saturday May 22, 2021 @05:47AM (#27245036)
> The guy who was interviewing me was sitting their shaking his head like that wasn't a valid answer.

I wonder what would be the proper answer. Also if there is a proper answer, they shouldn't ask what your favourite feature is.

I hate it when people ask questions where they expect some sort of exact question to see if you think in the exact same manner as they do. Just ask me what you want to know or I'll pack my shit and leave.

Re:PHP 3.0 Final is out (1998) by gcmrtc on Saturday May 22, 2021 @06:48AM (#27245295)
You're right, and donwvotes are from that kind of people.
Re:PHP 3.0 Final is out (1998) by flippinburgers on Saturday May 22, 2021 @06:07AM (#27245118)
Golang web apps are probably the simplest to deploy.
Re:PHP 3.0 Final is out (1998) by johannes1234321 on Saturday May 22, 2021 @06:28AM (#27245216)
For that you need to build some little tooling around it. You have to do the service registration somit auto starts and then you need some form of a harness to restart the go daemon if something goes bad etc. Also the one deploying Go needs system permissions on the machine.

For a PHP deployment this is all handled by a fully standardized Apache httpd (at least back in the days, nowadays setups became more fancy) and the PHP.user just uses (s)ftp to copy the files in and all works magically. Need to update? - Just copy the new files. This is the unbeaten simplicity. (Of course that breaks at some point, like imma high traffic site simply copying the files via sftp will lead to some request in the middle having inconsistent state etc.)

Re:PHP 3.0 Final is out (1998) by flippinburgers on Saturday May 22, 2021 @07:32AM (#27245517)
The golang binary file + systemd. Don't run the process as root. Done.
Re:PHP 3.0 Final is out (1998) by that_guy_iain on Saturday May 22, 2021 @09:23AM (#27246274)
Need ssh access. Can't deploy via ftp. A non-techincal person can deploy a WordPress site they will not be able to deploy a golang binary.

If the binary fails for whatever reason the application is either down or you have to have something ensuring it stays running. With PHP if it breaks, it'll be ok for the next run.

Re:PHP 3.0 Final is out (1998) by flippinburgers on Saturday May 22, 2021 @10:42AM (#27246977)
I am not familiar with tooling designed to allow non-programmers to deploy. For a programmer, a single binary is trivial stuff. My point being you can drop a golang in any linux environment and it will just run. It doesn't get simpler than that.
Re:PHP 3.0 Final is out (1998) by that_guy_iain on Saturday May 22, 2021 @11:33AM (#27247488)
I understand what your point is, it is just your point is invalid.

You say you just drop a golang binary into any linux enviroment and it'll just run. Except it won't. If I just upload the file it won't just run. I need to run the binary. Literally, you need to do more than just upload the binary to the enviroment. Where as with PHP with many hosters you do just need to upload the files and it is deploy. As you said you can't get simplier than just uploading the files.

Secondary, if you have to make exclusions to proof your point of simplicity then it is not as simple as you state.

Thirdly, your deployment would be unstable. If an error occurs someone would manually have to restart it. For any production deployment you would need supervisior. And if you were going to deploy a new version you would have to stop supervisor, stop your process, upload and then restart supervisor. Quite simply your trival deployment is not production ready and would not be how someone would deploy it.

I get it you like golang, I like it to, but PHP has it beat on deployablity. It's got years on it when it comes to improving the ecosystem around it.

Re:PHP 3.0 Final is out (1998) by flippinburgers on Sunday May 23, 2021 @02:14AM (#27252803)
Systemd.

Whatever you think it is that is simple about php, I am certain there is plenty happening behind the covers that you are unaware of. An environment built around supporting php is required.

A compiled golang binary only needs a linux system. That is it. Very, very simple.

Re:PHP 3.0 Final is out (1998) by that_guy_iain on Sunday May 23, 2021 @03:12AM (#27253007)
> Systemd

Doesn't restarted failed processes last time I checked. Maybe I'm wrong but I am pretty sure there is a reason every sys admin I know uses supervisord to manage long running processes.

> Whatever you think it is that is simple about php, I am certain there is plenty happening behind the covers that you are unaware of. An environment built around supporting php is required.

You are as wrong about that as you are as wrong about golang being as simple to deploy. You're just consisently wrong.

> A compiled golang binary only needs a linux system. That is it. Very, very simple.

Golang binary requires the deployer to have linux system knowledge. Uploading files does not require that it requires FTP client knowledge at most or in some cases the ability to use a web based file manager.

Requring knowledge core operating system functionality do deployments is not simple. Just because a techincal person can do it, does not mean it is simple. If you can not teach your grandma to do the deployment it is not simple.

Re:PHP 3.0 Final is out (1998) by mekster on Saturday May 22, 2021 @12:25AM (#27243448)
Perl wasn't bad, in fact I like it's Unixism in it but too bad it lost momentum. Every language has more than one way to do it, so it wasn't a down side, it's just programmers needed to know what they're doing like always.

mod_perl worked without running an app server but I still don't know how other languages never implement mod_$lang or $lang-fpm that reloads code on change, so you don't have to place auto restart magic on development.

These days you need transpilers (but I don't blame the flourishing of higher level tools when JS, CSS kind of totally stalled from adding useful features and people never let go of old browsers), auto restart of app servers and other build procedures just to get started and that's one of the reason people stick to plain PHP/CSS/JS (loaded independently via script tag...).

We do want nice pretty slick GUI that does all that for cross platform to get new people started without asking them to do console magics. I know a few good ones but doesn't seem cross platform.

Re:PHP 3.0 Final is out (1998) by systematical on Friday May 21, 2021 @07:23PM (#27241195)
And today you get all that plus a lot of features you'd expect in other languages. Starting with PHP 7 the language has gotten faster and better and it continues into PHP 8. Just checkout of the RFC's https://wiki.php.net/rfc
Re:PHP 3.0 Final is out (1998) by bouncycastle on Friday May 21, 2021 @07:40PM (#27241352)
It was just a massive toolbox that had everything - session, templates, large bundles of familiar libraries, Apache module.

By far, the most useful tool in the box was probably MySQL. Before then, you had to work with flat files.

Oh, and "magic quotes" was a bad idea ;-)

Re:PHP 3.0 Final is out (1998) by incanus77 on Friday May 21, 2021 @06:50PM (#27240925)
This is right when I started using it and it launched my career in software dev. You could build anything. Combine that with being 21-22 and the associated naivité and nothing was impossible.

Prior to PHP as part of a LAMP stack, I had indeed been cobbling Perl scripts and GDBM key/pair databases to do web apps for various projects and customers. The ability to just print to the browser with PHP without explicitly having to send HTTP headers was wonderful.

Re:PHP 3.0 Final is out (1998) by cutler on Friday May 21, 2021 @08:37PM (#27241939)
The Perl standard for cheap hosts was Lincoln Stein's CGI.pm (HTML::Mason required mod_perl for decent performance) but it was constantly subject to patches as the whole internet poked it to find holes. It taught me just how difficult it can be to get HTTP/CGI parsing correct and secure. I mean there were some pretty sharp people in the Perl community working on CGI.pm but you always knew another security hole was just round the corner. To some extent PHP sidestepped these issues which may be why it took off so quickly.
Re:PHP 3.0 Final is out (1998) by chx on Saturday May 22, 2021 @01:02AM (#27243657)
I feel people completely forgot -- for the right reasons obviously -- the disaster that was IHTML. https://web.archive.org/web/20030526173831/http://www.idude.... run.
Re:PHP 3.0 Final is out (1998) by nly on Friday May 21, 2021 @06:25PM (#27240740)
I'm currently working on a Django project and have to restart uwsgi after each git pull. It's a pain
Re:PHP 3.0 Final is out (1998) by edgyquant on Friday May 21, 2021 @07:55PM (#27241509)
Can you not setup hot reloading? I work with flask but it’s as simple as

    FLASK_ENV=development python run.py 
To get hot reloading working under flask, and it’s a lot less complex than django.
Re:PHP 3.0 Final is out (1998) by tomnipotent on Friday May 21, 2021 @10:19PM (#27242697)
Use py-autoreload in your uwsgi config.
Re:PHP 3.0 Final is out (1998) by BiteCode_dev on Saturday May 22, 2021 @10:04AM (#27246639)
Yes but your forgot that you had to setup easy php to get an dev env running. I'd trade easy deployment for easy dev any day.
Re:PHP 3.0 Final is out (1998) by VictorDucs on Friday May 21, 2021 @08:24PM (#27241826)
Early 00s? Back to 1995! https://www.my-old-version.com/php/
Re:PHP 3.0 Final is out (1998) by asadlionpk on Friday May 21, 2021 @06:58PM (#27240992)
Try nextjs.
Re:PHP 3.0 Final is out (1998) by cutler on Friday May 21, 2021 @08:48PM (#27242021)
Sorry, I don't have 250Mb for node_modules with every app I want to prototype.
Re:PHP 3.0 Final is out (1998) by tschan on Friday May 21, 2021 @10:21PM (#27242710)
PNPM (https://pnpm.io) is trying to solve that particular problem (i.e. "node_modules taking up too much space").