Sunday, 16 November 2025

PHP Composer 'Certificate Verify Failed' Alternate Solution | Windows 10

 


Commands (for activating virtualization) :

1.

dism.exe /online /enable-feature /featurename:Microsoft-Hyper-V-All /all /norestart


2.

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart


3.

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart


4.

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart


5.

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart



Commands (for installing PHP and composer) :

1.

sudo apt update


2.

sudo apt install apache2 php libapache2-mod-php

3.

sudo service apache2 start

4.

sudo apt install composer


========================



The Composer installer script was not successful [exit code 1].


OpenSSL failed with a 'certificate verify failed' error. This indicates a problem with the Certificate Authority file(s) on your system, which either cannot be found or may be out of date.


Script Output: The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:XXX:SSL routines:tls_process_server_certificate:certificate verify failed Failed to enable crypto failed to open stream: operation failed



========================


When I try to install composer for PHP on windows 10 in different machines, Sometimes I face errors like this. So I was wondering if there is any alternate solution to this where I do not have to switch the whole operating system and be able to download the vendor folder using composer. I found that there is a way to do it in Windows 10. It's called WSL aka windows subsystem for Linux. For all of you experienced people out there already figured out what will be next. So this tutorial is for beginners. With WSL, you can access linux files from windows. So what we do is to install php & composer in linux, download the required vendor folder and copy it in windows.

So before installing WSL, make sure that your virtualization is on. You can check it by opening the task manager, opening the performance tab and looking for virtualization. It has to be enabled, if not, go to your BIOS setting and enable it. For different motherboards & processors, you will find it on different menus. Once you enable it, open the task manager again and check it. Once it is enabled, go to the Microsoft store, download Ubuntu 24.04. After executing Ubuntu, if you see an error, then open powershell in the Administrator. Run following commands. I mentioned them at the beginning of post.

After that, it should not show any error and ask you to give your username and password. I am using Ubuntu as my username and password. You can choose your own.

Better to update the OS.

Now, it is time to install PHP, apache2 and composer. 

Make sure to install your required version of PHP before installing composer.

We shall go to the root folder by using cd .. command.

Lets go to the var/www/html folder in the linux terminal.

If you open windows explorer, you can open linux files by typing \\wsl$ in explorer’s path textbox.

You can also find linux at tree explorer at the bottom.

Open linux terminal, and make sure to make chmod 777 to html folder. With that, creating/editing/deleting files inside that folder will be very easy.

Let’s create a single folder to check if it works.

Let’s download the vendor folder using the composer command.

Once downloaded, you can copy-paste vendor folders in your PHP projects which are present in windows machines like xampp/wamp etc.

Thanks for watching.


Sunday, 18 May 2025

Establish Socket Connection Between AWS [EC2 UBUNTU] And Computer

  


AWS EC2 Ubuntu Setup :-

https://www.youtube.com/watch?v=uWFKq4KuRb0

Download PuTTY and FileZilla

https://www.putty.org/

https://filezilla-project.org/


Subscribe my Channel:-

http://www.youtube.com/user/SanketRooney?sub_confirmation=1

Gaming Channel:-

https://www.youtube.com/@unpoggaming9532

Gaming Instagram:- (@unpog.gaming)

https://www.instagram.com/unpog.gaming/

Facebook Page:-

https://www.facebook.com/UnpossibleNS

Twitter Account:-

https://twitter.com/UnpossiblePOG

Blog:-

https://unpossiblepog.blogspot.com/

Website:-

https://unpossiblepog.com/

========================

Code :

Server.java

import java.io.*;

import java.net.*;

public class Server {

public static void main(String[] args) {

int port = 5000;

try (ServerSocket serverSocket = new ServerSocket(port)) {

System.out.println("Server started. Waiting for client...");

Socket socket = serverSocket.accept();

System.out.println("Client connected: " + socket.getInetAddress());

// Input from client

BufferedReader clientInput = new BufferedReader(new InputStreamReader(socket.getInputStream()));

// Output to client

PrintWriter clientOutput = new PrintWriter(socket.getOutputStream(), true);

// Input from server console

BufferedReader serverConsole = new BufferedReader(new InputStreamReader(System.in));

// Create a thread to receive messages from the client

Thread receiveThread = new Thread(() -> {

String messageFromClient;

try {

while ((messageFromClient = clientInput.readLine()) != null) {

System.out.println("Client: " + messageFromClient);

}

} catch (IOException e) {

System.out.println("Connection closed.");

}

});

receiveThread.start();

// Main thread: send messages from server to client

String messageToClient;

while ((messageToClient = serverConsole.readLine()) != null) {

clientOutput.println(messageToClient);

}

} catch (IOException e) {

e.printStackTrace();

}

}

}

