# PHP Version Change Guide for Afaq

## Downgrade from PHP 7.4 to PHP 5.6

To successfully downgrade your PHP version, follow these steps:

1. **Navigate to Directory:**
   - Go to: `vendor\filp\whoops\src`

2. **Rename the Folders:**
   - Change the folder name `Whoops` to `Whoops_php74`.
   - Change the folder name `Whoops_php56` to `Whoops`.

3. **Modify Code:**
   - Open the file: `vendor\laravel\framework\src\Illuminate\Exception\WhoopsDisplayer.php`.
   - On line `43`, change the following code:
     ```php
     public function display($exception)
     ```
     to:
     ```php
     public function display(Exception $exception)
     ```

## Upgrade from PHP 5.6 to PHP 7.4

To upgrade back to PHP 7.4, follow these steps:

1. **Navigate to Directory:**
   - Go to: `vendor\filp\whoops\src`

2. **Rename the Folders:**
   - Change the folder name `Whoops` to `Whoops_php56`.
   - Change the folder name `Whoops_php74` to `Whoops`.

3. **Modify Code:**
   - Open the file: `vendor\laravel\framework\src\Illuminate\Exception\WhoopsDisplayer.php`.
   - On line `43`, change the following code:
     ```php
     public function display(Exception $exception)
     ```
     to:
     ```php
     public function display($exception)
     ```

> **Note:** These folder naming conventions help in tracking the appropriate Whoops version for each PHP environment.

---

## Installing YAZ via WHM PECL (PHP 7.4 Only)

Follow these steps to install YAZ:

1. **Change Default PHP Version in cPanel to 7.4**
   - Go to your cPanel settings and set the default PHP version to 7.4.

2. **Install Go-Pear:**
   - Run the following commands in your terminal:
     ```bash
     wget http://pear.php.net/go-pear.phar
     php go-pear.phar
     ```

3. **Install YAZ Dependency:**
   - Run this command to install the YAZ library:
     ```bash
     apt-get install libyaz-dev
     ```

4. **Install YAZ via WHM:**
   - In WHM, go to: `Module Installers` > `PHP PECL`.
   - Search for "YAZ" and install it.

--- 
