Friday, November 18, 2022

How to Set Up a Redis Server And Use With PHP

Here is the article.

This PHP tutorial helps to work the Redis module with php, We will install Redis server into windows and PHP extension of redis into xampp. This tutorial also has a simple PHP script to communicate with redis and php.

I am using redis in PHP application to create a Cache system for faster access to data. This means that Redis is fast, but is also non-volatile.I am using php_redis client but you can use other redis clients as well like Predis.

Redis as an advanced key-value database storage system, Redis can also support complex data structures like strings, hashes, lists, sets, sorted sets, bitmaps and hyperlogs as its key values. It’s often referred to as a NoSQL database.

What is Redis

Redis is an open source(BSD licensed), in-memory data structure store, used as a database, cache and message broker written in C. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with redis queries.

Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

We will download redis for window from Here. You can download redis separately for windows32 and windows 64. You can get redis command information from Redis Commands Docs.

Also checkout other tutorials of PHP Cache,

How To install Redis on Windows

We will follow the following steps to install redis server into windows.

  • Download redis server from the official website.
  • Extract the zip file of the downloaded redis file.
  • Place the unzipped file into d:\redis directory.
  • Run redis-server.exe from d:\redis directory.
  • Then Run redis-cli.exe from d:\redis directory.

How to enable Redis extension in Xampp  

We can enable redis PHP extension by following steps:

  • Download php_redis.dll file from PECL libs. Download the extension as per your current PHP version.
  • Copy the php_redis.dll and paste it to the following folder in XAMPP Server extension directory(D:\XAMPP\php\ext).
  • Open the php.ini file and add extension=php_redis.dll line to this file.
  • Restart XAMPP server
  • Open phpinfo() of XAMPP server and search Redis, if found that means you successfully integrated Redis with PHP.

Simple PHP Redis Example

We will create a simple PHP script that will set the key into redis and get the key value from Redis server. The Redis() method helps to create instance of redis. The $redis->set(key, val) method is used to store value against the key name. The $redis->get(keyname) method is used to get the stored value of the passed key name.

try {
//create redis instance
$redis = new Redis();
//connect with server and port
$redis->connect('localhost', 6379);
//set value
$redis->set('website', 'www.phpflow.com');
//get value
$website = $redis->get('website');
//print www.phpflow.com
echo $website;
} catch (Exception $ex) {
echo $ex->getMessage();
}

PHP version

I like to install Redis for my XAMPP installed on Windows operating system. 

https://stackoverflow.com/questions/49463762/how-to-know-the-version-of-php-is-used-on-xampp

http://localhost:8080/dashboard/phpinfo.php

PHP version 8.1.6

Wednesday, November 16, 2022

How To Set Up Redis as a Cache for MySQL with PHP on Ubuntu 20.04

Here is the article. 


How to Install and Configure Redis on WordPress (Boost Your Site’s Performance)

Here is the article.

Redis is among the top WordPress caching tools to speed up your website. And that’s why it is globally available on every Cloudways server as an optional installation.

Cloudways believes in combining fast speeds, high performance, stability, and great support on its WordPress servers. Thus, it offers a PHP-powered stack with multiple cache layers, and the Redis Object Cache is a part of that layer.

This blog focuses on how to use Redis cache on your WordPress site and improve the site’s performance via cache plugins like Breeze. For more technically-sound users, this article also covers how to use the Redis Object Cache with W3TC.

Optimize WordPress Database Using Plugins

 Here is the article. 

When it comes to WordPress, many complex tasks can easily be done by using a plugin. A number of free and paid WordPress database optimization plugins are available online. I recommend the following two plugins that can be used to optimize WordPress databases.

1. Breeze

Breeze is a lightweight high-performance WordPress optimize plugin developed by Cloudways. It is a free plugin and comes pre-installed with WordPress installation in Cloudways.


How to Set Up a Redis Server And Use With PHP

Here is the article.

How To Enable Redis Extension In Xampp

We can enable redis PHP extension by following steps:

  • Download php_redis.dll file from PECL libs. Download the extension as per your current PHP version.
  • Copy the php_redis.dll and paste it to the following folder in XAMPP Server extension directory(D:\XAMPP\php\ext).
  • Open the php.ini file and add extension=php_redis.dll line to this file.
  • Restart XAMPP server
  • Open phpinfo() of XAMPP server and search Redis, if found that means you successfully integrated Redis with PHP.

