Reduce Image Size To 10KB Using PHP code

//Copy this function in App Controller in cakePHP public function resizeImage($sourceImage, $targetImage, $maxWidth, $maxHeight, $quality = 80) { // Obtain image from given source file. /* if (!$image = @imagecreatefromjpeg($sourceImage)) { return false; } */ $info = getimagesize($sourceImage); if ($info[‘mime’] == ‘image/jpeg’) $image = imagecreatefromjpeg($sourceImage); elseif ($info[‘mime’] == ‘image/gif’) $image = imagecreatefromgif($sourceImage); elseif ($info[‘mime’] == […]

Code Generation with Bake in cakePHP

The cake console is run using the PHP CLI (command line interface). If you have problems running the script, ensure that: You have the PHP CLI installed and that it has the proper modules enabled (eg: MySQL, intl). Users also might have issues if the database host is ‘localhost’ and should try ‘127.0.0.1’ instead, as […]

Authentication and Authorization in cakePHP 3.4

Following our Blog Tutorial example, imagine we wanted to secure access to certain URLs, based on the logged-in user. We also have another requirement: to allow our blog to have multiple authors who can create, edit, and delete their own articles while disallowing other authors from making changes to articles they do not own. Creating All User-Related […]

How to install latest version of cakephp by composer

Requirements: HTTP Server for example Apache: Having mod rewrite is preferred but no meand requied. PHP 5.9 or greater (including php 7). mbstring php extension. intl extention (php_intl). Install Composer After that run command prompt and go to xampp/htdocs like I have xampp setup in E drive so run command into command prompt E: cd xampp […]

What is CakePHP? Why Use it?

CakePHP is a free, open-source, rapid development framework forPHP. It’s a foundational structure for programmers to create web applications. Our primary goal is to enable you to work in a structured and rapid manner–without loss of flexibility. CakePHP takes the monotony out of web development. We provide you with all the tools you need to […]

How to setup a Cron Job for CakePHP 2.x on shared hosting

The Initial Setup Before begining the tutorial, its important to understand CakePHP Console and Shells. You can read about them in the CakePHP 2.x Cookbook. Basically, console applications are ideal for handling a variety of background tasks such as maintenance, and completing work outside of the request-response cycle. Using the console, you can create shells […]

Top 20 CakePHP Interview Questions and Answers

Here there are many questions and answers about How CakePHP Framework works? and basic questions related to CakePHP framework functionality. Q-1 What is CakePHP ? Ans. CakePHP is a free, open-source, rapid development framework for PHP. It’s a foundational structure for programmers to create web applications. There is number of in built component like Ajax, […]

CakePHP Interview Questions and Answers for experienced

Question: What Is The Current Stable Version Of CakePHP? 3.1.1 / 6 October 2015 Question: What are the System requirement for cakephp3.0 PHP 5.4.16 or greater. mbstring extension intl extension MySQL (5.1.10 or greater) Question: What Is The Name Of Cakephp Database Configuration File Name And Its Location FileName: database.php.default Location: /app/config/database.php.default Question: What is […]

Top 50 CakePHP Interview Questions and Answers

What is Cakephp? CakePHP is a free, open-source, rapid development framework for PHP. It’s a foundational structure for programmers to create web applications. CakePHP goal is to enable developers to work in a structured and rapid manner–without loss of flexibility. CakePHP takes the monotony out of web development. When CakePHP was developed? CakePHP started in […]