Skocz do zawartości
Shadow2100

Xampp Apache

Rekomendowane odpowiedzi

Witam, przejdę od razu do rzeczy mam problem gdyż nie jestem programista i nie wiem co jest nie tak z kodem.

Program Xampp dokładniej Apache jest używane.

Kod został pisany pod zlecenie dla jednej firmy niestety programista który to robił uciekł z firmy a muszę wprowadzić prostą zmianę która wywala cały program/skrypt.

Problem pojawia się gdy w settings (poniżej) zmieniam aaa na ggg albo gdy zmieniam id z 1 na 10. problemem jest błąd wyświetlenia informacji który obiawia się czystym białym polem.

A może to nie jest błąd tylko coś się nie dogrywa i problem może być gdzieś indziej.

 

Przepraszam za ścianę tekstu. :(

 

htdocs\index.php

 

 
<?php
use Symfony\Component\Debug\Debug;
use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\Debug\ExceptionHandler;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Yaml\Yaml;

require __DIR__ . DIRECTORY_SEPARATOR . "vendor" . DIRECTORY_SEPARATOR . "autoload.php";

Debug::enable(E_ALL, false);
ErrorHandler::register();
ExceptionHandler::register();

$Settings = Yaml::parse(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "settings.yml"));
$Request = Request::createFromGlobals();