-------------------------------------------

Client.java

import java.io.*;

import java.net.*;

public class Client {

public static void main(String[] args) {

String host = "_________"; // Replace with your EC2 IP

int port = 5000;

try (Socket socket = new Socket(host, port)) {

System.out.println("Connected to server.");

// Input from server

BufferedReader serverInput = new BufferedReader(new InputStreamReader(socket.getInputStream()));

// Output to server

PrintWriter serverOutput = new PrintWriter(socket.getOutputStream(), true);

// Input from client console

BufferedReader clientConsole = new BufferedReader(new InputStreamReader(System.in));

// Thread to receive messages from server

Thread receiveThread = new Thread(() -> {

String messageFromServer;

try {

while ((messageFromServer = serverInput.readLine()) != null) {

System.out.println("Server: " + messageFromServer);

}

} catch (IOException e) {

System.out.println("Connection closed.");

}

});

receiveThread.start();

// Main thread: send messages from client to server

String messageToServer;

while ((messageToServer = clientConsole.readLine()) != null) {

serverOutput.println(messageToServer);

}

} catch (IOException e) {

e.printStackTrace();

}

}

}

========================

I was wondering if we could communicate between AWS operating system and PC using command prompt. Found out that this is possible. All we need to do is little bit of setup. The main advantage of using sockets is that once the connection is established, showing the message sent from server to client or vice-versa will not require any triggers like auto-refresh or button click etc. Sockets will handle the rest. Once sockets receives message, we can make program do all sorts of things like like creating new files, deleting files, showing files list etc. Any ways, our task is to establish connection using java sockets and that’s what we are going to do in this video.

In setup, our server will be AWS cloud server more specifically Elastic Compute Cloud, in short EC2. I installed ubuntu operating system in it. Remember that EC2 does not provide user interface to interact with files inside OS, so we shall use commands instead. Here, we shall not do a server setup from scratch. The server setup tutorial links are given in the description.

For client device, we are going to use windows machine which has Java already installed it, so make sure that you have that as well.

First, we shall need a PPK file. With that file, we can connect AWS server’s file system via FILEZILLA and also to run commands using PuTTY terminal. So, make sure that you installed them on you computer as well.

Let’s create KEY PAIR to download ppk file. Follow my steps.

[

From your AWS dashboard, click on EC2 -> Instances -> Key Pairs -> Create key pair

]

Make sure that pair type is RSA and file format is .ppk. Give any random name.

Once created, file will be downloaded automatically.

I already created key pair, so I am going to use that.

Next part is to enable port number 5000.

To create it, follow my steps.

[

Go to your EC2 Console

Select your instance → Networking → Security Groups

Click Inbound rules → Edit

Add a rule:

Type: Custom TCP

Port: 5000 (or any port you use)

Source: Your IP (or 0.0.0.0/0 for testing, but this is insecure)

]

Since I am not sure which group allows access, I am gonna create it in both.

Let’s connect ubuntu server using command prompt. To do that, open PuTTY.

Add IP Address, put 22 as a port number.

Select SSH radio button.

From the left side category, inside connection, go to select SSH, Auth, Credentials.

Select PPK file.

And click on open.

[How to know if ubuntu]

First we shall install Java.

sudo apt install openjdk-17-jdk.

To connect via FTP, use same credentials that we used for connecting server via putty.

Reach to var/www/ and create a folder where we are going to upload java file.

Let’s upload Server.java file. Code link is in the description.

Let’s go inside java-code folder.

Because the folder does not have permission, java file is no uploading. So reach to parent folder via putty terminal give edit permission to java-code folder.

Now, our server is ready.

I created a Client.java file. Code link is in the description.

Set AWS’s public IP as a value of String host variable.

In command prompt of client which is a windows system, we shall reach to a location where Client.java file is present.

Lets run client script.

And as you can see, whatever we type in command prompt from client reaches to server and vice-versa.


Wednesday, 22 January 2025

How To Register | create360degree.com


 

Open the browser and type in the URL, create 3 60 degree dot com.

Registered user can store his own 360 permanently. Also, 3 slots are given for free. For

 more information, click on option appeared at the top right corner.
Click on Register.

There are two methods to create an account.
One is by filling the registration form.
Email will be used as a username for login in future, so make sure to add a valid email address.
Once verified, you will receive an email. And in that email, there will be a link. By clicking on it, you will be able to login.
Second way is to login using a google account. We only store your email address, because the email is from google, it will be automatically verified, plus no need to add password every time you have to login.

Just click on Register With Google, you will be asked to login or choose gmail address. Once logged in, you will be redirected to your dashboard.