WordPress站点部分地出现“严重错误”的一些可能的解法

Wide crayon drawing of a gender-neutral individual looking perplexed at a computer screen displaying the words 'critical error'. The ambiance is tense, with dim lighting highlighting the sharp contrast between the screen's glow and the surrounding darkness.

解题

有时候,自托管WordPress站点可能会部分地出现“严重错误”的报错,报错文如下:

There has been a critical error on this website.

题目里这个“部分地”,意思就是并非全站都崩盘了。可能只是仪表盘无法访问,报错。或者是文章存档或仪表盘的文章列表加载到两三页后,加载不下去了,为空;但是文章并没有消失,通过一个一个地点击“前一篇文章”还是能够访问得到。

一个可能的成因

部分地出现“严重错误”,成因很复杂、多样。一个可能的成因,是服务器内存、存储空间不足,导致程序性能受到了限制。

一些可能的解法

可以考虑提高PHP内存上限。默认为128M,可按需调到256M、512M甚至更多。

服务器的存储空间也可以进行一些腾退,例如删除无用的系统日志文件、将WordPress的媒体文件转移到其他的云存储、图床服务(并记得修正URL)等。

还可以考虑提高SWAP大小

Discover more from 山月

Subscribe now to keep reading and get access to the full archive.

Continue reading