Skip to content

Commit fadcff8

Browse files
committed
docs: update README.md
1 parent 7a186de commit fadcff8

File tree

1 file changed

+57
-47
lines changed

1 file changed

+57
-47
lines changed

README.md

Lines changed: 57 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,81 @@
1-
## PHP Version Management Made Fun: Conquering PHP with PHPV on Arch Linux (and Avoiding Hilarious Developer Mishaps)
1+
## PHP Version Management Using PHPV on Arch Linux
22

33
### Introduction
44

5-
Greetings, fellow coders! Struggling to manage PHP versions on your Arch Linux system (like Manjaro, EndeavourOS, Garuda Linux, and ArcoLinux)? Wish switching PHP versions wasn't a labyrinthine adventure? Fear not, for PHPV has arrived to simplify your PHP life, with a touch of programmer humor on the side.
5+
Managing PHP versions on Arch Linux systems (including Manjaro, EndeavourOS, Garuda Linux, and ArcoLinux) can be challenging. This comprehensive tutorial introduces PHPV, a tool designed to simplify the process of installing, updating, and switching PHP versions efficiently. Follow these steps to streamline your PHP version management on Arch Linux.
66

77
### Installation Guide
88

99
#### Downloading PHPV
1010

11-
Embrace the command line for a quick and efficient installation:
11+
For a quick and efficient installation, use the following command:
1212

1313
```bash
1414
curl -sSL https://raw.githubusercontent.com/Its-Satyajit/phpv/main/install.sh | bash
1515
```
1616

17+
**Tip:** Ensure you have `curl` installed on your system. If not, install it using `sudo pacman -S curl`.
18+
1719
#### Manual Installation (Optional)
1820

19-
For the adventurous, here's the manual route:
21+
Follow these steps for manual installation:
2022

2123
1. **Clone the Repository:**
2224

2325
```bash
2426
git clone https://github.com/Its-Satyajit/phpv.git
2527
```
2628

29+
**Suggestion:** Verify that `git` is installed. If not, install it with `sudo pacman -S git`.
30+
2731
2. **Navigate and Grant Permissions:**
2832

2933
```bash
3034
cd phpv
3135
chmod +x phpv
3236
```
3337

38+
**Tip:** Always check the permissions of the script before executing it to ensure it’s safe to run.
39+
3440
3. **Install PHPV:**
3541

3642
```bash
3743
mv phpv $HOME/bin/phpv
3844
```
3945

46+
**Suggestion:** If `$HOME/bin` does not exist, create it using `mkdir -p $HOME/bin`.
47+
4048
4. **Update Shell Configuration:**
4149

42-
Add this line to your shell configuration file (e.g., ~/.bashrc, ~/.bash_profile):
50+
Add the following line to your shell configuration file (e.g., ~/.bashrc, ~/.bash_profile):
4351

4452
```bash
4553
export PATH="$HOME/bin:$PATH"
4654
```
4755

56+
**Tip:** Use a text editor like `nano` or `vim` to edit your shell configuration file. For example, `nano ~/.bashrc`.
57+
4858
5. **Refresh Terminal:**
4959

5060
```bash
5161
source ~/.bashrc # Replace with your appropriate shell command
5262
```
5363

54-
### Uses
64+
**Suggestion:** If you use a different shell, update the corresponding configuration file (e.g., `~/.zshrc` for Zsh).
5565

56-
#### Installing/Updating/Reinstall PHP Versions
66+
### Usage
5767

58-
Need the latest PHP version or just a change of pace? PHPV can help:
68+
#### Installing/Updating/Reinstalling PHP Versions
69+
70+
To install, update, or reinstall PHP versions, use the following command:
5971

6072
```bash
6173
phpv -i <version>
6274
```
6375

64-
Replace `<version>` with the desired shorthand (e.g., 80 for 8.0, 74 for 7.4). Remember, with great PHP power comes the responsibility to write clean, bug-free code.
76+
Replace `<version>` with the desired shorthand (e.g., 80 for 8.0, 74 for 7.4).
77+
78+
**Tip:** Always check for the latest PHP versions and their shorthand notations to keep your environment up to date.
6579

6680
**Install**
6781

