Upgrading PHP 7.* to PHP 8.0 in Ubuntu Nginx | Programming

If Upgrading, start from here:

sudo apt-get purge php7.* -y
sudo apt-get autoclean
sudo apt-get autoremove -y

If Installing directly to PHP8.0, start from here:

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

sudo apt install php8.0-common php8.0-mysql php8.0-xml php8.0-curl php8.0-gd php8.0-imagick php8.0-cli php8.0-dev php8.0-imap php8.0-mbstring php8.0-opcache php8.0-soap php8.0-zip php8.0-fpm php8.0-snmp php-memcached -y

sudo php-fpm8.0 -t 
sudo service php8.0-fpm restart
sudo service nginx restart


php -v

Edit FPM Servers

sudo nano /etc/php/8.0/fpm/pool.d/www.conf

https://josuamarcelc.medium.com/try-to-optimizing-php-fpm7-3-configuration-with-nginx-78268eb90261

Edit FPM Pools at

sudo nano /etc/php/8.0/fpm/php.ini
upload_max_filesize = 32M 
post_max_size = 48M 
memory_limit = -1 
max_execution_time = 600 
max_input_vars = 3000 
max_input_time = 1000

Edit your configuration.

sudo nano /etc/nginx/sites-available/your.conf

The line you need to modify will look like this.

fastcgi_pass unix:/run/php/php7.4-fpm.sock; 

You need to replace the old PHP version with the new version.

fastcgi_pass unix:/run/php/php8.0-fpm.sock; 

Check PHP version.

php -v

Github personal access token on VSCODE

This is the easiest way to connect your VSCODE with github.

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/XXX/XXX.git/': The requested URL returned error: 403

Reference: Creating Personal Access Token

Use Github Personal Access Token on VSCode or any servers | Github Update on August 13, 2021

When you clone the repository

git clone https://<TOKEN>@github.com/<username>/<repository_name>.git

Example

git clone https://ghp_vUVlKgZShi37sFxHjB5jh3SyKxXmEC91uReFh@github.com/siakew/personal-access-token.git

Or for existing repository

git remote set-url origin https://<TOKEN>@github.com/<username>/<repository_name>.git

Example

git remote set-url origin https://ghp_vUVlKgZShi37sFxHjB5jh3SyKXmExC91uReFh@github.com/siakew/personal-access-token.git

Fastest Add Youtube Button In Your Website

You can find your channel ID in https://www.youtube.com/account_advanced

Try it in preview in this link

Example

<script src="https://apis.google.com/js/platform.js"></script>

<div class="g-ytsubscribe" data-channelid="UC45pL-SL4KZwH9jB_VoAgXA" data-layout="full" data-theme="dark" data-count="default"></div>

Preview


Microservices Architecture at NetFlix

Check out the Microservices Architecture at Netflix!

Microservices Architecture

1. Client sends a Play request to Backend running on AWS. The request is handled by AWS Load balancer (ELB)

2. AWS ELB will forward that request to API Gateway Service running on AWS EC2 instances. That component, named Zuul, is built by the Netflix team to allow dynamic routing, traffic monitoring & security, etc

3. Application API component is the core business logic, in this scenario, the forwarded request from API Gateway Service is handled by Play API.

4. Play API will call a microservice or a sequence of microservices to fulfill the request.

5. Microservices are mostly stateless small programs, to control its cascading failure & enable resilience, each microservice is isolated from the caller processes by Hystrix.

6. Microservices can save to or get data from a data store during its process.

7. Microservices can send events for tracking user activities or other data to the Stream Processing Pipeline for either real-time processing of personalized recommendation.

8. The data coming out of the Stream Processing Pipeline can be persistent to other data stores such as AWS S3, Hadoop HDFS, Cassandra, etc.

credit to: https://www.linkedin.com/in/stevenouri/

Exit mobile version