PHP 8.2 also includes bug fixes and performance improvements over previous versions like 8.1. We recommend you test your codebase with PHP 8.2 before upgrading in a production setup, just to ensure that everything works as expected.
In this article we shall cover steps that are used in the installation of PHP 8.2 on Ubuntu 22.04|20.04|18.04. The default version of PHP available on OS repositories is usually older than PHP official latest releases. PPA (Personal Package Archive) software repositories for PHP allows you to install newer releases of PHP on your Ubuntu system that are not available in the official repositories of a Linux distribution.
You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal.
{
"errors": [
{
"message": "You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve",
"code": 453
}
]
}
Here’s a sample PHP script that uses the Twitter API OAuth authentication process to get the current trending topics:
<?php
// Replace with your own values
$consumer_key = 'xxxxxx';
$consumer_secret = 'xxxxxx';
// Set up the URL for the OAuth request
$url = "https://api.twitter.com/oauth2/token";
// Set up the headers for the OAuth request
$headers = array(
"Content-Type: application/x-www-form-urlencoded;charset=UTF-8",
"Authorization: Basic " . base64_encode($consumer_key . ":" . $consumer_secret)
);
// Set up the data for the OAuth request
$data = "grant_type=client_credentials";
// Initialize a cURL session
$curl = curl_init();
// Set the cURL options
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Send the OAuth request and get the response
$response = curl_exec($curl);
// Close the cURL session
curl_close($curl);
// Decode the JSON response
$json = json_decode($response);
// Get the access token from the response
$access_token = $json->access_token;
// Set up the URL for the Trends API request
$url = "https://api.twitter.com/1.1/trends/place.json?id=1";
// Set up the headers for the Trends API request
$headers = array(
"Authorization: Bearer " . $access_token
);
// Initialize a new cURL session
$curl = curl_init();
// Set the cURL options
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Send the Trends API request and get the response
$response = curl_exec($curl);
var_dump($response);
// Close the cURL session
curl_close($curl);
// Decode the JSON response
$json = json_decode($response);
// Print out the top 10 trending topics in the United States
for ($i = 0; $i < 10; $i++) {
echo ($i+1) . ". " . $json[0]->trends[$i]->name . "\n";
}
?>
Make sure to replace YOUR_CONSUMER_KEYand YOUR_CONSUMER_SECRET with your own Twitter API credentials.
This script first makes an OAuth 2.0 request to obtain an access token, then uses that access token to make a request to the Trends API and print out the top 10 trending topics in the United States. You can modify the id parameter in the Trends API URL to get trending topics for a different location.
The first thing to do in a new system is to update our repositories in order to make them up to date. Run upgrade command also.
sudo apt update && apt upgrade -y
2. Add Ondrej sury PPA repository
To run PHP 8.2 on Ubuntu 22.04, we need to add Ondrej sury PPA into our system. This is the maintainer of the PHP repository at the moment. This PPA is not currently checked so installing from it will not be guaranteed 100% results.
To add this PPA use the following command on our terminal.
sudo add-apt-repository ppa:ondrej/php
After installation is complete we need to update the repositories again for the changes to take effect.
sudo apt update
3. Install PHP 8.2 on Ubuntu 22.04
We should now be able to install PHP 8.2 on Ubuntu 22.04 Linux machine. The commands to run are as shared below:
sudo apt install php8.2 -y
Check for the currently active version of PHP with the following command:
php --version
4. Install PHP 8.2 Extensions
Besides PHP itself, you will likely want to install some additional PHP modules. You can use this command to install additional modules, replacing PACKAGE_NAME with the package you wish to install:
sudo apt-get install php8.2-PACKAGE_NAME
You can also install more than one package at a time. Here are a few suggestions of the most common modules you will most likely want to install:
DNS propagation is the time DNS changes take to be updated across the internet on the globe. It can take up to 72 hours to propagate worldwide. You can check your DNS propagation results from here.
What is DNS resolution?
DNS resolution translates the domain name into the site’s IP address. You need a site’s IP address to know where it’s on the internet. A website could have IPv4 or IPv6 addresses or both. Where the IPv4 address comes in the form of an A record and the IPv6 address comes in an AAAA record.
How do DNS records propagate?
When you update your DNS records, it may take up to 72 hours for the changes to take effect. During this period, the ISPs worldwide update their DNS cache with new DNS information for your domain.
However, due to different DNS cache level, after DNS records changes, some of the visitors might be redirected to the old DNS server, for some time, and other can see the website from new DNS server, shortly after the changes. You can perform the A, AAAA, CNAME, and additional DNS records lookup.
Why DNS propagation takes time?
Suppose you changed your domain’s nameservers, and you requested to open your domain on the web browser. Your request will not go to the hosting directly.
Each of the ISP nodes first checks its DNS cache, whether it has the DNS information for that domain. If it is not there, it will look it up to save it for future use to speed up the DNA lookup process.
Thus, the new nameservers will not propagate instantly – ISPs have different cache refreshing levels, so some will still have the old DNS information in their cache.
But if after that time interval, still, your new DNS changes are not reflecting, then you go for a DNS health check to ensure that your DNS changes are up to the mark and are following the standards.
How does the DNS process work?
Suppose you request to open the URL https://abc.com in your web browser’s bar.
The web browser first checks in its local cache whether it has the requested domain’s IP address. If it’s not present, then it will send the request to the Name Resolving Server.
The Name Resolving Server checks its cache against that request. If it fails to find the requested domain’s IP address, it will send that request to the Root Server.
The Root Server only contains the server’s IP address with TLD (Top Level Domain) related information. It will redirect the Name Resolving Server to the TLD server containing .com information.
The TLD server provides the server’s IP address (authoritative servers for requested URL https://abc.com) to the Name Resolving Server.
The Name Resolving Server caches that information for a specific period (TTL) and passes that information to the requested’s computer.
The client’s computer builds the connection with the authoritative server (containing the requested URL https://abc.com) for the requested content and caches the IP address’s information in its browser for further use.
Why is DNS not propagating?
The ISPs across the world have a different caching level. The DNS client or the server may cache the information the DNS records in its DNS cache. That information is temporarily cached, and DNS servers will go for the updated DNS information when TTL (Time to Live) expires.
What will happen if the domain name does not exist?
The DNS server will return a name error, also known as an NXDomain response (for non-existent domain), to symbolize that the query’s domain name does not exist.
What is the port used by DNS?
DNS uses both TCP and UDP port 53. However, the most frequently used port for DNS is UDP 53. That is used when the client’s computer communicates with the DNS server for resolving the specific domain name. Be sure, when using the UDP 53 for DNS, the maximum size of the query packet is 512 bytes.
TCP 53 is used primarily for Zone Transfers and when the query packet exceeds 512 bytes. That is true when DNSSEC is used, which adds extra overhead to the DNS query packet.
What is DNS failure?
DNS failure means that the DNS server cannot convert the domain name into an IP address in a TCP/IP network. That failure may occur within the company’s private network or the internet.
It is necessary to make a backup of the database before reinstalling the server or just in case something unexpected happens. We can actually do backups through Phpmyadmin by exporting all databases. But what if we haven’t installed Phpmyadmin on the Server?
How to Backup All Databases
1. Backup Schema and Data
mysqldump -u username -p --all-databases > backup.sql
or
mysqldump -u username -p -A > backup.sql
2. Backup only the Schemas
mysqldump -u username -p --all-databases --no-data > backup_schema.sql
or
mysqldump -u username -p -A -d > backup_schema.sql
3. Backup by Remote Server
mysqldump -u root -h 128.168.1.1 -p -A > backup.sql
2. Get PostgreSQL 14 installed on your Ubuntu system
sudo apt install postgresql-14
3. PostgreSQL’s default port (5432) should not be held hostage by any other system process.
sudo ss -atnp | grep 5432
4. Next, restart, enable PostgreSQL so that it keeps running even after your Ubuntu system reboots, and check on the status of PostgreSQL to make sure it is running.
I already tried the ways to fix this by restart the Pageant, remove the key, re add the key, redownload the key, restart my PC and still this issue come up! After one centuries, I found the solution of this issue.
If you experienced this exhibit: PuTTY Fatal Error; when accessing the server. You may try to download the the latest PuTTY itself and update your PuTTY in this URL: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html then your problem will be fixed.
This article helps me to fix git push to gitlab. It’s been a long time i didn’t to commit to gitlab 😀
remote: The project you were looking for could not be found or you don't have permission to view it. fatal: repository 'https://gitlab.com/josuamarcelc/myproject.git/' not found
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.