Categories
General

How to Install Serverless on a Mac ?

Install Node server

brew install node

Install serverless

npm install -g serverless

Configure Serverless

serverless config credentials --provider aws -o --key XXXXXXXXXXXXXXXXX --secret XXXXXXXXXXXXXXXXXX

Serverless Login

serverless login

Serverless Deploy

serverless deploy


Categories
Technical

brew Error: Directory not empty @ dir_s_rmdir – /private/tmp/d20210315-27447-1b2auy5

chown davidr:wheel /private/tmp/

fixed my issue

Categories
BEST PHP CODE

Force PHP ERRORS

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
Categories
General

Install Node NPM on mac

brew install node

Categories
General

REDIS LARAVEL ConnectionException Error while reading line from the server.

Redis connection issue laravel Fix due to SSL read error on connection

Database config: config/database.php

'redis' => [
        'client' => 'predis',
        'cluster' => false,

        'default' => [
            'scheme'   => env('REDIS_SCHEME', 'tls'),
            'host'     => env('REDIS_HOST', 'localhost'),
            'password' => env('REDIS_PASSWORD', null),
            'port'     => env('REDIS_PORT', 6379),
            'database' => 0,
        ],
        'cache' => [
            'scheme'   => env('REDIS_SCHEME', 'tls'),
            'host'     => env('REDIS_HOST', 'localhost'),
            'password' => env('REDIS_PASSWORD', null),
            'port'     => env('REDIS_PORT', 6379),
            'database' => 1,
        ],
        'queue' => [
            'scheme'   => env('REDIS_SCHEME', 'tls'),
            'host'     => env('REDIS_HOST', 'localhost'),
            'password' => env('REDIS_PASSWORD', null),
            'port'     => env('REDIS_PORT', 6379),
            'database' => 2,
        ],
        'options' => [
            'parameters' => [
                'password' => env('REDIS_PASSWORD', null),
            ],
        ],
    ]
Categories
REDIS

Redis MAC

brew update
brew install redis

To Start

brew services start redis

to stop 

brew services stop redis

Or, if you don’t want/need a background service you can just run:

redis-server /usr/local/etc/redis.conf

Test if Redis server is running.

redis-cli ping

If it replies “PONG”, then it’s good to go!

Location of Redis configuration file.

/usr/local/etc/redis.conf

Uninstall Redis and its files.

brew uninstall redis
rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Categories
Technical

How to fix ? Symfony\Component\Debug\Exception\FatalErrorException Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed …$fetchModeArgs)

How to fix ?

Symfony\Component\Debug\Exception\FatalErrorExceptionDeclaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed …$fetchModeArgs)

#1 – I removed from composer.json the following line

"doctrine/dbal": "^2.10",

#2 – Run composer upgrade

#3 – Run composer upgrade

Voila Job Done !

Categories
Technical

How to switch PHP version on a mac with brew?

$ brew unlink [email protected] 

$ brew install [email protected]
$ brew link [email protected] --force --overwrite

Type the following to force the php -v to use latest brew php version installed

PATH="/usr/local/opt/[email protected]/bin:$PATH"

The command you provided is used to modify the PATH environment variable in a Unix-like operating system, such as Linux or macOS. The PATH variable is a list of directories that the operating system searches when you enter a command in the terminal.

The command export PATH="/usr/local/opt/[email protected]/bin:$PATH" adds the directory /usr/local/opt/[email protected]/bin to the beginning of the PATH variable. This means that when you run a command in the terminal, the system will check this directory first for the corresponding executable file. If the file is found there, it will be executed. If not, the system will continue searching the remaining directories in the PATH variable.

In this specific case, it appears that the command is adding the directory for the PHP version 8.1 to the PATH. This allows you to use the PHP 8.1 command-line tools and executables conveniently from anywhere in the terminal.

Categories
General

How to save (control + s ) file and send [sftp,ftp] to web server – PHPStorm


Categories
Database

MACos DBeaver configuration connection backup Json

On OSX (Mac) here:

/Users/${USER}/Library/DBeaverData/workspace6/General/.dbeaver/