try {
   $PDO = new PDO ("firebird:host=localhost;dbname=C:\ProgramData\FF\wys.fdb;charset=UTF8", "SYSDBA", "masterkey");//C:\ProgramData\FF\
   $PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (Exception $Exception) {
   if (!$Request->isMethod("POST")) {
       header("Location: /");

       exit;
   }

   throw $Exception;
}

$groupsIds = [];
foreach ($Settings['groups'] as $Group) $groupsIds[] = (int)$Group['id'];

$Render = "index.twig";
$freeSpace = 0;

$Loader = new Twig_Loader_Filesystem (["views"]);
$Twig = new Twig_Environment ($Loader, ["debug" => true]);
$Twig->addFunction(new Twig_SimpleFunction ("dump", "dump", ["is_safe" => ["html"]]));

if ($Request->isMethod("POST") && $Request->get("reload_view") == "1" && in_array($Request->get("reload_group"), $groupsIds)) {
   $Result = $PDO->query("SELECT * FROM PARK_GROUPS WHERE REF_GROUP = '".$Request->get("reload_group")."' AND REF_PARKING = '".$Settings['parking_id']."'");
   $Data = $Result->fetch();

   $freeSpace = (int)$Data['GPLACES']-(int)$Data['GUSED'];
   $freeSpace = $freeSpace < 0 ? 0 : $freeSpace;

   $Render = "view.twig";
}

echo $Twig->render($Render, ["space" => ($freeSpace), "settings" => $Settings]);

 

albo

 

 

htdocs\views\index.twig

 

<!DOCTYPE html>
<html lang="pl">
<head>
   <meta charset="utf-8" />
   <meta http-equiv="X-UA-Compatible" content="IE=edge" />
   <meta name="viewport" content="width=device-width, initial-scale=1" />

   <title>Parking System Display</title>

   <link href="/assets/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body style="padding: 5px;">
   {% for group in settings['groups']|default([]) %}
       <div id="view{{ group['id'] }}" style="float: left;"></div>
   {% endfor %}

   <script src="/assets/js/jquery.min.js"></script>
   <script src="/assets/js/bootstrap.min.js"></script>

   <script type="text/javascript">
       $(document).ready(function () {
           var errorCount = 0;

           {% for group in settings['groups']|default([]) %}
               reloadView({{ group['id'] }}, "{{ group['name'] }}");

               $("#view{{ group['id'] }}").css("width", (window.innerWidth/2).toFixed(0)-5);
               $("#view{{ group['id'] }}").css("height", (window.innerHeight/2).toFixed(0)-5);
           {% endfor %}

           function reloadView (group, name) {
               $.ajax({
                   type: "POST",
                   url: "",
                   data: {"reload_view":1, "reload_group":group},
                   success: function (result) {
                       $("#view" + group).html(result);
					$("#view" + group).find(".view2").css("width", $("#view" + group).width());
					$("#view" + group).find(".view2").css("height", $("#view" + group).height());
					$("#view" + group).find(".group-name").html(name);

                       setTimeout(function () {
                           reloadView(group, name);
                       }, 5000);
                   },
                   error: function () {
                       reloadView(group, name);

                       if (errorCount > 1000) window.location.reload();
                       errorCount++;
                   }
               })
           }
       });
   </script>
</body>
</html>

 

htdocs\settings.yml

 

# Rozmiar nazwy
name: "100"

# Rozmiar tekstu [220]
text: "50"

# Rozmiar liczby [400]
number: "140"

# Rozmiar tekstu przy barku wolnych miejsc
text_no_space: "50"

# Margines górny dla ilości
number_margin: "170"

# Margines górny dla braku miejsc
no_space_margin: "35"

# Identyfikator parkingu
parking_id: "4"

# Grupy
groups:
   - { id: "1", name: "aaa" }
   - { id: "2", name: "bbb" }
   - { id: "3", name: "ccc" }
   - { id: "4", name: "ddd" }

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Upewnij się, że edytujesz programem, który nic od siebie nie dokłada (czyli np. jest utf8, ale bez bom)

W xampie, w polu z apachem masz guzik do wyboru logów, wybierz error.log, przewiń na sam dół i wklej na forum z 10 linijek.

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

U siebie używam notepada++ na serwerze używany jest zwykły notatnik.

 

[Fri Aug 30 10:59:26.563590 2019] [mpm_winnt:notice] [pid 12944:tid 624] AH00354: Child: Starting 150 worker threads.

[Fri Aug 30 10:59:33.508011 2019] [ssl:warn] [pid 1048:tid 244] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name

[Fri Aug 30 10:59:33.556163 2019] [core:warn] [pid 1048:tid 244] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

[Fri Aug 30 10:59:33.627328 2019] [ssl:warn] [pid 1048:tid 244] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name

[Fri Aug 30 10:59:33.647382 2019] [mpm_winnt:notice] [pid 1048:tid 244] AH00455: Apache/2.4.27 (Win32) OpenSSL/1.0.2l PHP/7.1.9 configured -- resuming normal operations

[Fri Aug 30 10:59:33.647382 2019] [mpm_winnt:notice] [pid 1048:tid 244] AH00456: Apache Lounge VC14 Server built: Jul 9 2017 11:48:22

[Fri Aug 30 10:59:33.647382 2019] [core:notice] [pid 1048:tid 244] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'

[Fri Aug 30 10:59:33.680471 2019] [mpm_winnt:notice] [pid 1048:tid 244] AH00418: Parent: Created child process 3348

[Fri Aug 30 10:59:34.042432 2019] [ssl:warn] [pid 3348:tid 644] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name

[Fri Aug 30 10:59:34.154731 2019] [ssl:warn] [pid 3348:tid 644] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name

[Fri Aug 30 10:59:34.175786 2019] [mpm_winnt:notice] [pid 3348:tid 644] AH00354: Child: Starting 150 worker threads.

[Fri Aug 30 10:59:35.422535 2019] [php7:warn] [pid 3348:tid 2072] [client 127.0.0.1:58836] PHP Warning: Illegal string offset 'groups' in C:\\xampp\\htdocs\\index.php on line 31

[Fri Aug 30 10:59:35.423507 2019] [php7:warn] [pid 3348:tid 2072] [client 127.0.0.1:58836] PHP Warning: Invalid argument supplied for foreach() in C:\\xampp\\htdocs\\index.php on line 31

[Fri Aug 30 10:59:40.100668 2019] [php7:warn] [pid 3348:tid 2072] [client 127.0.0.1:58836] PHP Warning: Illegal string offset 'groups' in C:\\xampp\\htdocs\\index.php on line 31

[Fri Aug 30 10:59:40.100668 2019] [php7:warn] [pid 3348:tid 2072] [client 127.0.0.1:58836] PHP Warning: Invalid argument supplied for foreach() in

C:\\xampp\\htdocs\\index.php on line 31

 

31 linijka z index.php

foreach ($Settings['groups'] as $Group) $groupsIds[] = (int)$Group['id'];

[code/]

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Na górze dodaj

use Symfony\Component\Yaml\Exception\ParseException;

 

i zastąp

try {

$Settings = Yaml::parse(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "settings.yml"));

var_dump($Settings);

} catch (ParseException $exception) {

printf('Unable to parse the YAML string: %s', $exception->getMessage());

}

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Że jakoś tak ?

 

