Skip to main content

Posts

Showing posts with the label cakephp 3

CakePHP bin cake: Permission denied terminal error

 CakePHP bin/cake: Permission denied error in terminal/cmd Sometimes when we try to run commands on our server or on linux system , terminal gives error like bin/cake: Permission denied and even if we logged in as a root user, still its gives error. To solve this error please run below command, that will give permission to bin/cake folder  chmod +x bin/cake The above command will work for CakePHP 3 and 4 , and if you are using old version then try to run below command chmod +x Console/cake After running above commands , CakePHP will allow to run commands through terminal Thank you

Cakephp 4: How to convert string to hash password

CakePHP 4: How to convert string to hash password This tutorial works for both CakePHP  3 and CakePHP 4. Sometimes we want to add custom login or wants to add custom login  or we want client side password hashing using cakephp Hash functions , so for that we need to use DefaultPasswordHasher which provides inbuilt functionality to check two passwords , compare it or convert a string to Hash etc. To use password hashing please follow below steps:- Step 1 Call a class after the namespace. use Cake\Auth\DefaultPasswordHasher; Step 2 Now we can use functions of DefaultPasswordHasher().  Use below code to change a simple string password to a secure string and its non reversible . $password = "My Password String"; $hasher = new DefaultPasswordHasher(); $newPassword = $hasher->hash($password);  Now if you print $newPassword to test its working or not, then you will get it an unique hash everytime on refresh, because CakePHP use different mechanism to handle hash that is ...

CakePHP Paypal payment gateway Integration

How to Integrate Paypal Payment Gateway with Cakephp Cakephp 3 is a PHP framework that is the most popular for rapid application development and Paypal is the most popular payment gateway. So today we will learn how to integrate Paypal with CakePHP. For this tutorial, I am using CakePHP 4 which is the latest version of CakePHP but steps will be the same for CakePHP 3x. So Keep following the below steps. First, we will create a sandbox account to test our payment gateway later and we need to create both accounts personal and business so we can test, so if you have already created that then skip this step, and if you want to create a new sandbox test account then click here. Also, we need client id and secret that we can get by creating an app in the PayPal developer account. Go to the developer website and click on My Apps & Credentials then click on Create App Button Then fill the App name and select a business account that we have recently creat...