Technology

PHP 5.6 and 7.0 End Security Support: How Websites Should Upgrade PHP

Illustration: PHP 5.6 and 7.0 End Security Support: How WordPress Websites Should Upgrade PHP

At the end of 2018, two popular PHP branches, 5.6 and 7.0, reached end of life. According to PHP's supported versions page, 5.6 stopped on December 31, 2018 (final release 5.6.40), while 7.0 had its final release 7.0.33 and is recorded as ending support on January 10, 2019. Since then, these branches no longer receive security patches. If your WordPress website still runs old PHP, it's time to plan an upgrade.

Why upgrade PHP

  • Security: newly discovered vulnerabilities won't be patched on versions that are no longer supported.
  • Performance: PHP 7.x and later versions generally run faster than 5.6 and use less memory.
  • Compatibility: new plugins and themes increasingly require higher PHP versions.

Upgrading PHP doesn't change your post content, but it can expose errors in old themes or plugins, so test before applying to the live website.

Suggested PHP upgrade process

Step 1: Check the current version. Look in the hosting control panel or ask your provider. Some diagnostic plugins also show the PHP version.

Step 2: Back up everything. Back up both files and the database, and check that the backup can be restored.

Step 3: Update WordPress, themes and plugins. Move to the latest versions and remove plugins you no longer use. Check each plugin's description page to see whether it lists PHP compatibility.

Step 4: Test on a copy (staging). If your hosting supports it, create a copy of the website, change PHP on that copy, and browse the main pages, forms, checkout and admin login.

Step 5: Change the PHP version on the live website. Choose a branch that is still supported. At this time, branches 7.1, 7.2 and 7.3 are still in their support period; see the current version table at php.net and WordPress's recommendations. Do it when there are few visitors.

Step 6: Check after the change. Open the home page, posts, product pages, cart and contact form. Look at the error log for warnings.

Step 7: Be ready to roll back. If you hit a serious error, switch back to the old version right away to keep the website running, then find the cause on the copy.

Common errors after upgrading

  • White screen or 500 error: usually caused by an old plugin or theme using a function that's no longer supported. Disable the suspect plugin by renaming its folder via FTP or a file manager.
  • "Deprecated" warnings: not a blocking error yet, but a sign the code needs updating.
  • Lost connection to external services: due to a missing PHP extension; ask your hosting provider to enable it.

If a theme or plugin is developed by a third party and no longer updated, consider replacing it with a maintained solution.

When to ask for help

Websites that sell products, take bookings or have many customizations should have a technical person on hand during the switch. If you need help, you can contact HVSC's Technology team.

Cách nhận biết một nhánh PHP còn được hỗ trợ

Mỗi nhánh PHP có hai giai đoạn: hỗ trợ đầy đủ rồi chỉ vá bảo mật, sau đó là hết hỗ trợ. Trang supported-versions của php.net liệt kê các mốc này theo từng nhánh, còn trang eol.php ghi các nhánh đã kết thúc. Khi lên kế hoạch nâng cấp, hãy mở hai trang này và đối chiếu với phiên bản website đang chạy, vì danh sách thay đổi theo thời gian.

Chủ website không cần nhớ mốc cụ thể, chỉ cần có thói quen kiểm tra mỗi quý và hỏi nhà cung cấp hosting khi nhánh đang dùng sắp hết hỗ trợ.

Kiểm tra plugin và theme trước khi nâng

Phần lớn sự cố sau khi nâng PHP đến từ plugin hoặc theme cũ. Trước khi đổi, hãy lập danh sách và xử lý từng nhóm:

  • Plugin còn được cập nhật: lên bản mới nhất và đọc ghi chú tương thích PHP.
  • Plugin lâu không cập nhật: tìm phương án thay thế còn được duy trì.
  • Plugin không còn dùng: gỡ hẳn, đừng chỉ tắt.
  • Theme tự chỉnh sửa: nhờ người viết mã rà các hàm cũ trước khi đổi PHP.

WordPress.org có trang hướng dẫn về việc cập nhật PHP cho chủ website, trình bày cách làm việc với nhà cung cấp hosting và theme, plugin; bạn nên đối chiếu thêm trang này khi lập kế hoạch.

Ghi lại nhật ký thay đổi

Nếu chưa có thói quen sao lưu, xem regular website backups with the 3-2-1 rule. Mỗi lần nâng PHP, hãy ghi lại ngày giờ, phiên bản trước và sau, những plugin đã cập nhật, các lỗi gặp và cách xử lý. Nhật ký này giúp bạn quay lại nhanh nếu có sự cố, và là tài liệu bàn giao khi đổi người quản trị website.

Theo dõi sau khi nâng cấp

Việc này nên nằm trong the monthly WordPress maintenance schedule, cùng với quy trình trong bài upgrading and securing a running website. Đừng dừng ở lần kiểm tra đầu tiên. Trong vài ngày sau, hãy xem nhật ký lỗi, thử lại biểu mẫu và email tự động, và hỏi người trong công ty xem có trang nào lạ không. Với website bán hàng, nên thử đặt một đơn thử vào hôm sau để chắc cổng thanh toán vẫn hoạt động.

2026 update: Later WordPress versions have a Tools > Site Health section to view the PHP version. PHP 5.6 and 7.0 have long been obsolete; the 7.x branches themselves are also out of support. According to the WordPress.org requirements page, the current recommendation is PHP 8.3 or higher, while the minimum is listed as 7.4 (and those versions are also end-of-life). Check php.net and WordPress.org again when planning.

FAQ

I don't know which PHP my website uses. Where do I ask?

Look in the hosting control panel, or ask your hosting provider.

Will upgrading PHP lose data?

Changing the PHP version doesn't delete data, but back up first in case of compatibility errors.

Can I jump straight to the latest version?

Possibly, if your theme and plugins are compatible, but test on a copy first and upgrade step by step if you hit errors.

Reference sources

Need advice on websites, software or security?

Describe the problem, and HVSC engineers will discuss the scope and options suited to your business.

FAQ

I don't know which PHP my website uses. Where do I ask?

Look in the hosting control panel, or ask your hosting provider.

Will upgrading PHP lose data?

Changing the PHP version doesn't delete data, but back up first in case of compatibility errors.

Can I jump straight to the latest version?

Possibly, if your theme and plugins are compatible, but test on a copy first and upgrade step by step if you hit errors.

· Ban biên tập HVSCTổng hợp từ 4 nguồn chính thống, có dẫn nguồnHVSC - Thanh Tuấn thuộc Ban biên tập HVSC, phụ trách mảng web, hosting, tên miền và công nghệ cho doanh nghiệp. Nội dung do HVSC chịu trách nhiệm.Bài khác của HVSC - Thanh Tuấn:Xem tất cả bài của HVSC - Thanh Tuấn →
Was this article helpful to you?Tap a star. Your feedback helps the editorial team write articles that better fit your needs.

📚 Related articles

See more in Technology