What are the best WordPress/ PHP settings?
You’ve finally gotten your hands on your theme or plugin but when you go to install it you’re faced with an error telling you “uploaded file exceeds the upload_max_filesize” or any other message related to limited memory.
This and many more issues such as white screen, demo content fails when importing, empty page content and other related issues are due to low PHP configuration limits.
In the majority of cases, you can’t update the PHP version on your own and you’ll need to contact your host and ask them to update it.
If you use PHP version 7.3 or higher you’ll benefit from the faster performance and higher security.
Reportedly, sites using PHP 7.3 run 9% faster than sites using PHP 7.2. In terms of security, since you won’t be using outdated PHP codes, it will be much more difficult for hackers to access your website.
Plus, there is the added benefit of the quality of life improvement features such as error handling. On that note, it is important to point out that you should also keep your CMS WordPress updated as well.
Host configurations: There are two ways of doing resolving the limited memory issue.
One is to contact your host provider and the other is to do it yourself by accessing your php.ini file through your cPanel or an FTP program.
To access these values, please edit the “php.ini” file which should be located in the host (if you can’t find it then contact your host service provider). In case your host doesn’t allow you to do that make sure to ask them what PHP version is running on your hosting and also request an increase in the values listed below.
1. Find php.ini in Public_html folder, right-click it and choose “edit” and click “edit” again
2. In the text editor add following code:
upload_max_filesize = 32M
post_max_size = 48M
memory_limit = 256M
max_execution_time = 600
max_input_vars = 1000
max_input_time = 400
3. Click “Save changes” in the top right corner and close the window
It is strongly recommended that you do these configurations before you try to import a demo. Doing so would prevent any pages from not being imported correctly or any other issues that could arise in the meantime. If you’ve got a web host, theme, or plugin that is unwilling to upgrade their PHP version then it’s probably time to move on to a better provider, one that understands the importance of this matter.