Jak włączyć wyświetlanie błędów PHP na stronie

FAQ - zanim zapytasz.
Tutaj znajdziesz odpowiedzi na najczęściej zadawane pytania.
monk
Posts: 556
Joined: 11 Jan 2009, 12:14:57
Gender: None specified
User Agent: Firefox Windows 1152x864

Re: Jak włączyć wyświetlanie błędów PHP na stronie

Post by monk »

Ahh... To tutaj to wrzucasz. W takim razie na początku pliku.
Crashowiak
Posts: 57
Joined: 07 Jul 2008, 10:03:08
Website at CBA.pl: http://www.spyroworld.cba.pl/news.php
Gender: Male
User Agent: Firefox Windows 1280x720
Contact:

Re: Jak włączyć wyświetlanie błędów PHP na stronie

Post by Crashowiak »

Code: Select all

<?php
/*---------------------------------------------------+
| eXtreme-Fusion  Content Management System          |
+----------------------------------------------------+
| Copyright (c) 2005 eXtreme Crew                    |
| http://www.extreme-fusion.pl                       |
+----------------------------------------------------+
| Engine Php-fusion by Nick Jones                    |
| http://www.php-fusion.co.uk/                       |
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the |
| GNU General Public License. For details refer to   |
| the included gpl.txt file or visit http://gnu.org  |
+----------------------------------------------------*/
if (eregi("maincore.php", $_SERVER['PHP_SELF'])) die();

// If register_globals is turned off, extract super globals (php 4.2.0+)
if (ini_get('register_globals') != 1) {
    if ((isset($_POST) == true) && (is_array($_POST) == true)) extract($_POST, EXTR_OVERWRITE);
    if ((isset($_GET) == true) && (is_array($_GET) == true)) extract($_GET, EXTR_OVERWRITE);
}


// Prevent any possible XSS attacks via $_GET.
foreach ($_GET as $check_url) {
    if ((eregi("<[^>]*script*\"?[^>]*>", $check_url)) || (eregi("<[^>]*object*\"?[^>]*>", $check_url)) ||
        (eregi("<[^>]*iframe*\"?[^>]*>", $check_url)) || (eregi("<[^>]*applet*\"?[^>]*>", $check_url)) ||
        (eregi("<[^>]*meta*\"?[^>]*>", $check_url)) || (eregi("<[^>]*style*\"?[^>]*>", $check_url)) ||
        (eregi("<[^>]*form*\"?[^>]*>", $check_url)) || (eregi("\([^>]*\"?[^)]*\)", $check_url)) ||
        (eregi("\"", $check_url))) {
    die ();
    }
}
unset($check_url);


 
Usunąłem tamto co podmieniałem, byście powiedzieli co mam podmienić teraz.
Webdesigner
Posts: 1803
Joined: 26 Mar 2008, 15:55:03
Location: /dev/null/
Gender: Male
User Agent: Firefox Linux 1440x900

Re: Jak włączyć wyświetlanie błędów PHP na stronie

Post by Webdesigner »

"<?php" zamień na:

Code: Select all

<?php
error_reporting(E_ALL);
ini_set('display_errors',1); 
czyli początek pliku będzie taki:

Code: Select all

<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
/*---------------------------------------------------+
| eXtreme-Fusion  Content Management System          |
+----------------------------------------------------+
| Copyright (c) 2005 eXtreme Crew                    |
| http://www.extreme-fusion.pl                       |
+----------------------------------------------------+
| Engine Php-fusion by Nick Jones                    |
| http://www.php-fusion.co.uk/                       |
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the |
| GNU General Public License. For details refer to   |
| the included gpl.txt file or visit http://gnu.org  |
+----------------------------------------------------*/ 
Image
Crashowiak
Posts: 57
Joined: 07 Jul 2008, 10:03:08
Website at CBA.pl: http://www.spyroworld.cba.pl/news.php
Gender: Male
User Agent: Firefox Windows 1280x720
Contact:

Re: Jak włączyć wyświetlanie błędów PHP na stronie

Post by Crashowiak »

Ok strona działa, ale coś jest nie tak z ShoutBoxem, losową fotką i reklamą... wejdźcie i sami zobaczcie - http://www.spyroworld.cba.pl
Webdesigner
Posts: 1803
Joined: 26 Mar 2008, 15:55:03
Location: /dev/null/
Gender: Male
User Agent: Firefox Linux 1440x900

Re: Jak włączyć wyświetlanie błędów PHP na stronie

Post by Webdesigner »

Możesz już wyłączyć raportowanie błędów (usunąć:

Code: Select all

error_reporting(E_ALL);
ini_set('display_errors',1);  
) Albo zamienić

Code: Select all

error_reporting(E_ALL); 
na:

Code: Select all

error_reporting(E_ALL ^ E_NOTICE); 
Image
Crashowiak
Posts: 57
Joined: 07 Jul 2008, 10:03:08
Website at CBA.pl: http://www.spyroworld.cba.pl/news.php
Gender: Male
User Agent: Firefox Windows 1280x720
Contact:

Re: Jak włączyć wyświetlanie błędów PHP na stronie

Post by Crashowiak »

Dzięki wielkie Webdesigner ;)
User avatar
Ziom73
Posts: 117
Joined: 30 Jun 2008, 13:23:10
Website at CBA.pl: http://www.webnets.cba.pl/
Gender: Male
User Agent: Chrome Windows 1680x1050
Contact:

Re: Jak włączyć wyświetlanie błędów PHP na stronie

Post by Ziom73 »

Mi nie działa, i strona i debug.php:
http://schoolhack.cba.pl/debug.php
Webdesigner
Posts: 1803
Joined: 26 Mar 2008, 15:55:03
Location: /dev/null/
Gender: Male
User Agent: Firefox Linux 1440x900

Re: Jak włączyć wyświetlanie błędów PHP na stronie

Post by Webdesigner »

Możliwe, że Twój skrypt później wyłącza raportowanie błędów.
Albo jest coś w stylu:

Code: Select all

if(!defined('COS')){die();} 
Image
pawjol
Posts: 1
Joined: 14 Apr 2017, 16:15:25
Gender: None specified
User Agent: Chrome Windows 1280x1024

Jak włączyć wyświetlanie błędów PHP na stronie

Post by pawjol »

Ja zawsze korzystam z pomocy Houston mamy problem, zawsze mi chętnie pomoga i błyskawicznie rozwiążą problem jeśli chodzi o wszęlkie wirusy, błędy na stronach itp.
Post Reply