And you’re all set!
Page 3 - Blog
-
- May 22, 2021
Once again, I have a problem with my apache virtual host configuration. (The default configuration is used instead of my specific one).
The problem is not really the misconfiguration but how to solve it.
Does anyone have good advice to do resolve this kind of problem quickly?
Some more pieces of information.
The default conf file is this one:
NameVirtualHost * <VirtualHost *> ServerAdmin webmaster@localhost DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature -
- May 22, 2021
I tried to install an extension from the Magento market place but I got an incompatibility error...
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on the current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.
Problem 1
- laminas/laminas-dependency-plugin is locked to version 1.0.3 and an update of this package was not requested.
- laminas/laminas-dependency-plugin 1.0.3 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 2
- magento/magento-composer-installer is locked to version 0.1.13 and an update of this package was not requested.
- magento/magento-composer-installer 0.1.13 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 3
- dealerdirect/phpcodesniffer-composer-installer is locked to version v0.5.0 and
-
- May 18, 2021
I ran into this error when doing a
pecl install imagickon a Mac.
$ pecl install imagick [...] checking for pkg-config... no pkg-config not found configure: error: Please reinstall the pkg-config distribution ERROR: `/private/tmp/pear/temp/imagick/configure --with-php-config=/usr/local/opt/php/bin/php-config --with-imagick' failedBy default, the needed
pkg-configbinary isn’t installed. You can install it via Homebrew.$ brew instal pkg-config ==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.2.catalina.bottle.1.tar.gz ==> Downloading from https://akamai.bintray.com/c0/c0a6927c8e404f6db8b14d6644a218b22ddb0d27be1fa0a69d15bf0d9a6875ae?__gda__=exp=1571254410~hmac=2e306f9876b2de0ae458dcbf1e05bc609777305eb8ad5e25125e9467e8bfcfeb&response-content-disposition= ######################################################################## 100.0% ==> Pouring pkg-config-0.29.2.catalina.bottle.1.tar.gz /usr/local/Cellar/pkg-config/0.29.2: 11 files, 623KB -
- May 18, 2021
I have error when i add module..
Please re-run Magento compile command
so i run below command but also display error that below when run command from root,
php magento setup:di:compile
-
- April 02, 2021
Recently, I updated the PHP on my machine to version 7.4 using homebrew for Mac OS only to then realise that one of my older projects that I still needed to maintain, made on version 7.2 would no longer work due to using depreciated PHP functions such as array_key_exists.
The long term solution to this would be to update the project so it’s compatible with PHP version 7.4, but for the sake of time, and potential fixes that needed to go out immediately, I needed to be able to develop this project in the environment it’s running in. Fortunately, I use valet to develop all my PHP applications a tool I can only recommend for PHP developers. Valet allows you to develop PHP applications on your local machine with a much higher level of ease than I’ve found using other services such as dockers or XAMP/MAMP.
Valet, with the use of homebrew, supports switching your system PHP version at will to any version installable via homebrew. So switching versions can be as simple as the following:
brew search
-
- October 18, 2020
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.
-
- October 02, 2020
As you know, configuring robot.txt is important to any website that is working on a site’s SEO. Particularly, when you configure the sitemapto allow search engines to index your store, it is necessary to give web crawlers the instructions in the robot.txt file to avoid indexing the disallowed sites. The robot.txt file, that resides in the root of your Magento installation, is directive that search engines such as Google, Yahoo, Bing can recognize and track easily. In this post, I will introduce the guides to configure the robot.txt file so that it works well with your site.
Following steps to Configure robots.txt in Magento 2
- On the Admin panel, click
Stores. In theSettingssection, selectConfiguration. - Select
DesignunderGeneralin the panel on the left - Open the
Search Engine Robotssection, and continue with following:- In
Default Robots, select one of the following:- INDEX, FOLLOW
- NOINDEX, FOLLOW
- INDEX, NOFOLLOW
- NOINDEX, NOFOLLOW
- In the
Edit Custom
- In
- On the Admin panel, click
-
- September 22, 2020
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 () { Route::get('api/documentation', '\L5Swagger\Http\Controllers\SwaggerController@api')->name('l5swagger.api'); }); -
- September 22, 2020
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 ]; }Examples:
1. If you are using a route group:
Route::group(array('prefix' => 'api/v2'), function() { Route::post('users/valid','UsersController@valid'); });Your
$exceptthe array looks like:protected $except = ['api/v2/users/valid'];2. If you are using a simple route
Route::post('users/valid','UsersController@valid');Your
$exceptthe array looks like:protected $except = ['users/valid'];3. If you want to exclude all routes under the main route (users in this case)
Your
$exceptthe array looks like:protected $except = ['users/*'];see: http://laravel.com/docs/master/routing#csrf-excluding-uris
-
- September 21, 2020
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 remove php*
Remove old web server installs
$ sudo yum remove httpd*
Update
yumpackage repository$ sudo yum clean all $ sudo yum upgrade -y
Install Apache 2.4
$ sudo yum install httpd24
Install PHP 7 packages
$