How to Increase PHP memory limit
-
zendnwar
-
May 19, 2016
-
PHP Basic
-
2 Comments
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
Revolution of PHP 7: Usage of Return Types and Removal of Artifacts
-
zendnwar
-
January 29, 2015
-
PHP Basic
-
0 Comments
28 January 2015 Boston: As the date for PHP 7’s release is approaching rapidly, the group is working really hard to fix certain issues by removing the artifacts and adding some features. There are several RFCs on which we can discuss and study a lot more. But here, we are just concentrating on the three main points mentioned below. PHP 5.7 …
Continue Reading
Memcache vs Memcached
-
zendnwar
-
November 25, 2014
-
PHP Basic
-
0 Comments
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 to Transform a String from Multi-Line to Single-Line in PHP?
-
zendnwar
-
August 18, 2014
-
PHP Basic
-
1 Comment
It is very simple. Just add below code. echo str_replace(array(“\r”,”\n”),””, $str);
Continue Reading
session_start(): Cannot send session cache limiter
-
zendnwar
-
June 18, 2014
-
PHP Basic
-
219 Comments
It has very simple solution <?php ob_start(); session_start(); ?> Above session write before head section . Like <?php ob_start(); session_start(); ?> <!DOCTYPE html> // html code </html>
Continue Reading
How to get random value in an array ?
-
zendnwar
-
June 3, 2014
-
PHP Basic
-
0 Comments
It is very simple. PHP random array function : array_rand() http://php.net/manual/en/function.array-rand.php $ran = array(1,2,3,4); $randomValue = array_rand($ran, 1);
Continue Reading
How do I turn off PHP Notices?
-
zendnwar
-
May 15, 2014
-
PHP Basic
-
0 Comments
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
TCPDF Fatal error: Allowed memory size of 134217728 bytes exhausted
-
zendnwar
-
August 26, 2013
-
PHP Basic
-
0 Comments
This is only memory limit problem. you can increase ini_set() function. Hope so it will work.
Continue Reading
Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes)
-
zendnwar
-
August 26, 2013
-
PHP Basic
-
2 Comments
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
-
zendnwar
-
July 3, 2013
-
PHP Basic
-
0 Comments
<?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