Total Household Debt Reaches $16.51 trillion in Q3 2022

 Total Household Debt Reaches $16.51 trillion in Q3 2022

PRESS RELEASE

Total Household Debt Reaches $16.51 trillion in Q3 2022; Mortgage and Auto Loan Originations Decline

Year-over-year increase in credit card balances is largest in more than 20 years
November 15, 2022

NEW YORK—The Federal Reserve Bank of New York's Center for Microeconomic Data today issued its Quarterly Report on Household Debt and Credit . The Report shows an increase in total household debt in the third quarter of 2022, increasing by $351 billion (2.2%) to $16.51 trillion. Balances now stand $2.36 trillion higher than at the end of 2019, before the pandemic recession. The report is based on data from the New York Fed's nationally representative Consumer Credit Panel.

Mortgage balances rose by $282 billion in the third quarter of 2022 and stood at $11.67 trillion at the end of September, representing a $1 trillion increase from the previous year. Credit card balances also increased by $38 billion. The 15% year-over-year increase in credit card balances represents the largest in more than 20 years. Auto loan balances increased by $22 billion in the third quarter, consistent with the upward trajectory seen since 2011. Student loan balances slightly declined and now stand at $1.57 trillion. In total, non-housing balances grew by $66 billion.

Mortgage originations, which include refinances, stood at $633 billion in the third quarter, representing a $126 billion decline from the second quarter and a return to pre-pandemic volumes. The volume of newly originated auto loans was $185 billion, a slight reduction from the previous quarter but still elevated compared to the average volumes seen through the 2018-2019 period. Aggregate limits on credit card accounts increased by $82 billion and now stand at $4.3 trillion.

"Credit card, mortgage, and auto loan balances continued to increase in the third quarter of 2022 reflecting a combination of robust consumer demand and higher prices," said Donghoon Lee, Economic Research Advisor at the New York Fed. "However, new mortgage originations have slowed to pre-pandemic levels amid rising interest rates."

The share of current debt becoming delinquent increased for nearly all debt types, following two years of historically low delinquency transitions. The delinquency transition rate for credit cards and auto loans increased by about half a percentage point, similar to increases seen in the second quarter.

The New York Fed also issued an accompanying Liberty Street Economics blog post looking at trends in credit card balances and delinquencies by age and income of borrowers.

The Quarterly Report includes a summary of key takeaways and their supporting data points. Overarching trends from the report's summary include:

Housing Debt

  • There was $633 billion in newly originated mortgage debt in Q3 2022. After two years of historically high volumes of mortgage originations, the Q3 volume more closely resembles pre-pandemic volumes. 
  • Although the foreclosure moratoria have been lifted nationally, new foreclosures have stayed very low since the CARES Act moratorium was put into place. About 28,500 individuals had new foreclosure notations on their credit reports.

Student Loans

  • Outstanding student loan debt stood at $1.57 trillion in Q3 2022. The decline likely reflects some of the discharged debt due to the Closed School Discharge and Public Service Loan Forgiveness programs, offsetting the typical seasonal originations with the start of the academic year.
  • About 4% of aggregate student debt was 90+ days delinquent or in default in Q3 2022. The lower level of student debt delinquency reflects the continued repayment pause on student loans, which is scheduled to end on January 1, 2023.

Household Debt and Credit Developments as of Q3 2022


CATEGORY
QUARTERLY CHANGE * (BILLIONS $)ANNUAL CHANGE**
(BILLIONS $)
TOTAL AS OF Q3 2022 (TRILLIONS $)
MORTGAGE DEBT(+) $282(+) $997$11.67
HOME EQUITY LINE OF CREDIT (+) $3 (+) $5$0.32
STUDENT DEBT (-) $15(-) $10$1.57         
AUTO DEBT(+) $22(+) $81$1.52
CREDIT CARD DEBT(+) $38(+) $121$0.93
OTHER(+) $21(+) $68$0.49
TOTAL DEBT(+) $351(+) $1262$16.51

*Change from Q2 2022 to Q3 2022
** Change from Q3 2021 to Q3 2022

