php – simplexml_load_file – Warning: simplexml_load_file(): SSL operation failed with code 1.

Error message: Warning: simplexml_load_file(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed… Solution: Download: ca-bundle.crt. Update code:  const URL = „https://service.domain.xy?“; const CA_FILE = „c:/php/cert/ca-bundle.crt“; private function loadXml(string $value1, string $value2)    {        $streamContent = stream_context_get_default([            ‚http‘ => [‚proxy‘ => $this->proxy, ‚request_fulluri‘ => true],            ‚ssl‘ => [‚verify_peer‘ => true,’cafile‘ => self::CA_FILE],        ]);        libxml_set_streams_context($streamContent);       …

php – mysqli – example

    function operaceSQL($sql){    $mysql_server = ‚localhost‘;    $mysql_databaze = ‚database‘;    $mysql_uzivatel = ‚user‘;    $mysql_heslo = ‚password‘;    $mysqli = new mysqli($mysql_server, $mysql_uzivatel, $mysql_heslo, $mysql_databaze);    $operace = strtolower(substr(trim($sql), 0, 6));    switch ($operace) {        case „select“:            settype($zaznam, ‚array‘);            $mysqli_data = $mysqli->query($sql)            or zobrazit($_SERVER[„PHP_SELF“] . “ – operaceSQL: Chyba při provádění SQL příkazu <PRE>“ . $sql . „</PRE><br>Chyba: „…

Content-Security-Policy (CSP): how to allow svg image …

  header(„Content-Security-Policy: default-src ‚self‘ ‚unsafe-eval‘ ‚unsafe-inline‘  https://*.gstatic.com https://*.googleapis.com; img-src ‚self‘ https://*.gstatic.com https://*.googleapis.com data:;“);