<?php
use Symfony\Component\Debug\Debug;
use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\Debug\ExceptionHandler;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Yaml\Exception\ParseException;

require __DIR__ . DIRECTORY_SEPARATOR . "vendor" . DIRECTORY_SEPARATOR . "autoload.php";

Debug::enable(E_ALL, false);
ErrorHandler::register();
ExceptionHandler::register();

$Settings = Yaml::parse(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "settings.yml"));
$Request = Request::createFromGlobals();

try {
   $PDO = new PDO ("firebird:host=localhost;dbname=C:\ProgramData\FF\NumberOk3\NumberOk3.fdb;charset=UTF8", "SYSDBA", "masterkey");//C:\ProgramData\FF\NumberOk3\
   $PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (Exception $Exception) {
   if (!$Request->isMethod("POST")) {
       header("Location: /");

       exit;
   }

   throw $Exception;
}

$groupsIds = [];

try {
$Settings = Yaml::parse(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "settings.yml"));
var_dump($Settings);
} catch (ParseException $exception) {
printf('Unable to parse the YAML string: %s', $exception->getMessage());
} 


$Render = "index.twig";
$freeSpace = 0;

$Loader = new Twig_Loader_Filesystem (["views"]);
$Twig = new Twig_Environment ($Loader, ["debug" => true]);
$Twig->addFunction(new Twig_SimpleFunction ("dump", "dump", ["is_safe" => ["html"]]));

if ($Request->isMethod("POST") && $Request->get("reload_view") == "1" && in_array($Request->get("reload_group"), $groupsIds)) {
   $Result = $PDO->query("SELECT * FROM PARK_GROUPS WHERE REF_GROUP = '".$Request->get("reload_group")."' AND REF_PARKING = '".$Settings['parking_id']."'");
   $Data = $Result->fetch();

   $freeSpace = (int)$Data['GPLACES']-(int)$Data['GUSED'];
   $freeSpace = $freeSpace < 0 ? 0 : $freeSpace;

   $Render = "view.twig";
}

echo $Twig->render($Render, ["space" => ($freeSpace), "settings" => $Settings]);

 

 

Teraz nie mogę podejrzeć co jest na przeglądarce.

 

[sat Aug 31 14:46:08.057917 2019] [ssl:warn] [pid 20928:tid 628] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[sat Aug 31 14:46:08.133916 2019] [core:warn] [pid 20928:tid 628] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[sat Aug 31 14:46:08.263921 2019] [ssl:warn] [pid 20928:tid 628] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[sat Aug 31 14:46:08.296921 2019] [mpm_winnt:notice] [pid 20928:tid 628] AH00455: Apache/2.4.27 (Win32) OpenSSL/1.0.2l PHP/7.1.9 configured -- resuming normal operations
[sat Aug 31 14:46:08.296921 2019] [mpm_winnt:notice] [pid 20928:tid 628] AH00456: Apache Lounge VC14 Server built: Jul  9 2017 11:48:22
[sat Aug 31 14:46:08.296921 2019] [core:notice] [pid 20928:tid 628] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[sat Aug 31 14:46:08.312916 2019] [mpm_winnt:notice] [pid 20928:tid 628] AH00418: Parent: Created child process 6180
[sat Aug 31 14:46:09.491920 2019] [ssl:warn] [pid 6180:tid 652] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[sat Aug 31 14:46:09.695916 2019] [ssl:warn] [pid 6180:tid 652] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[sat Aug 31 14:46:09.731920 2019] [mpm_winnt:notice] [pid 6180:tid 652] AH00354: Child: Starting 150 worker threads.

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Generalnie miałeś zastąpić linię która ten sam kod zawiera.

Zmień jeszcze Debug::enable(E_ALL, true);

 

Pewnie jest problem z parsowanien yaml. Może źle zapisany z bom.

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Teraz to wygląda tak.

 

array(8) {["name"]=>string(3) "100"["text"]=>string(2) "50"["number"]=>string(3) "140"["text_no_space"]=>string(2) "50"["number_margin"]=>string(3) "170"["no_space_margin"]=>string(2) "35"["parking_id"]=>string(1) "4"["groups"]=>array(4) {[0]=>array(2) {["id"]=>string(1) "4"["name"]=>string(3) "aaa"}[1]=>array(2) {["id"]=>string(1) "5"["name"]=>string(3) "bbb"}[2]=>array(2) {["id"]=>string(1) "3"["name"]=>string(3) "ccc"}[3]=>array(2) {["id"]=>string(1) "9"["name"]=>string(7) "ddd"}} } 

 

