Blog
-
HTTP Strict Transport Security (HSTS) instructs web browsers to only use secure connections (https://) for all future requests when communicating with a web site. Doing so helps prevent SSL protocol attacks, SSL stripping, cookie hijacking, and other attempts to circumvent SSL protection.
-
In Laravel 5 this has changed a bit. Now you can simply add the routes you want to exclude from csrftoken verification, in $except an array of the class 'VerifyCsrfToken' (\app\Http\Middleware\VerifyCsrfToken.php):
class VerifyCsrfToken extends BaseVerifier { protected $except = [ // Place your URIs here ]; }
-
csrf_token() is empty in l5-swagger and couldn't do any request.
I have tried to request it from the postman and it works. but in swagger, it didn't. I have taken a look from this link (Laravel 5 csrf_token value is Empty) but I still have no idea how to solve my problem.
How can I get the csrf_token inside my l5-swagger view?
Answer
You should try to add this in /routes/web.php
Route::group(['middleware' => 'web'], function () {
-
Posted: September 21, 2020Categories: Blog
For one of my recent projects, I wanted to make use of the free allowance that AWS gives for SES.
One of the conditions of the SES allowance was that your calling app needs to be hosted on EC2.
I’ve not used EC2 before so I figured this would be a good way to dive into it.
Whilst I would never usually install software like a composer on a production server, this was pure to test things out.
So after signing up for AWS and creating a local ubuntu server on an EC2 t2micro instance then cloning down the project I ran composer install to come across the following message:
1
2
3
4
5
6
7
8
9 -
By now you may know that PHP 7 has been available for quite some time now coming with a number of improvements over version 5. It may be wise to upgrade to PHP7 when running for instance a WordPress using Amazon AWS where you are responsible for any upgrades.
Also as of July 2016, Amazon officially added PHP7 to its repository so you can install it using
yum
. So first thing I did was create a backup image of my EC2 instance before I went on with the upgrade. Once I had my backups done and proceeded with the PHP 7 upgrade.Here are the steps I took in order to upgrade from PHP 5.x to 7.
Login to your Linux instance and perform the regular system updates first
$ sudo yum update
Stop the running webserver
$ sudo service httpd stop
Remove any existing PHP packages
$ sudo yum
-
Posted: January 19, 2019
The topic today is one of the popular errors you will meet. As if the error message shows “An error has happened during application run. See exception log for details” in Magento 2 when you have uploaded Magento CE latest version and want to install it on your server, so what should you do? Here is the right solution for you.
How to resolve: “An error has happened during application run. See exception log for details”
Please open the
.htaccess
from the root and comment out the first line:SetEnv MAGE_MODE developer
-
Posted: June 17, 2017Categories: PHP
Install phpunit
Installing phpunit package on Ubuntu 16.04 (Xenial Xerus) is as easy as running the following command on terminal:
sudo apt-get update sudo apt-get install phpunit
-
- Delete the Module folder from
{folder path}\app\code
- Remove module entry from below tables
core_config_data
&setup_module
-
Run command
{magento project root path}>{php path}\php bin/magento setup:upgrade => Setup Upgrade
{magento project root path}>{php path}\php bin/magento cache:flush => Clear Cache
- Delete the Module folder from
-
Depending on your configuration it may also be unecessary. If you are in
default
ordev
mode you do not need it.You just need it on
production
modeFrom command line and from your Magento root path:
php bin/magento setup:di:compile
P.S: After installing your module make sure you ran:
php bin/magento setup:upgrade
-
Posted: June 17, 2017Categories: PHP
Integrity constraint violation: 1062 Duplicate entry ‘4-Images’ for key ‘EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME’, query was: UPDATE `eav_attribute_group` SET `attribute_group_name` = ? WHERE (`attribute_group_id`=10)
This particular error presented itself while upgrading from Magento 2.0.2 to Magento 2.1.x and stops the upgrade process. We’ve discovered the issue is related to old data from the previous Magento 1.9.x installation. In order to over come this error, you’ll need to delete a row from the database.
Run the following MySQL query to find and delete the offending attribute.
1delete
from