Flow into Serious Delinquency (90 days or more delinquent)


CATEGORY 1
Q3 2021Q3 2022
MORTGAGE DEBT0.27%0.50%
HOME EQUITY LINE OF CREDIT0.25%0.51%
STUDENT LOAN DEBT1.08%1.04%
AUTO LOAN DEBT1.57%2.02%
CREDIT CARD DEBT3.24%3.69%
OTHER2.84%3.55%
ALL0.70%0.94%

About the Report

The Federal Reserve Bank of New York's Household Debt and Credit Report provides unique data and insight into the credit conditions and activity of U.S. consumers. Based on data from the New York Fed's Consumer Credit Panel, a nationally representative sample drawn from anonymized Equifax credit data, the report provides a quarterly snapshot of household trends in borrowing and indebtedness, including data about mortgages, student loans, credit cards, auto loans and delinquencies. The report aims to help community groups, small businesses, state and local governments and the public to better understand, monitor, and respond to trends in borrowing and indebtedness at the household level. Sections of the report are presented as interactive graphs on the New York Fed's Household Debt and Credit Report web page and the full report is available for download.

1 Rates represent annualized shares of balances transitioning into delinquency. Flow into serious delinquency is computed as the balances that have newly become at least 90 days late in the reference quarter divided by the balances that were current of less than 90 days past due in the previous quarter.

Contact
Mariah Measey
(347) 978-3071
Mariah.Measey@ny.frb.org

亚马逊创始人亿万富翁杰夫-贝索斯

 亚马逊创始人亿万富翁杰夫-贝索斯告诉家庭不要购买新车和电视,因为美国经济面临衰退,家庭债务飙升至16.5亿美元,美国人利用信贷来维持生计,而亚马逊正在准备 "本周解雇1万名员工


在周一播出的CNN采访中,贝佐斯建议人们在这段时间放慢购买新车、电视和家电等大件商品的速度,同时应该在手头存点钱,以防最终的经济衰退。

贝佐斯说道:“我能告诉你的是,现在的经济看起来并不好。经济正在放缓。你会看到很多行业都在裁员。人们也在减缓消费。预测美国经济到2023年可能会陷入收缩。”

他补充说,他无法预测经济衰退会持续多久,但他说,如果美国还没有陷入经济衰退,那么它可能 "很快 "就会陷入衰退。

这一警告从美国最大的零售商之一的创始人口中说出,显得非同寻常,该公司依靠强劲的消费者支出来推动收入。

在通货膨胀的打击下,消费者已经捉襟见肘,越来越多地使用信贷额度,本周的新数据显示,上季度家庭债务激增至16.51万亿美元,以2008年以来最快的速度增长。

尽管上个月年度通货膨胀率下降到7.7%,是1月以来的最低水平,但许多经济学家认为,以大量失业为标志的急剧衰退可能在明年不可避免。

裁员对那些为了应付杂货、汽油和公用事业价格上涨而耗尽积蓄的家庭来说可能尤其艰难。

商务部的数据显示,在大流行病封锁期间,由于人们被困在家里,个人储蓄余额激增,现在已经暴跌到大流行病之前达到的水平的一半左右。

同样,9月份个人储蓄率降至3.1%,远低于2019年大流行前8.8%的平均值。

这是自贝佐斯上个月发推表示“是时候踩刹车”之后,第二次对经济衰退发出警告。

最近,随着新一轮裁员和削减成本措施在过去几周生效,许多高管都警告称,未来经济将面临艰难时期。《纽约时报》周一报道称,亚马逊计划本周在其技术和企业部门裁员约1万名员工,预计这将是该公司历史上规模最大的一次裁员。

贝佐斯说,很难预测经济低迷何时结束,所以“你必须试着理性地看待它,尽可能地为自己减少风险。抱最好的希望,做最坏的打算”。

Amazon layoff | Sai Chiligireddy

 

Sai Chiligireddy
Today, we had to let go some of the most hardworking and talented individuals, that I have ever worked with, from our team. I haven't fully processed my thoughts as I write this message, but some of them are on work visas and need help before running out of grace period.

If you are looking for great software engineers in US or Canada, please let me know and I can put you in touch with our team members.

#amazon #layoff #help #canada #software #engineers