<?php
use Symfony\Component\Debug\Debug;
use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\Debug\ExceptionHandler;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Yaml\Exception\ParseException;

require __DIR__ . DIRECTORY_SEPARATOR . "vendor" . DIRECTORY_SEPARATOR . "autoload.php";

Debug::enable(E_ALL, true);
ErrorHandler::register();
ExceptionHandler::register();

try {
$Settings = Yaml::parse(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "settings.yml"));
var_dump($Settings);
} catch (ParseException $exception) {
printf('Unable to parse the YAML string: %s', $exception->getMessage());
} 
$Request = Request::createFromGlobals();

try {
   $PDO = new PDO ("firebird:host=localhost;dbname=C:\ProgramData\FF\NumberOk3\NumberOk3.fdb;charset=UTF8", "SYSDBA", "masterkey");//C:\ProgramData\FF\NumberOk3\
   $PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (Exception $Exception) {
   if (!$Request->isMethod("POST")) {
       header("Location: /");

       exit;
   }

   throw $Exception;
}

$groupsIds = [];
foreach ($Settings['groups'] as $Group) $groupsIds[] = (int)$Group['id'];

$Render = "index.twig";
$freeSpace = 0;
$freeSpace = 0;

$Loader = new Twig_Loader_Filesystem (["views"]);
$Twig = new Twig_Environment ($Loader, ["debug" => true]);
$Twig->addFunction(new Twig_SimpleFunction ("dump", "dump", ["is_safe" => ["html"]]));

if ($Request->isMethod("POST") && $Request->get("reload_view") == "1" && in_array($Request->get("reload_group"), $groupsIds)) {
   $Result = $PDO->query("SELECT * FROM PARK_GROUPS WHERE REF_GROUP = '".$Request->get("reload_group")."' AND REF_PARKING = '".$Settings['parking_id']."'");
   $Data = $Result->fetch();

   $freeSpace = (int)$Data['GPLACES']-(int)$Data['GUSED'];
   $freeSpace = $freeSpace < 0 ? 0 : $freeSpace;

   $Render = "view.twig";
}

echo $Twig->render($Render, ["space" => ($freeSpace), "settings" => $Settings]);

 

teraz jest poprawnie ?

 

Logi

 

[sat Aug 31 17:41:49.184108 2019] [ssl:warn] [pid 20808:tid 628] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[sat Aug 31 17:41:49.315109 2019] [core:warn] [pid 20808:tid 628] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[sat Aug 31 17:41:49.502533 2019] [ssl:warn] [pid 20808:tid 628] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[sat Aug 31 17:41:49.542108 2019] [mpm_winnt:notice] [pid 20808:tid 628] AH00455: Apache/2.4.27 (Win32) OpenSSL/1.0.2l PHP/7.1.9 configured -- resuming normal operations
[sat Aug 31 17:41:49.542108 2019] [mpm_winnt:notice] [pid 20808:tid 628] AH00456: Apache Lounge VC14 Server built: Jul  9 2017 11:48:22
[sat Aug 31 17:41:49.542108 2019] [core:notice] [pid 20808:tid 628] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[sat Aug 31 17:41:49.597110 2019] [mpm_winnt:notice] [pid 20808:tid 628] AH00418: Parent: Created child process 11660
[sat Aug 31 17:41:51.032042 2019] [ssl:warn] [pid 11660:tid 268] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[sat Aug 31 17:41:51.295042 2019] [ssl:warn] [pid 11660:tid 268] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[sat Aug 31 17:41:51.342044 2019] [mpm_winnt:notice] [pid 11660:tid 268] AH00354: Child: Starting 150 worker threads.

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Teraz podmień na ggg i zobacz co się pokaże na ekranie

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

W kodzie błędu nie ma raczej. Pobiera tablicę 4 elementów. Zmiana id może nic nie wyświetlać jeżeli w bazie nie będzie takiego wpisu. Jedyne co tutaj może jeszcze być to może jakiś cache. Co rozumiesz przez to białe pole?

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Na ekranie pokazuje się nic próbuje ciągle sie załadować po zmianie.

 

Biały pole mam namyśli czystą kartę bez niczego.

 

[sat Aug 31 17:41:51.032042 2019] [ssl:warn] [pid 11660:tid 268] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[sat Aug 31 17:41:51.295042 2019] [ssl:warn] [pid 11660:tid 268] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[sat Aug 31 17:41:51.342044 2019] [mpm_winnt:notice] [pid 11660:tid 268] AH00354: Child: Starting 150 worker threads.
[sat Aug 31 17:44:51.395720 2019] [php7:warn] [pid 11660:tid 2068] [client 127.0.0.1:4658] PHP Warning:  Uncaught PDOException: SQLSTATE[HY000] [335544726] Error reading data from the connection. in C:\\xampp\\htdocs\\index.php:24\nStack trace:\n#0 C:\\xampp\\htdocs\\index.php(24): PDO->__construct('firebird:host=l...', 'SYSDBA', 'masterkey')\n#1 {main}\n  thrown in C:\\xampp\\htdocs\\index.php on line 24, referer: http://127.0.0.1:2137/
[sat Aug 31 17:44:51.395720 2019] [php7:error] [pid 11660:tid 2068] [client 127.0.0.1:4658] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\xampp\\htdocs\\index.php on line 26, referer: http://127.0.0.1:2137/
[sat Aug 31 17:47:51.394947 2019] [php7:warn] [pid 11660:tid 2084] [client 127.0.0.1:4656] PHP Warning:  Uncaught PDOException: SQLSTATE[HY000] [335544726] Error reading data from the connection. in C:\\xampp\\htdocs\\index.php:24\nStack trace:\n#0 C:\\xampp\\htdocs\\index.php(24): PDO->__construct('firebird:host=l...', 'SYSDBA', 'masterkey')\n#1 {main}\n  thrown in C:\\xampp\\htdocs\\index.php on line 24, referer: http://127.0.0.1:2137/
[sat Aug 31 17:47:51.395948 2019] [php7:error] [pid 11660:tid 2084] [client 127.0.0.1:4656] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\xampp\\htdocs\\index.php on line 26, referer: http://127.0.0.1:2137/
[sat Aug 31 17:50:51.396157 2019] [php7:warn] [pid 11660:tid 2092] [client 127.0.0.1:4655] PHP Warning:  Uncaught PDOException: SQLSTATE[HY000] [335544726] Error reading data from the connection. in C:\\xampp\\htdocs\\index.php:24\nStack trace:\n#0 C:\\xampp\\htdocs\\index.php(24): PDO->__construct('firebird:host=l...', 'SYSDBA', 'masterkey')\n#1 {main}\n  thrown in C:\\xampp\\htdocs\\index.php on line 24, referer: http://127.0.0.1:2137/
[sat Aug 31 17:50:51.396157 2019] [php7:error] [pid 11660:tid 2092] [client 127.0.0.1:4655] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\xampp\\htdocs\\index.php on line 26, referer: http://127.0.0.1:2137/
[sat Aug 31 17:50:51.396157 2019] [php7:warn] [pid 11660:tid 2080] [client 127.0.0.1:4659] PHP Warning:  Uncaught PDOException: SQLSTATE[HY000] [335544722] Failed to establish a connection. in C:\\xampp\\htdocs\\index.php:24\nStack trace:\n#0 C:\\xampp\\htdocs\\index.php(24): PDO->__construct('firebird:host=l...', 'SYSDBA', 'masterkey')\n#1 {main}\n  thrown in C:\\xampp\\htdocs\\index.php on line 24, referer: http://127.0.0.1:2137/
[sat Aug 31 17:50:51.397157 2019] [php7:error] [pid 11660:tid 2080] [client 127.0.0.1:4659] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\xampp\\htdocs\\index.php on line 26, referer: http://127.0.0.1:2137/
[sat Aug 31 17:53:51.396901 2019] [php7:warn] [pid 11660:tid 2060] [client 127.0.0.1:4660] PHP Warning:  Uncaught PDOException: SQLSTATE[HY000] [335544726] Error reading data from the connection. in C:\\xampp\\htdocs\\index.php:24\nStack trace:\n#0 C:\\xampp\\htdocs\\index.php(24): PDO->__construct('firebird:host=l...', 'SYSDBA', 'masterkey')\n#1 {main}\n  thrown in C:\\xampp\\htdocs\\index.php on line 24
[sat Aug 31 17:53:51.396901 2019] [php7:error] [pid 11660:tid 2060] [client 127.0.0.1:4660] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\xampp\\htdocs\\index.php on line 26
[sat Aug 31 17:56:51.397538 2019] [php7:warn] [pid 11660:tid 2056] [client 127.0.0.1:4661] PHP Warning:  Uncaught PDOException: SQLSTATE[HY000] [335544726] Error reading data from the connection. in C:\\xampp\\htdocs\\index.php:24\nStack trace:\n#0 C:\\xampp\\htdocs\\index.php(24): PDO->__construct('firebird:host=l...', 'SYSDBA', 'masterkey')\n#1 {main}\n  thrown in C:\\xampp\\htdocs\\index.php on line 24
[sat Aug 31 17:56:51.397538 2019] [php7:error] [pid 11660:tid 2056] [client 127.0.0.1:4661] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\xampp\\htdocs\\index.php on line 26
[sat Aug 31 17:59:51.397444 2019] [php7:warn] [pid 11660:tid 2040] [client 127.0.0.1:4675] PHP Warning:  Uncaught PDOException: SQLSTATE[HY000] [335544726] Error reading data from the connection. in C:\\xampp\\htdocs\\index.php:24\nStack trace:\n#0 C:\\xampp\\htdocs\\index.php(24): PDO->__construct('firebird:host=l...', 'SYSDBA', 'masterkey')\n#1 {main}\n  thrown in C:\\xampp\\htdocs\\index.php on line 24
[sat Aug 31 17:59:51.398449 2019] [php7:error] [pid 11660:tid 2040] [client 127.0.0.1:4675] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\xampp\\htdocs\\index.php on line 26
[sat Aug 31 19:06:51.729354 2019] [php7:warn] [pid 11660:tid 2040] [client 127.0.0.1:5204] PHP Warning:  Uncaught PDOException: SQLSTATE[HY000] [335544726] Error reading data from the connection. in C:\\xampp\\htdocs\\index.php:24\nStack trace:\n#0 C:\\xampp\\htdocs\\index.php(24): PDO->__construct('firebird:host=l...', 'SYSDBA', 'masterkey')\n#1 {main}\n  thrown in C:\\xampp\\htdocs\\index.php on line 24
[sat Aug 31 19:06:51.730354 2019] [php7:error] [pid 11660:tid 2040] [client 127.0.0.1:5204] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\xampp\\htdocs\\index.php on line 26
[sat Aug 31 19:09:51.737000 2019] [php7:warn] [pid 11660:tid 2056] [client 127.0.0.1:5227] PHP Warning:  Uncaught PDOException: SQLSTATE[HY000] [335544726] Error reading data from the connection. in C:\\xampp\\htdocs\\index.php:24\nStack trace:\n#0 C:\\xampp\\htdocs\\index.php(24): PDO->__construct('firebird:host=l...', 'SYSDBA', 'masterkey')\n#1 {main}\n  thrown in C:\\xampp\\htdocs\\index.php on line 24
[sat Aug 31 19:09:51.737000 2019] [php7:error] [pid 11660:tid 2056] [client 127.0.0.1:5227] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\xampp\\htdocs\\index.php on line 26

 

 

Linia 24

$PDO = new PDO ("firebird:host=localhost;dbname=C:\ProgramData\FF\NumberOk3\NumberOk3.fdb;charset=UTF8", "SYSDBA", "masterkey");//C:\ProgramData\FF\NumberOk3\

 

Linia 26

} catch (Exception $Exception) {

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

no to teraz to wygląda tak.

 

 

28 linijka.

catch (Exception $Exception) 

 

co moze tym razem byc ?

 

LOG


[sun Sep 01 12:27:14.029638 2019] [php7:warn] [pid 14532:tid 2080] [client 127.0.0.1:9308] PHP Warning:  Uncaught PDOException: SQLSTATE[HY000] [335544726] Error reading data from the connection. in C:\\xampp\\htdocs\\index.php:24\nStack trace:\n#0 C:\\xampp\\htdocs\\index.php(24): PDO->__construct('firebird:host=l...', 'SYSDBA', 'masterkey')\n#1 {main}\n  thrown in C:\\xampp\\htdocs\\index.php on line 24
[sun Sep 01 12:27:14.029638 2019] [php7:error] [pid 14532:tid 2080] [client 127.0.0.1:9308] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in C:\\xampp\\htdocs\\index.php on line 28
[sun Sep 01 12:33:20.135663 2019] [core:warn] [pid 9416:tid 700] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[sun Sep 01 12:33:20.303663 2019] [mpm_winnt:notice] [pid 9416:tid 700] AH00455: Apache/2.4.27 (Win32) OpenSSL/1.0.2l PHP/7.1.9 configured -- resuming normal operations
[sun Sep 01 12:33:20.303663 2019] [mpm_winnt:notice] [pid 9416:tid 700] AH00456: Apache Lounge VC14 Server built: Jul  9 2017 11:48:22
[sun Sep 01 12:33:20.303663 2019] [core:notice] [pid 9416:tid 700] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[sun Sep 01 12:33:20.319658 2019] [mpm_winnt:notice] [pid 9416:tid 700] AH00418: Parent: Created child process 14708
[sun Sep 01 12:33:21.758662 2019] [mpm_winnt:notice] [pid 14708:tid 300] AH00354: Child: Starting 150 worker threads.

post-611644-15673341360546_thumb.png

Edytowane przez Shadow2100

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

A powiedz jak ten kod wykonujesz ? Postawiłeś lokalnie serwer, pobrałeś jakiś firmowy kod? Czy to środowisko jest przygotowane do pracy z firebird? Może jakaś stara wersja.

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

próbuje odtworzyć całe środowisko na swoim prywatnym komputerze ponieważ nie mam dostępu do serwerowni w której znajduje się wszystko serwer był robiony z 2 lata temu wiec wszystko co jest postawione na nim nie było aktualizowane ani nic gdyż były ciągle problemy z firebird i wyświetlaczem.

Lokalny serwer.

co masz na myśli firmowy kod ?

to środowisko (prywatne) jak i serwerowe czyli docelowe jest przygotowane.

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Średnio mogę ci pomóc bo ten błąd może oznaczać wszystko wliczając starą wersję bazy czy serwer na windows. Szukaj po kodzie błędu. Rozumiem że na xampie dodałeś rozszerzenie firebird i działa prawidłowo?

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Początkowo to było przez programistę robione wiec pewnie to zrobił. Działał prawidłowo przed zmianami. A do siebie zainstalowałem tą samą wersje i skopiowałem poprostu całego xamppa z serwera.

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Może być inny windows, inne biblioteki uruchomieniowe, może złą dllkę firebirda wgrałeś do rozszerzeń. Przeklej sobie komunikat[HY000] [335544726] Error reading data from the connection i kombinuj. A sprawdzałeś firewall?

Edytowane przez Viking

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Pierwsza sprawa jak jest to symfonowa aplikacja to masz coś takiego jak plik .env w którym sprawdź jaki env masz ustawiony - powinien być DEV - będzie logował błędy.

 

Kolejno sprawdź plik var/log/dev.log

Tam powinny być dokładniejsze informacje o błędzie.

 

Patrząc jeszcze na kod, to możliwe że ktoś tam cyrki nawywijał jak jest to symfonowa aplikacja, lub próbuje wpakować cały proces w jeden plik używając poczek symfonowych.

Samo wykonanie kodu to pakowanie się w kłopoty. Nie dziwię się, że uciekł ten "programista", czy bardziej stażysta bez niczyjej kontrolii.

Pamiętaj, jak coś tam dopiszesz to dziwnym trafem staniesz się "właścicielem" kodu i kolejne błędy będą osądzane na Ciebie.

Ja bym podszedł do sprawy bardziej ostrożnie, bo sam piszesz, że programistą nie jesteś, więc nie musisz udowadniać firmie, żę umiesz.

Jeżeli zaś chcesz sam zrozumieć co tu się dzieje, to już jako pierwsza lekacja: kategorycznie odradzam w ten sposób pisać skrypty.

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Masz zainstalowanego i uruchomionego firebirda?

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Upewnij się, że jest odpalona.

Plik z danymi masz w C:\ProgramData\FF\wys.fdb ?

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się

  • Ostatnio przeglądający   0 użytkowników

    Brak zarejestrowanych użytkowników przeglądających tę stronę.

×
×
  • Dodaj nową pozycję...