@@ -73,111 +87,107 @@ Replace `<version>` with the desired shorthand (e.g., 80 for 8.0, 74 for 7.4). R
7387

7488
#### Switching PHP Versions
7589

76-
Switching versions is a breeze:
90+
To switch PHP versions, use the following command:
7791

7892
```bash
7993
phpv <version>
8094
```
8195

82-
Pick your weapon (version shorthand), and PHPV handles the rest. Debugging should be an adventure, not a nightmare.
96+
Replace `<version>` with the desired shorthand.
97+
98+
**Suggestion:** After switching versions, verify the PHP version with `php -v` to ensure the correct version is active.
8399

84100
**Switch**
85101

86102
![](assets/20240716_210340_switch_10.png)
87103

88104
### Troubleshooting
89105

90-
**Having trouble with the c-client dependency? This section outlines the manual installation steps. If you're new to compiling, consider the pre-built binary or seeking help online.**
106+
If you encounter issues with the c-client dependency, follow the steps outlined below for manual installation.
91107

92108
#### Pre-built Binary for Easy Resolution
93109

94-
Why waste time compiling? Download the pre-built c-client binary directly from PHPV:
95-
96-
- [c-client-2007f-20-x86_64.pkg.tar.zst](https://github.com/Its-Satyajit/phpv/blob/main/c-client/c-client-2007f-20-x86_64.pkg.tar.zsthttps:/)
110+
Download the pre-built c-client binary from PHPV:
97111

98-
This is the recommended approach for most users, saving you time and compilation headaches.
112+
- [c-client-2007f-20-x86_64.pkg.tar.zst](https://github.com/Its-Satyajit/phpv/blob/main/c-client/c-client-2007f-20-x86_64.pkg.tar.zst)
99113

100114
**Verification (Optional):**
101115

102-
Downloaded the binary but have doubts? Verify its integrity using these hash values:
116+
Verify the binary's integrity using the following hash values:
103117
104118
- MD5: 96d92a8b98afd78d2f2c80f8b0d76473
105119
- SHA1: 4451582984bf02b1b78425b75100ca20018c8557
106120
- SHA256: c6c9a0a411f476be1357f5aad8db897ce4d47f3f78757acd2aade3e477e2fe4d
107121
- SHA512: 9628031b0f0efe4024c515f0a882418d7665b3267644f3bf0f12adbc5f200a9cca3049ab218be176ae8562673edca46190ca44de1154a32e0bf828028470ef1e
108122
109-
For additional peace of mind, use VirusTotal for verification.
123+
For additional verification, use VirusTotal.
110124
111125
#### Manual Compilation (Advanced Users Only)
112126
113-
**Disclaimer:** Manual compilation can introduce conflicts with existing system packages. It's generally recommended using the pre-built binary or your system's package manager (e.g., pacman) for a safer and more reliable installation. If you're comfortable with the risks and possess advanced Linux knowledge, proceed with caution. Consider consulting online resources or the Arch Linux forums for help if needed.
127+
**Disclaimer:** Manual compilation can introduce conflicts with existing system packages. It is recommended to use the pre-built binary or your system's package manager (e.g., pacman) for a safer installation.
114128

115-
**For Users Comfortable with Manual Compilation**
116-
117-
Here's a step-by-step guide for those who prefer manual compilation:
129+
**Manual Compilation Steps:**
118130

119131
1. **Gather Your Tools:**
120132

121-
Ensure you have the necessary development tools installed on your Arch Linux system. You'll typically need:
133+
Ensure you have the necessary development tools installed:
134+
135+
- `make`
136+
- A C compiler (e.g., `gcc`)
137+
- Development headers for system libraries (`pacman -S base-devel`)
122138

123-
- `make`: A tool for automating compilation tasks.
124-
- A C compiler: Most commonly `gcc` is used for compiling C code.
125-
- Development headers for system libraries: These provide header files needed for compilation. These are usually installed with the `pacman -S base-devel` command.
139+
**Suggestion:** Use `sudo pacman -S base-devel` to install essential development tools.
126140

127141
2. **Download the Source Code:**
128142

129-
Access the official c-client source code repository: [https://gitweb.gentoo.org/repo/gentoo.git/tree/](https://gitweb.gentoo.org/repo/gentoo.git/tree/) (May the source be with you!)
143+
Access the official c-client source code repository: [https://gitweb.gentoo.org/repo/gentoo.git/tree/](https://gitweb.gentoo.org/repo/gentoo.git/tree/)
144+
145+
**Tip:** Always download the latest stable version to ensure compatibility and security.
130146

131147
3. **Unpack the Source:**
132148

133-
Extract the downloaded source code archive using `tar`:
149+
Extract the source code archive:
134150

135151
```bash
136152
tar -zxvf c-client-X.Y.Z.tar.gz
137153
```
138154

139-
Replace `X.Y.Z` with the specific version number you require. Pro-tip: Check online for the latest stable version to avoid potentially buggy surprises.
155+
Replace `X.Y.Z` with the specific version number.
156+
157+
**Suggestion:** Use the `ls` command to verify the contents of the extracted directory.
140158

141-
4. **Configure and Build (with Caution):**
159+
4. **Configure and Build:**
142160

143161
Navigate into the extracted directory:
144162

145163
```bash
146164
cd c-client-X.Y.Z
147165
```
148166

149-
Now for the "magic incantation" (compilation flags) to potentially resolve the implicit declaration of function 'safe_flock' error:
167+
Configure and build with specific flags:
150168

151169
```bash
152170
CFLAGS="-Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types" ./configure
153171
```
154172

155-
This tells the compiler to ignore specific warnings. However, suppressing warnings can mask underlying issues. Proceed with caution and consider investigating the cause of these warnings if possible. Think of warnings like Yoda: sometimes cryptic, but their wisdom shouldn't be ignored!
173+
**Warning:** Suppressing warnings can mask underlying issues. It is recommended to investigate the cause of these warnings and fix them if possible.
156174

157-
**Alternative Compilation Flags:**
158-
159-
While these flags might seem like a compiler shortcut, remember that suppressing warnings is generally not recommended. It's better to fix the root cause to ensure your code is solid.
175+
**Tip:** Use `./configure --help` to see all available configuration options.
160176

161177
5. **Dependency Management:**
162178

163-
Before you embark on this compilation adventure, ensure you have all the necessary dependencies installed. Use `pacman` to check for missing packages. It's like checking your backpack before a coding quest – you don't want to realize you're missing essential libraries halfway through!
164-
165-
Try compiling with default flags in PKGBUILT first. The error you're facing might have been fixed since this guide was written. No need to reinvent the wheel (unless you're feeling particularly creative, like writing your own operating system from scratch).
179+
Ensure all necessary dependencies are installed. Use `pacman` to check for missing packages.
166180

167-
If you encounter errors, use the flags mentioned above. Remember, Stack Overflow is always a helpful companion on your compilation journey. Think of it as the online forum where you can find the wisdom of the coding collective.
181+
**Suggestion:** Before starting the compilation, use `sudo pacman -Syu` to update your system and installed packages.
168182

169-
6. **Installation (with a Touch of Caution):**
183+
6. **Installation:**
170184

171-
Important: Manual installation can potentially conflict with existing system packages. It's generally recommended to use the pre-built binary or your package manager for safe and reliable installation.
172-
173-
If you choose to proceed, use `sudo make install` with caution:
185+
If you choose to proceed with manual installation, use `sudo make install`:
174186

175187
```bash
176188
sudo make install
177189
```
178190

179-
This installs the compiled c-client library into your system's default library directory. Remember, with great compilation power comes great responsibility!
180-
181-
7. **Remember:** Manual compilation can be a complex process. If you encounter difficulties, consider consulting online resources or seeking help from the Arch Linux community forums. They're like the Jedi Council of the Linux world, always willing to guide you through the compilation labyrinth.
191+
**Tip:** Always review the `Makefile` before running `make install` to understand the installation process.
182192

183-
By following these steps and understanding the potential risks, you can manually compile the c-client library for PHPV. However, for most users, the pre-built binary or using the system's package manager is the safer and more recommended approach.
193+
By following these steps, you can manually compile the c-client library for PHPV. However, for most users, the pre-built binary or using the system's package manager is the recommended approach.

0 commit comments

Comments
 (0)