目前Infinitehost的有些主機的記憶體大小限制是32M,在使用WordPress時可能會不夠用,你可以進行如下修改。
無論您是否使用Infinitehost,您可能會碰到類似以下問題:
”
Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /home2/marine/public_html/wp-includes/kses.php(1030) : runtime-created function on line 1
”
”
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 491520 bytes) in /home2/marine/public_html/wp-includes/class-simplepie.php on line 4134
”
下面是我最喜歡的一個主機商提供給我的一個解決方案,分享給各位用戶。
1. 下載這個php.ini.zip的檔,然後在cpanel的“檔案管理員”把這個檔上傳到public_html目錄,接著選中php.ini.zip檔,點右上角的“解壓縮”。
我們可以看到在public_html有了一個php.ini的文件了。
2. 修改public_html目錄下的.htaccess檔,添加下面分割線內容在 .htaccess 文件。
———————————————
suPHP_ConfigPath /home/username/public_html/
———————————————
提示: 用你所在的主機cpanel的用戶名替換掉 username,home這個有些主機預設是home2的你可能也要改。