{"id":18,"date":"2014-07-26T05:38:50","date_gmt":"2014-07-26T05:38:50","guid":{"rendered":"http:\/\/angelwings.net\/blog\/?p=18"},"modified":"2014-07-26T05:38:50","modified_gmt":"2014-07-26T05:38:50","slug":"tips-to-optimise-your-php-ini-file-for-prestashop","status":"publish","type":"post","link":"https:\/\/angelwings.net\/blog\/tips-to-optimise-your-php-ini-file-for-prestashop\/","title":{"rendered":"Tips to Optimise your php.ini File for PrestaShop"},"content":{"rendered":"<p>PrestaShop system requirements Summary:<br \/>\nWeb server: Apache 1.3, Apache 2.x, Nginx or Microsoft IIS<br \/>\nPHP 5.4+<br \/>\nMySQL 5.0+<br \/>\nPHP memory_limit 2048M<br \/>\nupload_max_filesize 100M<br \/>\nmax_execution_time 1000<br \/>\npost_max_size 100M<br \/>\nmax_input_time -1<\/p>\n<p>PHP extensions: GD, cURL, SimpleXML, SOAP<br \/>\nTo improve performances: MemCached, mcrypt PHP extension<\/p>\n<p>Source: http:\/\/www.prestatraining.com\/12-tips-to-optimise-your-php-ini-file-for-prestashop\/<\/p>\n<p>Memory and Size Limits<\/p>\n<p>There are times when you may encounter an error because you\u2019ve exceeded a PHP limit that is set on your server.\u00a0 You can increase these limits in your php.ini file.<\/p>\n<p><strong>Tip<\/strong>: One common limit that is exceeded is the memory limit.\u00a0 One case where you may encounter this limit is when you upload a full-resolution image and PHP is unable to load the entire image into memory.\u00a0 In this case, you could manually reduce the size of the image before uploading it, or you could increase the memory limit by searching for and changing the memory_limit setting in php.ini, or add it if it doesn\u2019t exist:<\/p>\n<p>; Set memory limit in megabytes<br \/>\nmemory_limit = 128M<\/p>\n<p>If you are using shared hosting, which is common with inexpensive hosting packages, try to set the smallest limit you can that stops the memory limit error.\u00a0 If you set the memory limit too high, it is possible for inefficient code to use up too much memory and cause performance issues for other users on your server.\u00a0 In that case, your host may shut down your account until you reduce your memory usage.<\/p>\n<p>If you find yourself needing a high memory limit, it may be better for you to upgrade to a virtual private server (VPS) or a dedicated server so that you don\u2019t have to share the server\u2019s RAM.\u00a0 You can then increase the RAM as high as you like, as long as it doesn\u2019t exceed the total RAM that is available in the server.<\/p>\n<p><strong>Tip<\/strong>: The other common limit that is exceeded is the maximum execution time.\u00a0 One case where you may encounter this limit is when you import a large number of products.\u00a0 Once the maximum execution time has elapsed, PHP will stop the script and display an error message.\u00a0 You can increase the maximum execution time by searching for and changing the max_execution_time setting in php.ini, or add it if it doesn\u2019t exist:<\/p>\n<p>; Set maximum execution time in seconds<br \/>\nmax_execution_time = 120<\/p>\n<p>Like the memory limit, if you are using shared hosting, you should try to set the shortest time you can that stops the timeout error.\u00a0 If you set the maximum execute time too high, it is possible for inefficient code to cause many PHP scripts to be running at the same time for an extended period, using up a lot of the server\u2019s resources.\u00a0 In that case, your host may shut down your account until you reduce the number of PHP scripts that are running.<\/p>\n<p>If you find yourself needing a high maximum execution time, it may be better for you to upgrade to a VPS or a dedicated server so that you don\u2019t have to share the server\u2019s resources.<\/p>\n<p><strong>Tip<\/strong>: When uploading a large product image, you may also encounter the maximum file upload size limit.\u00a0 In this case, you could manually reduce the size of the image, or you could increase the maximum file upload size by searching for and changing the upload_max_filesize setting in php.ini, or add it if it doesn\u2019t exist:<\/p>\n<p>; Set maximum file upload size in megabytes<br \/>\nupload_max_filesize = 32M<\/p>\n<p>Set the value to the size of the largest product image or downloadable product you expect to upload through the Back Office.\u00a0 That way, you will get an error message if you accidentally upload a product image that is too high resolution.\u00a0 It is best to resize product images to the resolution they are displayed in the Fancybox before uploading to minimise the amount of disk space used on the server.\u00a0 Downloadable products should also be compressed as ZIP files to reduce the amount of space used.<\/p>\n<p><strong>Tip<\/strong>: Two more limits that may be encountered are the maximum post size and maximum input time.\u00a0 One case where you may encounter these limits is when you are saving a large number of module translations.\u00a0 In this case, you will need to increase the maximum post size and maximum input time by searching for the post_max_size and max input time settings in php.ini, or adding them if they don\u2019t exist:<\/p>\n<p>; Set maximum post size in megabytes<br \/>\npost_max_size = 32M<\/p>\n<p>; Set maximum input time in seconds<br \/>\nmax_input_time = 180<\/p>\n<p>If you are using shared hosting, you should try to set the smallest values you can that stop the error messages.\u00a0 A value that is too high may use up too much disk space or other resources on the server, causing performance issues for other users on your server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PrestaShop system requirements Summary: Web server: Apache 1.3, Apache 2.x, Nginx or Microsoft IIS PHP 5.4+ MySQL 5.0+ PHP memory_limit 2048M upload_max_filesize 100M max_execution_time 1000 post_max_size 100M max_input_time -1 PHP extensions: GD, cURL, SimpleXML, SOAP To improve performances: MemCached, mcrypt PHP extension Source: http:\/\/www.prestatraining.com\/12-tips-to-optimise-your-php-ini-file-for-prestashop\/ Memory and Size Limits There are times when you may encounter [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[103],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-ecommerce","tag-prestashop"],"_links":{"self":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":0,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"wp:attachment":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}