> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oculusproxies.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Set Up Oculus Proxies With Guzzle (PHP)

> Guzzle and Oculus Proxies ensure anonymous, unblocked PHP HTTP requests, easily bypassing IP bans and geo-restrictions.

<img src="https://mintcdn.com/oculus/1d67TBF2G4SVZ2ie/integration-guides/img/oculus_integrations/Guzzle.png?fit=max&auto=format&n=1d67TBF2G4SVZ2ie&q=85&s=44b29cb60751772a333a5a7af0cd101a" alt="title" width="720" height="200" data-path="integration-guides/img/oculus_integrations/Guzzle.png" />

## What is Guzzle?

**Guzzle** is a PHP HTTP client library designed to make sending HTTP requests effortless. It handles everything from simple GET calls to complex request workflows.
Instead of sending requests directly to the target server, your script routes them through our Oculus Proxies. When combined, this setup helps you:

* **Bypass IP bans** and manage request rate limits.
* **Hide your original IP address** for anonymity.
* **Access geo-restricted content** for tasks like web scraping.

<Tip>
  If you're using **Oculus** to access search engines like **Google, Bing, or Yandex** and facing connection issues, the proxy type could be the reason. **ISP Premium Proxies** ensure stable and unrestricted access, preventing blocks that standard proxies might encounter. Switching to **ISP Premium Proxies** can help maintain smooth and reliable performance.
</Tip>

## Setting Up Guzzle in Your PHP Project

<Steps>
  <Step title="Install PHP and Composer">
    Before starting, ensure you have [PHP](https://www.php.net/downloads.php) installed on your system. You will also need **Composer**, the package manager for PHP, which can be easily downloaded and installed. Make sure the `php.exe` (or equivalent) is correctly added to your system's PATH.
  </Step>

  <Step title="Initialize the Project and Install Guzzle">
    * Open your IDE and create a terminal in your project directory.
    * Run the following command to initialize your Composer project:

    ```bash theme={null}
    composer init
    ```

    Follow the prompts, or skip them if you're just testing.

    * Install Guzzle by running:

    ```bash theme={null}
    composer require guzzlehttp/guzzle
    ```

    This command installs Guzzle and updates your `composer.json` file.
  </Step>

  <Step title="Run a Basic Request (Optional SSL Fix)">
    Create a basic PHP script to verify the Guzzle installation:

    ```php PHP theme={null}
    <?php
    require 'vendor/autoload.php';
    use GuzzleHttp\Client;

    $client = new Client([
        'verify' => false,  // Disable SSL verification for testing only
        'timeout' => 30,    // Increase timeout
    ]);

    try {
        $response = $client->request('GET', 'https://oculusproxies.com/blog/proxy-solution-for-bulk-account-creation');
        echo $response->getBody()->getContents();
    } catch (\GuzzleHttp\Exception\RequestException $e) {
        echo "Error: " . $e->getMessage();
        if ($e->hasResponse()) {
            echo "\nResponse: " . $e->getResponse()->getBody();
        }
    }
    ```

    **Windows SSL Error Fix:** If you encounter SSL errors, you may need to configure the certificate authority settings in your `php.ini` file.

    * Download the [cURL certificate file](https://curl.se/docs/caextract.html) and save it locally (e.g., `C:\php\extras\ssl\cacert.pem`).
    * Find your `php.ini` file location using `php --ini` in the terminal.
    * Open `php.ini`, uncomment, and set the following two lines to your certificate path:

    ```bash theme={null}
    curl.cainfo = C:\path\to\cacert.pem
    openssl.cafile = C:\path\to\cacert.pem
    ```
  </Step>

  <Step title="Configure Guzzle with an Oculus Proxies Proxy">
    Add a `proxy` option to your Guzzle request to route your traffic through your Oculus Proxies proxy.

    Include your credentials directly in the proxy URL:

    ```php PHP theme={null}
    <?php
    require 'vendor/autoload.php';

    use GuzzleHttp\Client;

    $client = new Client();

    $response = $client->request('GET', 'https://iproyal.com/blog/industry-news-2', [
        'proxy' => 'http://[username]:[password]@proxy.oculus-proxy.com:31113',
    ]);

    echo $response->getBody()->getContents();
    ```

    Replace `[username]:[password]` with your actual Oculus Proxies details.
  </Step>
</Steps>

## Troubleshooting Guzzle Proxy Issues

Proxies can occasionally lead to errors. Here are solutions for common problems:

* **Timeout Errors:** Your proxy may be slow or offline. **Solution:** Try a different proxy from your Oculus Proxies dashboard, or increase the `'timeout'` option in the Guzzle client.
* **Authentication Errors (e.g., HTTP 407):** The credentials in the proxy string are incorrect. **Solution:** Carefully check your username and password for typos.
* **IP Blocks or Bans:** The target website detected and blocked the IP address. **Solution:** Utilize Oculus Proxies's **rotating proxies** to ensure your IP address changes frequently with each request, minimizing the chance of bans.

<Tip>
    **Best Practice:** Always test your Guzzle proxy setup with a neutral endpoint (like `https://httpbin.org/ip`) to confirm your proxy IP is being used successfully before attempting to scrape a target site.
</Tip>
