Am trying to set maximum execution time, memory limit, max upload that can be execute by the script. I can do that in php as follows.
ini_set('max_execution_time', '300'); //300 seconds = 5 minutes
ini_set('memory_limit', '64M'); //maximum mb to be consumed by script
ini_set('upload_max_size', '4M'); //maximum mb to be uploaded by script
My question is what is the wordpress equivalent ways of doing that. Thanks
Am trying to set maximum execution time, memory limit, max upload that can be execute by the script. I can do that in php as follows.
ini_set('max_execution_time', '300'); //300 seconds = 5 minutes
ini_set('memory_limit', '64M'); //maximum mb to be consumed by script
ini_set('upload_max_size', '4M'); //maximum mb to be uploaded by script
My question is what is the wordpress equivalent ways of doing that. Thanks
Share Improve this question asked Sep 30, 2019 at 13:15 chinazaikechinazaike 1072 bronze badges 1- Answer: No. WordPress is not scripting or programming language and is not a server environment. It is just a content management system. – Max Yudin Commented Sep 30, 2019 at 13:42
3 Answers
Reset to default 0Have you tried this?
Add the following to wp-config.php:
set_time_limit(300);
Add the following to .htaccess:
php_value max_execution_time 300
You can set all those into wp-config.php file. You can see that file in WordPress root.
ini_set('max_execution_time', '300'); //300 seconds = 5 minutes
ini_set('memory_limit', '64M'); //maximum mb to be consumed by script
ini_set('upload_max_size', '4M'); //maximum mb to be uploaded by script
Apart from this you can set that into .htaccess file as well.
php_value max_execution_time 300
php_value memory_limit 64M
php_value upload_max_size 4M
if you have user.ini file you can define those values as well
max_execution_time = 300
memory_limit = 64M
post_max_size = 4M
The best option that I have was to set the codes below on top of the page of every script that runs my applications
ini_set('max_execution_time', '300'); //300 seconds = 5 minutes
ini_set('memory_limit', '64M'); //maximum mb to be consumed by script
ini_set('upload_max_size', '4M'); //maximum mb to be uploaded by script