r/PHPhelp • u/neoncitylife • Feb 06 '26
Discussion Question
If someone came to you with a PHP-coded e-commerce website and asked you to update the entire codebase to make it into a modern, world-class, fast-speed, AI-enabled store, would you:
- keep the site running on PHP and make sure everything is up to date
- tell the client that building the site in a newer framework for e-comm would be better and pitch a new rebuild
- explain to the client that some store business scale will be impacted by continuing to run on PHP, but that it can scale for awhile until it breaks
1
Upvotes
21
u/DevelopmentScary3844 Feb 06 '26
With all due respect, the questions you are asking suggest that you are not up to the task.
9
u/HolyGonzo Feb 06 '26
This is common small-business owner logic - "I want a site that can handle anything and I want AI because... AI!" (I work with lots of small businesses)
You want a world-class site that can handle anything? Okay, let's start with about $750,000 - $1M a month. That way you can have enterprise DNS and load balancing with multiple nodes that are geographically distributed, with enough power and bandwidth to handle seasonal spikes in traffic, plus proper backups, proper security hardware, AI costs, and salaries for the staff to monitor and run each location and to set up replication and also the licensing costs for everything.
And that's just your hosting infrastructure. You'll also need customer support call centers and support systems (e.g. Oracle B2C Service Cloud), an enterprise-grade merchant gateway for processing payments (and refunds), a corresponding infrastructure for logistics (warehousing and shipping), etc...
Now, I'm guessing that they don't TRULY mean "world class" but it's an illustration of how vague "I want it all" requirements will lead to ridiculous actual requirements.
You need the right requirements to make the right recommendations.
So you need to push back and get those actual requirements.
For example, if they currently handle 100 customers per day, then you need to figure out how that traffic is distributed - are all 100 coming in at the same second or do they have a peak of 20 customers at one time during the afternoon in a bell shaped distribution?
If they can already handle 1,000 customers in a day, then what do they want the limit to be? And if they can handle 1,000 users every minute but the site slows down a fair amount, how much do they need to increase their hosting specs by in order to prevent the slowdown?
If they want to redesign the site to be more modern, how much business are they willing to lose during the change? New designs always throw off repeat customers and they can create frustration if they're not immediately intuitive (control-group-tested), and that can lead to people leaving the site.
For AI, what problems are they trying to solve with AI? Marketing might try to sell things as "AI-enabled" but if you don't have a clear vision and a good plan on how to achieve it, you're going to end up with some shoddy chatbot that hallucinates and leads to customer support problems and dissatisfaction.
The choice of whether to stay with PHP or whatever is not the result of a general community opinion but the result of what makes the most sense for your plan.
And if you don't have requirements and a plan, then that needs to be your next step.
6
u/smashedthelemon Feb 06 '26
Php is still a valid option. Other options also exist. Depends on the requirements.
3
u/equilni Feb 06 '26
There would likely be a further discussion and review, hopefully, before this could be answered properly. There’s definitely a few ways to tackle this and it depends on the above review, so there’s no clear direct answer to this.
You would also need to define your needs and expectations as well - ie what is modern to you - the codebase or what the user sees? Fast speed - is the site slow and on what? Have you or was this tracked (back up with numbers)? Etc.
There’s also how the site is coded, what version, are you using a framework now, database (indexes), front end frameworks, etc.
You may be able to modernize in place and keep the site going unless you have time and money allotted for a rewrite.
As usual, it depends.
5
u/ghedipunk Feb 07 '26
Alright, so, from the options that you've listed (especially #3), it seems that you think that PHP itself is a terrible choice, but you're using a legacy PHP-built system and are looking for an excuse to choose a "better" language.
The programming language itself does not define how fast a website runs (with a few very specific pedantic notes on compiled vs scripted, but this only matters when you've got your time-to-first-byte down to less than 50ms).
It's almost absolutely guaranteed that your performance issues with your old system have nothing to do with PHP. It's data access. If someone swapped your code's functionality at a 1:1 feature parity with pure assembly, programming right down to bare metal, you will not improve your site's functionality by any noticeable amount.
The first place to look is your database queries. Are your queries being ran in a loop? Are you making DB queries and processing these results in code in order to figure out what other DB queries you need to make? It doesn't matter whether you're using PHP, Python, NodeJS, Brainf, C, ADA, Scala, Algol, Bash scripts, BCPL, or anything else if you've made that mistake.
Can you use any sort of caching? And I don't mean just setting up a Cloudflare CDN reverse proxy... Can you utilize memcached to keep DB results available between processes? Can you partially render the static and common parts of documents to files/memory that can be shared between processes? Would you be willing to host your own reverse proxy that will take care of the static aspects of your documents?
Do you understand your (cloud?) servers' infrastructure, i.e., does the same physical server than handles the execution of your scripts also host the physical filesystem (hard drive) where the session data is stored? And if not, do you understand the tradeoffs between relational (SQL) or key-value (No-SQL) databases, and can you measure the differences between these when accessing frequently required and user-specific data?
I've been developing ecommerce sites for decades. PHP is not pretty. Personally, I'm shying away from ANY dynamic content for my side hustle (which is, honestly aimed at the small businesses who can't just drop $40k for a web agency, but still need a professionally developed but static site), including PHP. (Honestly, most of the heavy lifting is using eleventy to produce static HTML files.)
But while PHP is not pretty, it is elegant. A weapon for a more civilized era.
2
u/cscottnet Feb 08 '26
4. I would hang up and look for another client as soon as I heard "AI-enabled".
3
u/MateusAzevedo Feb 06 '26
The answer, as anything in this world, is it depends. In this case, it depends on the current project, code quality and stuff. Making it "moderns, fast and AI ready" may take way more work than expected.
3
u/martinbean Feb 06 '26
I’d be first asking them to define “AI-enabled”. Like, what does that even mean? It’s just buzzwords.
3
u/secretprocess Feb 06 '26
If it's Wordpress, rebuild. If it's any other PHP framework you can probably save it.
2
u/recaffeinated Feb 07 '26
I'd run away
2
u/Alexander-Wright Feb 07 '26
I have worked with a customer to perform this service.
It all depends on the structure and quality of the existing code.
In my case I was taking over a disaster with SQL vulnerabilities, clear text passwords and poor code structure. It was a half arsed approximation to MVC.
I started by fixing the big tickets, hashing passwords and fixing as many SQL issues I could find.
I then in place converted the site to use Laravel, finally restyling and improving the front end workflow.
Please DM me for a quote.
1
u/xreddawgx Feb 06 '26
Wordpress/woocommerce. Handling credit card payment information is a NIGHTMARE. especially the legality of it.