How to Increase PHP memory limit

PHP memory limit sometimes makes it problem to upload. please check way to increase your memory limit. Way 1:  Modify php.ini Search “memory_limit” in your php.ini, and change the value of it. If no “memory_limit” found, add the following line at the end of php.ini memory_limit = 2568M ; Save file. And restart Apache. Way 2: .htaccess Find the “.htaccess” …

Continue Reading

Memcache vs Memcached

Memcache module provides handy procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications. The Memcache module also provides a session handler (memcache). Memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating …

Continue Reading

How do I turn off PHP Notices?

Very simple <?php // Turn off all error reporting error_reporting(0); ?> Other interesting options for that function: <?php // Report simple running errors error_reporting(E_ERROR | E_WARNING | E_PARSE); // Reporting E_NOTICE can be good too (to report uninitialized // variables or catch variable name misspellings …) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // Report all errors except E_NOTICE // …

Continue Reading

Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes)

This is memory limit problem. You can solve your problem several way. Answer 1 :  ini_set(‘memory_limit’, ‘-1′); // it mean memory unlimited Answer 2 :  If you have access to your PHP.ini file, change the line in PHP.ini try with memory_limit = 64M ; Maximum amount of memory a script may consume (64MB) If you don’t access php.ini file please …

Continue Reading

How to rename list of images in php

<?php $directory = “folder_name/”;       // Folder name of  images //get all image files with a .jpg extension. $images = glob($directory . “*.jpg”); $i= 1; foreach ($images as $fileinfo) { $fromImg = “D:/xampp/htdocs/imagesize/”.$fileinfo; // Read  all images of you directroy $imageName = “gallery”.$i.”.jpg”;  // Rename your own way $toImg = “D:/xampp/htdocs/imagesize/rename/”.$imageName; //Rename images location copy($fromImg,$toImg); $i++; } ?> Hope it will …

Continue Reading