简体   繁体   中英

PHP Composer with ZScaler

I'm trying to download the phpspreadsheet library for php 7.4 but I'm facing trouble with certificates. In my company, ZScaler is used to inspect.network and it causes troubles with all those installers like pip or composer.

The first problem I encountered was the composer's installation. I guess I solved this problem by getting the appropriate certificate and setting its path in the openssl.cafile field (php.ini). Now, composer works but when I try to install my package, I have a lot of curl certificate errors.

Composer errors

Browsing the web, I found some information to put in the composer.json file but I'm not sure it was what I was looking for.

{
  "repositories": [
    {
      "type": "composer",
      "url": "https://repo.packagist.org/",
      "options": {
        "ssl": {
          "verify_peer": true,
          "allow_self_signed": true,
          "cafile": "C:/Program Files/Common Files/SSL/ZscalerRootCertificate-2048-SHA256.crt",
          "local_cert": "C:/Program Files/Common Files/SSL/ZscalerRootCertificate-2048-SHA256.crt"
        }
      }
    }
  ],
  "require": {
    "phpoffice/phpspreadsheet": "^1.20"
  }
}

Does anyone know how I could make the composer work?

Possible solution:

  1. First open Zscaler
  2. Change Status to: Turn off (Image take it from Google) 在此处输入图像描述
  3. Install your things in composer
  4. Turn on again Zscaler again

NOTE: This works to install dependencies and similars, but not works if you need connect with an API (Now i'm trying to fix it)

Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM