Welcome Guest, Not a member yet? Register   Sign In
Blank page on the web server
#11

@PHS,

Please show the exact steps tried and I will try to reproduce the problem.
Reply
#12

(This post was last modified: 05-07-2020, 02:43 PM by PHS.)

Thanks for the support!

First I need to clarify that I am using Hostgator vps hosting.

1 - I created a directory at the root of my server (/home/xxxnsp) and put the CodeIgniter files in the ci4 directory, as indicated by the blue arrow in the attached image or image below;

[Image: full.jpg]

2 - I created a folder in the public folder of the server (public_html/test), this folder is a subdomain, and placed the public CodeIgniter files in that location, as indicated by the red arrow in the image;

3 - I configured the index.php, located in the public_html/test directory, according to the code below:

PHP Code:
$pathsPath FCPATH '../../ci4/app/Config/Paths.php'


4 - I configured the App.php file, located in the root app/Config/App.php directory, according to the code below:

PHP Code:
public $baseURL 'https://test.inspex.com.br/'


5 - I didn't touch any other file or line of code.

Note: I'm still working on this project and just created this subdomain to be able to do the tests in a real server environment. After finishing the tests, I will delete this subdomain and put the public CodeIgniter files in the folder public_html.
Reply
#13

(This post was last modified: 04-21-2020, 11:56 PM by John_Betong.)

I created an admin sub-directory on the following site and it works OK

https://ci4-strict.tk/admin/

Please note: I have set the writable folder permissions to 0655 and the modified system files ignore the error unless there are any files to write to the writable directory.


Here is the index.php to produce normal errors rather than a blank page:

file: ./public_html/admin/index.php
Code:
<?php DECLARE(STRICT_TYPES=1); ?>
<?php

// Valid PHP Version?
$minPHPVersion = '7.2';
if (phpversion() < $minPHPVersion)
{
    die("Your PHP version must be {$minPHPVersion} or higher to run CodeIgniter. Current version: " . phpversion());
}
unset($minPHPVersion);

// NEW STUFF GOES HERE =========================================================
error_reporting(-1); // regardless

# require '../../app-strict/Views/incs/fred.php';

# define('jj', "\n<br>");
define('LOG_FILE',   '../writable/logs/log-' .date('Y-m-d') .'.php');
define('LOCALHOST', 'localhost'===$_SERVER['SERVER_NAME']);
if(LOCALHOST) :
  define('CI_DEBUG',  FALSE); // bypass (bool) app/Config/oot/development.php
  ini_set('display_errors', '1');

  $_SERVER['CI_ENVIRONMENT'] = 'production';  // bypass .env & .htaccess
  if(0):
    $_SERVER['CI_ENVIRONMENT'] = 'development'; // bypass .env & .htaccess
  endif; 
  $useKint =  FALSE;

# CLEANER -  only shows last error logs and debugbar JSON files
  $ok = @unlink(LOG_FILE);
  $ok = @array_map('unlink', glob("../writable/debugbar/*.json"));
else: 
  define('CI_DEBUG', FALSE); // bypass (bool) app/Config/oot/prdouction.php
  ini_set('display_errors', '0');
  $_SERVER['CI_ENVIRONMENT'] = 'production'; // bypass .env & .htaccess
  $useKint = ! FALSE;
endif;
// NEW STUFF GOES HERE =========================================================



// Path to the front controller (this file)
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);

// Location of the Paths config file.
// This is the line that might need to be changed, depending on your folder structure.
$pathsPath = FCPATH . '../../app/Config/Paths.php';
// ^^^ Change this if you move your application folder

/*
*---------------------------------------------------------------
* BOOTSTRAP THE APPLICATION
*---------------------------------------------------------------
* This process sets up the path constants, loads and registers
* our autoloader, along with Composer's, loads our constants
* and fires up an environment-specific bootstrapping.
*/

// Ensure the current directory is pointing to the front controller's directory
chdir(__DIR__);

// Load our paths config file
require $pathsPath;
$paths = new Config\Paths();

// Location of the framework bootstrap file.
$app = require rtrim($paths->systemDirectory, '/ ') . '/bootstrap.php';

/*
*---------------------------------------------------------------
* LAUNCH THE APPLICATION
*---------------------------------------------------------------
* Now that everything is setup, it's time to actually fire
* up the engines and make this app do its thang.
*/
$app->run();
Reply
#14

(This post was last modified: 05-07-2020, 02:39 PM by PHS.)

I implemented the code suggested above and continue with the page blank.

The only log that is received is as follows:

Code:
INFO - 2020-04-22 09:03:06 -> Controller "App\Controllers\Home" loaded.
Reply
#15

Please delete or rename the log file, call the page again and post the full log file here.
Reply
#16

(04-22-2020, 07:14 AM)John_Betong Wrote: Please delete or rename the log file, call the page again and post the full log file here.

Jhon, the log only shows this line.

I configured Logger.php to show all possible system warnings, if I don't think even that line would be shown.
Reply
#17

It is not easy trying to find errors when nothing is showing so I force errors and ensure something is shown and not a blank page.

Make sure the following points are noted:

1. add this line to ./app/Views/welcome_message.php -> <?php echo $bad_value/$bad; ?>
2. set index.php -> $_SERVER['CI_ENVIRONMENT'] = 'development';

I have set the above and the results can be found here and errors are showing:

https://ci4-strict.tk/admin/index-development.php

Here are the changes made to index.php
Code:
...
...
unset($minPHPVersion);

// START NEW STUFF GOES HERE =========================================================
error_reporting(-1); // regardless

define('LOG_FILE',   '../writable/logs/log-' .date('Y-m-d') .'.php');
define('LOCALHOST', 'localhost'===$_SERVER['SERVER_NAME']);
if(LOCALHOST) :
  define('CI_DEBUG',  FALSE); // bypass (bool) app/Config/oot/development.php
  ini_set('display_errors', '1');

  $_SERVER['CI_ENVIRONMENT'] = 'production';  // bypass .env & .htaccess
  if(01):
    $_SERVER['CI_ENVIRONMENT'] = 'development'; // bypass .env & .htaccess
  endif;  
  $useKint =  FALSE;

# CLEANER -  only shows last error logs and debugbar JSON files
  $ok = @unlink(LOG_FILE);
  $ok = @array_map('unlink', glob("../writable/debugbar/*.json"));
else:  
  define('CI_DEBUG', FALSE); // bypass (bool) app/Config/oot/prdouction.php
  ini_set('display_errors', '1');
  # $_SERVER['CI_ENVIRONMENT'] = 'production'; // bypass .env & .htaccess
  $_SERVER['CI_ENVIRONMENT'] = 'development'; // bypass .env & .htaccess
  $useKint = FALSE;
endif;
// FINISH NEW STUFF GOES HERE =========================================================
Reply
#18

(This post was last modified: 05-07-2020, 02:49 PM by PHS.)

1 - I changed the file as requested ./app/Views/welcome_message.php:


PHP Code:
<?php echo $bad_value/$bad?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome to CodeIgniter 4!</title>
<meta name="description" content="The small framework with powerful features">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/png" href="/favicon.ico"/>

<!-- STYLES -->

<style {csp-style-nonce}>
* {
transition: background-color 300ms ease, color 300ms ease;
}
*:focus {
background-color: rgba(221, 72, 20, .2);
outline: none;
}
html, body {
color: rgba(33, 37, 41, 1);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
font-size: 16px;
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
header {
background-color: rgba(247, 248, 249, 1);
padding: .4rem 0 0;
}
.menu {
padding: .4rem 2rem;
}
header ul {
border-bottom: 1px solid rgba(242, 242, 242, 1);
list-style-type: none;
margin: 0;
overflow: hidden;
padding: 0;
text-align: right;
}
header li {
display: inline-block;
}
header li a {
border-radius: 5px;
color: rgba(0, 0, 0, .5);
display: block;
height: 44px;
text-decoration: none;
}
header li.menu-item a {
border-radius: 5px;
margin: 5px 0;
height: 38px;
line-height: 36px;
padding: .4rem .65rem;
text-align: center;
}
header li.menu-item a:hover,
header li.menu-item a:focus {
background-color: rgba(221, 72, 20, .2);
color: rgba(221, 72, 20, 1);
}
header .logo {
float: left;
height: 44px;
padding: .4rem .5rem;
}
header .menu-toggle {
display: none;
float: right;
font-size: 2rem;
font-weight: bold;
}
header .menu-toggle button {
background-color: rgba(221, 72, 20, .6);
border: none;
border-radius: 3px;
color: rgba(255, 255, 255, 1);
cursor: pointer;
font: inherit;
font-size: 1.3rem;
height: 36px;
padding: 0;
margin: 11px 0;
overflow: visible;
width: 40px;
}
header .menu-toggle button:hover,
header .menu-toggle button:focus {
background-color: rgba(221, 72, 20, .8);
color: rgba(255, 255, 255, .8);
}
header .heroe {
margin: 0 auto;
max-width: 1100px;
padding: 1rem 1.75rem 1.75rem 1.75rem;
}
header .heroe h1 {
font-size: 2.5rem;
font-weight: 500;
}
header .heroe h2 {
font-size: 1.5rem;
font-weight: 300;
}
section {
margin: 0 auto;
max-width: 1100px;
padding: 2.5rem 1.75rem 3.5rem 1.75rem;
}
section h1 {
margin-bottom: 2.5rem;
}
section h2 {
font-size: 120%;
line-height: 2.5rem;
padding-top: 1.5rem;
}
section pre {
background-color: rgba(247, 248, 249, 1);
border: 1px solid rgba(242, 242, 242, 1);
display: block;
font-size: .9rem;
margin: 2rem 0;
padding: 1rem 1.5rem;
white-space: pre-wrap;
word-break: break-all;
}
section code {
display: block;
}
section a {
color: rgba(221, 72, 20, 1);
}
section svg {
margin-bottom: -5px;
margin-right: 5px;
width: 25px;
}
.further {
background-color: rgba(247, 248, 249, 1);
border-bottom: 1px solid rgba(242, 242, 242, 1);
border-top: 1px solid rgba(242, 242, 242, 1);
}
.further h2:first-of-type {
padding-top: 0;
}
footer {
background-color: rgba(221, 72, 20, .8);
text-align: center;
}
footer .environment {
color: rgba(255, 255, 255, 1);
padding: 2rem 1.75rem;
}
footer .copyrights {
background-color: rgba(62, 62, 62, 1);
color: rgba(200, 200, 200, 1);
padding: .25rem 1.75rem;
}
@media (max-width: 559px) {
header ul {
padding: 0;
}
header .menu-toggle {
padding: 0 1rem;
}
header .menu-item {
background-color: rgba(244, 245, 246, 1);
border-top: 1px solid rgba(242, 242, 242, 1);
margin: 0 15px;
width: calc(100% - 30px);
}
header .menu-toggle {
display: block;
}
header .hidden {
display: none;
}
header li.menu-item a {
background-color: rgba(221, 72, 20, .1);
}
header li.menu-item a:hover,
header li.menu-item a:focus {
background-color: rgba(221, 72, 20, .7);
color: rgba(255, 255, 255, .8);
}
}
</style>
</head>
<body>
<!-- HEADER: MENU + HEROE SECTION -->
<header>

<div class="menu">
<ul>
<li class="logo"><a href="https://codeigniter.com" target="_blank"><img height="44" title="CodeIgniter Logo"
alt="Visit CodeIgniter.com official website!"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAClCAMAAAC3K3MAAAACJVBMVEUAAADdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTdSBTd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Gincg0JiMX0X3NdcxZ446s4m10B9pIJvUBSU8dW6eed+RwhmxRpAU8aTcemv5HjHogsT0dCx9VtxZooDrSRmbmj15ZYLN6VBIHOKVjDxIR28LaGhaLd+/Yl0gM4JRv8wTZeoR1Mo5vIWGRwkDZCRvHZGWLfnztZIFsXXAnI/7PW4CjF+yiKA7WPvDre0tuBomQbYvF78Bj/vHPyFaA9RWbY09DzboqRkA1jzGytcES4wK6t2eXJVuDXNEVuKzG+SC+eVwnZFtYwrXx3C0+8cCWQL1uQtau6Fxe29TqJdsQlwIvWDoBmHU2jZyK2wKk/hcONUbl+mrw3NK2uSp/1QKYNQaeFla4PQC7Q3DkYeugL3XlYes0AmobzQ8NbssKOwONc65hqzXK4FCe9kWTSKbhluLCPvo24HEODhbcauinGpUbhSj/4fKnizLZBk1OjvPDONmSFEb/76EeOhVt4TmJbMMjQSwXgtGub92GyeVYyAm/jNy4DcvuMmw0Jnlv+7Z53yYWDw8bvN0yjLMFiWyzTWzYTssjtd0e/98eHAsAAAAADPK3nsWuagEAAAAAAAAAAAAAAABA2mzFN1m8MFwAAAAASUVORK5CYII="></a>
</li>
<li class="menu-toggle">
<button onclick="toggleMenu();">☰</button>
</li>
<li class="menu-item hidden"><a href="#">Home</a></li>
<li class="menu-item hidden"><a href="https://codeigniter4.github.io/userguide/" target="_blank">Docs</a>
</li>
<li class="menu-item hidden"><a href="https://forum.codeigniter.com/" target="_blank">Community</a></li>
<li class="menu-item hidden"><a
href="https://github.com/codeigniter4/CodeIgniter4/blob/master/CONTRIBUTING.md" target="_blank">Contribute</a>
</li>
</ul>
</div>

<div class="heroe">

<h1>Welcome to CodeIgniter <?= CodeIgniter\CodeIgniter::CI_VERSION ?></h1>

<h2>The small framework with powerful features</h2>

</div>

</header>

<!-- CONTENT -->

<section>

<h1>About this page</h1>

<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>

<p>If you would like to edit this page you will find it located at:</p>

<pre><code>app/Views/welcome_message.php</code></pre>

<p>The corresponding controller for this page can be found at:</p>

<pre><code>app/Controllers/Home.php</code></pre>

</section>

<div class="further">

<section>

<h1>Go further</h1>

<h2>
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><rect x='32' y='96' width='64' height='368' rx='16' ry='16' style='fill:none;stroke:#000;stroke-linejoin:round;stroke-width:32px'/><line x1='112' y1='224' x2='240' y2='224' style='fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px'/><line x1='112' y1='400' x2='240' y2='400' style='fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px'/><rect x='112' y='160' width='128' height='304' rx='16' ry='16' style='fill:none;stroke:#000;stroke-linejoin:round;stroke-width:32px'/><rect x='256' y='48' width='96' height='416' rx='16' ry='16' style='fill:none;stroke:#000;stroke-linejoin:round;stroke-width:32px'/><path d='M422.46,96.11l-40.4,4.25c-11.12,1.17-19.18,11.57-17.93,23.1l34.92,321.59c1.26,11.53,11.37,20,22.49,18.84l40.4-4.25c11.12-1.17,19.18-11.57,17.93-23.1L445,115C443.69,103.42,433.58,94.94,422.46,96.11Z' style='fill:none;stroke:#000;stroke-linejoin:round;stroke-width:32px'/></svg>
Learn
</h2>

<p>The User Guide contains an introduction, tutorial, a number of "how to"
guides, and then reference documentation for the components that make up
the framework. Check the <a href="https://codeigniter4.github.io/userguide"
target="_blank">User Guide</a> !</p>

<h2>
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M431,320.6c-1-3.6,1.2-8.6,3.3-12.2a33.68,33.68,0,0,1,2.1-3.1A162,162,0,0,0,464,215c.3-92.2-77.5-167-173.7-167C206.4,48,136.4,105.1,120,180.9a160.7,160.7,0,0,0-3.7,34.2c0,92.3,74.8,169.1,171,169.1,15.3,0,35.9-4.6,47.2-7.7s22.5-7.2,25.4-8.3a26.44,26.44,0,0,1,9.3-1.7,26,26,0,0,1,10.1,2L436,388.6a13.52,13.52,0,0,0,3.9,1,8,8,0,0,0,8-8,12.85,12.85,0,0,0-.5-2.7Z' style='fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px'/><path d='M66.46,232a146.23,146.23,0,0,0,6.39,152.67c2.31,3.49,3.61,6.19,3.21,8s-11.93,61.87-11.93,61.87a8,8,0,0,0,2.71,7.68A8.17,8.17,0,0,0,72,464a7.26,7.26,0,0,0,2.91-.6l56.21-22a15.7,15.7,0,0,1,12,.2c18.94,7.38,39.88,12,60.83,12A159.21,159.21,0,0,0,284,432.11' style='fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px'/></svg>
Discuss
</h2>

<p>CodeIgniter is a community-developed open source project, with several
venues for the community members to gather and exchange ideas. View all
the threads on <a href="https://forum.codeigniter.com/"
target="_blank">CodeIgniter's forum</a>, or <a href="https://codeigniterchat.slack.com/"
target="_blank">chat on Slack</a> !</p>

<h2>
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><line x1='176' y1='48' x2='336' y2='48' style='fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px'/><line x1='118' y1='304' x2='394' y2='304' style='fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px'/><path d='M208,48v93.48a64.09,64.09,0,0,1-9.88,34.18L73.21,373.49C48.4,412.78,76.63,464,123.08,464H388.92c46.45,0,74.68-51.22,49.87-90.51L313.87,175.66A64.09,64.09,0,0,1,304,141.48V48' style='fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px'/></svg>
Contribute
</h2>

<p>CodeIgniter is a community driven project and accepts contributions
of code and documentation from the community. Why not
<a href="https://codeigniter.com/en/contribute" target="_blank">
join us</a> ?</p>

</section>

</div>

<!-- FOOTER: DEBUG INFO + COPYRIGHTS -->

<footer>
<div class="environment">

<p>Page rendered in {elapsed_time} seconds</p>

<p>Environment: <?= ENVIRONMENT ?></p>

</div>

<div class="copyrights">

<p>&copy; <?= date('Y'?> CodeIgniter Foundation. CodeIgniter is open source project released under the MIT
open source licence.</p>

</div>

</footer>

<!-- SCRIPTS -->

<script>
function toggleMenu() {
var menuItems = document.getElementsByClassName('menu-item');
for (var i = 0; i < menuItems.length; i++) {
var menuItem = menuItems[i];
menuItem.classList.toggle("hidden");
}
}
</script>

<!-- -->

</body>
</html> 


2 - I changed the file index.php -> $_SERVER['CI_ENVIRONMENT'] = 'development';


PHP Code:
<?php DECLARE(STRICT_TYPES=1); ?>

<?php



// Valid PHP Version?

$minPHPVersion '7.2';

if (
phpversion() < $minPHPVersion)

{

die(
"Your PHP version must be {$minPHPVersion} or higher to run CodeIgniter. Current version: " phpversion());

}

unset(
$minPHPVersion);



// START NEW STUFF GOES HERE =========================================================

error_reporting(-1); // regardless



define('LOG_FILE',  '../writable/logs/log-' .date('Y-m-d') .'.php');

define('LOCALHOST''localhost'===$_SERVER['SERVER_NAME']);

if(
LOCALHOST) :

  define('CI_DEBUG',  FALSE); // bypass (bool) app/Config/oot/development.php

  ini_set('display_errors''1');



  $_SERVER['CI_ENVIRONMENT'] = 'production';  // bypass .env & .htaccess

  if(01):

    $_SERVER['CI_ENVIRONMENT'] = 'development'// bypass .env & .htaccess

  endif;  

  $useKint 
=  FALSE;



# CLEANER -  only shows last error logs and debugbar JSON files

  $ok = @unlink(LOG_FILE);

  $ok = @array_map('unlink'glob("../writable/debugbar/*.json"));

else:
  

  define
('CI_DEBUG'FALSE); // bypass (bool) app/Config/oot/prdouction.php

  ini_set('display_errors''1');

  # $_SERVER['CI_ENVIRONMENT'] = 'production'; // bypass .env & .htaccess

  $_SERVER['CI_ENVIRONMENT'] = 'development'// bypass .env & .htaccess

  $useKint FALSE;

endif;

// FINISH NEW STUFF GOES HERE =========================================================



// Path to the front controller (this file)

define('FCPATH'__DIR__ DIRECTORY_SEPARATOR);



// Location of the Paths config file.

// This is the line that might need to be changed, depending on your folder structure.

$pathsPath FCPATH '../../ci4/app/Config/Paths.php';

// ^^^ Change this if you move your application folder



/*

*---------------------------------------------------------------

* BOOTSTRAP THE APPLICATION

*---------------------------------------------------------------

* This process sets up the path constants, loads and registers

* our autoloader, along with Composer's, loads our constants

* and fires up an environment-specific bootstrapping.

*/



// Ensure the current directory is pointing to the front controller's directory

chdir(__DIR__);



// Load our paths config file

require $pathsPath;

$paths = new Config\Paths();



// Location of the framework bootstrap file.

$app = require rtrim($paths->systemDirectory'/ ') . '/bootstrap.php';



/*

*---------------------------------------------------------------

* LAUNCH THE APPLICATION

*---------------------------------------------------------------

* Now that everything is setup, it's time to actually fire

* up the engines and make this app do its thang.

*/
$app->run(); 

However nothing happens, the blank page continues.

https://test.inspex.com.br

However, I receive error logs in two locations

In directory /home/xxinsp/logs

Code:
[22-Apr-2020 13:27:45 America/Chicago] PHP Fatal error:  Uncaught ErrorException: Cannot modify header information - headers already sent by (output started at /home/xxinsp/ci4/app/Config/Events.php:27) in /home/xxinsp/ci4/system/Debug/Exceptions.php:161
Stack trace:
#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'Cannot modify h...', '/home/xxinsp/ci...', 161, Array)
#1 /home/xxinsp/ci4/system/Debug/Exceptions.php(161): header('HTTP/1.1 500 In...', true, 500)
#2 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException))
#3 {main}
  thrown in /home/xxinsp/ci4/system/Debug/Exceptions.php on line 161
[22-Apr-2020 13:27:45 America/Chicago] PHP Fatal error:  Uncaught ErrorException: Cannot modify header information - headers already sent by (output started at /home/xxinsp/ci4/app/Config/Events.php:27) in /home/xxinsp/ci4/system/Debug/Exceptions.php:161
Stack trace:
#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'Cannot modify h...', '/home/xxinsp/ci...', 161, Array)
#1 /home/xxinsp/ci4/system/Debug/Exceptions.php(161): header('HTTP/1.1 500 In...', true, 500)
#2 /home/xxinsp/ci4/system/Debug/Exceptions.php(222): CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException))
#3 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#4 {main}
  thrown in /home/xxinsp/ci4/system/Debug/Exceptions.php on line 161

In directory ci4/writable/logs

Code:
INFO - 2020-04-22 13:29:01 --> Controller "App\Controllers\Home" loaded.
CRITICAL - 2020-04-22 13:29:01 --> Undefined variable: bad_value
#0 /home/xxinsp/ci4/app/Views/welcome_message.php(1): CodeIgniter\Debug\Exceptions->errorHandler(8, 'Undefined varia...', '/home/xxinsp/ci...', 1, Array)
#1 /home/xxinsp/ci4/system/View/View.php(236): include('/home/xxinsp/ci...')
#2 /home/xxinsp/ci4/system/Common.php(1071): CodeIgniter\View\View->render('welcome_message', Array, true)
#3 /home/xxinsp/ci4/app/Controllers/Home.php(7): view('welcome_message')
#4 /home/xxinsp/ci4/system/CodeIgniter.php(910): App\Controllers\Home->index()
#5 /home/xxinsp/ci4/system/CodeIgniter.php(398): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Home))
#6 /home/xxinsp/ci4/system/CodeIgniter.php(306): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#7 /home/xxinsp/public_html/admin/index.php(73): CodeIgniter\CodeIgniter->run()
#8 {main}
CRITICAL - 2020-04-22 13:29:01 --> Uncaught ErrorException: Cannot modify header information - headers already sent by (output started at /home/xxinsp/ci4/app/Config/Events.php:27) in /home/xxinsp/ci4/system/Debug/Exceptions.php:161
Stack trace:
#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'Cannot modify h...', '/home/xxinsp/ci...', 161, Array)
#1 /home/xxinsp/ci4/system/Debug/Exceptions.php(161): header('HTTP/1.1 500 In...', true, 500)
#2 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException))
#3 {main}
  thrown
#0 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#1 {main}


Could it be some server configuration?
Reply
#19

Try putting the forced error at the end of the page - it will make a difference to the generated errors and they may be more understandable.
Code:
<?php echo $bad_value/$bad; ?>
</body>
</html>

Also examine the script just before the second critical error and see what was written that caused there error:
Code:
CRITICAL - 2020-04-22 13:29:01 --> Uncaught ErrorException: Cannot modify header information - headers already sent by (output started at /home/xxinsp/ci4/app/Config/Events.php:27) in /home/xxinsp/ci4/system/Debug/Exceptions.php:161
Stack trace:
#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'Cannot modify h...', '/home/xxinsp/ci...', 161, Array)
#1 /home/xxinsp/ci4/system/Debug/Exceptions.php(161): header('HTTP/1.1 500 In...', true, 500)
#2 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException))

Tentatively Tapped on a Tabket Sad
Reply
#20

I have exactly the same problem.

Everything is OK at localhost, but a blank page appears on the web server.

In the log file it says "Controller" App \ Controllers \ Home "loaded.".



I found that the problem is in the file "system / Events / Events.php" at line 188:



PHP Code:
result = static :: $ simulate === falsecall_user_func ($ listener, ... $ arguments): true




The script stops on that line and nothing else is executed after that line.


To be more precise, the problem is in the "call_user_func" function in the "Events.php" file after the Framework runs the "Events :: trigger ('pre_system');" at line 287 from "system / CodeIgniter.php".


This problem occurs in a "Development" and "Production" environment.

If you switch to the "Testing" environment, the "Welcome" page is loaded, but with the error at the top of the page:

"Warning: Use of undefined constant SUPPORTPATH - assumed 'SUPPORTPATH' (this will throw an Error in a future version of PHP) in /home/fineshape/ci4/system/Config/AutoloadConfig.php on line 99"



My localhost is with PHP "7.3.9" while on the web server it is with "7.3.4".



Considering the error "call_user_func" in line 188 of the file "Events.php" you could say that the error is in the PHP version, but why does this error not appear in the "Testing" environment?



I found where the error occurs but not the exact reason for the error to occur.



For the moment, I fixed the error by editing the "Events.php" file as follows:



Before:
PHP Code:
$result = static::$simulate === false call_user_func($listener, ...$arguments) : true


After:

PHP Code:
if($eventName == 'pre_system' && empty($arguments)){
  $result true;
}else{
  $result = static::$simulate === false call_user_func($listener, ...$arguments) : true;



If anyone knows what the exact error is, please share it here.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB