With reference to the CodeIgniter Blank Page question I asked previously.
Some new information has come to light that might shed some light on the problem.
My newly built server (CI 2.1.3 - latest release) where this was working correctly and not giving the WSOD is on a sub-domain of my development server. The WSOD issue is STILL occurring on the "live" site which is not in a sub-domain.
Obviously the "live" site is in public_html and the development version is in the "codeigniter" subdomain. Everything else is identical on both servers. Same PHP 5.3 setup. Same .htaccess file. Same CI 2.1.3 setup, obviously with config changed to point to the sub-domain in "development" and the domain in "live".
The issues are the same. On ENTER PRESS or external link ACTIVATION (such as from an email) I get WSOD in "live" but this works correctly in "development". Every controller that is activated without a button click in "live" gives me WSOD, while ALL the pages work correctly in "development".
As a check, I built a completely fresh CI root install (no sub-domain) and the problem mirrors exactly what is going on in "live".
The processes that are exhibiting the WSOD behaviour do not have views attached but simply print out a message on success.
Here is the code:
.htaccess - in the sub-domain folder of "development" and public_html of "live":
Options -Indexes
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
ErrorDocument 404 /index.php
One of the controllers giving the WSOD in "live" when pasting into browser after logging in, but is working in "development" is inviteusers.php simply takes a Company ID and User ID and sends the user a link with login details for the new account. Some extraneous code in the "message" body has been removed to shorten it:
<?php if ( ! defined('BASEPATH')) exit('No Direct Script Access Allowed');
/**
* Invite Users Controller
*
* ----------------------------------------------------------------------------
*/
class InviteUsers extends MY_Controller
{
function __construct()
{
parent::__construct();
$this->load->model('UserDetails_model');
$this->load->helper('date');
}
public function index()
{
if (!$this->session->userdata('clientid') && !$this->session->userdata('userid')) {
redirect('login');
}
// Add Client ID for All Uninvited Users for a Client
$lookupid['clientid'] = "CID";
// Add User ID to Add ONE Uninvited user for a Client
// Change UserDetails_model to take UID if this option is used
$lookupid['userid'] = "UID";
$invites = $this->UserDetails_model->getInvites($lookupid);
foreach ($invites as $invite) {
if ($invite['new'] == "Y") {
$message = "Hi ".$invite['username']." ".$invite['usersurname'].", \n \n";
$this->load->helper('email');
$this->email->set_newline("\r\n");
$this->email->from('email@address.com', 'System Messenger');
$this->email->to($invite['useremail']);
$this->email->bcc('admin@address.com');
$this->email->subject('Temporary Login Details');
$this->email->message($message);
$sent = $this->email->send();
if ($sent) {
echo "SUCCESS!!! ";
echo "NAME: ".$invite['username']." ".$invite['usersurname']." ";
echo "E-MAIL: ".$invite['useremail']." ";
echo "PASSWORD: ".$invite['temppass']." ";
echo "NEW: ".$invite['new']."";
}
} else {
$message = "Hi ".$invite['username']." ".$invite['usersurname'].", \n \n";
$this->load->helper('email');
$this->email->set_newline("\r\n");
$this->email->from('email@address.com', 'System Messenger');
$this->email->to($invite['useremail']);
$this->email->bcc('admin@address.com');
$this->email->subject('Temporary Login Details');
$this->email->message($message);
$sent = $this->email->send();
if ($sent) {
echo "SUCCESS!!! ";
echo "NAME: ".$invite['username']." ".$invite['usersurname']." ";
echo "E-MAIL: ".$invite['useremail']." ";
echo "PASSWORD: ".$invite['temppass']." ";
echo "NEW: ".$invite['new']." ";
}
}
}
}
}
/*
* End of file inviteusers.php
* Location: ./application/controllers/inviteusers.php
*/
As I said before - THIS PROCESS IS WORKING IN DEVELOPMENT but gives WSOD in LIVE.
MY_Controller simply performs the session lookups and checks some variables. It is simple and solid and has been working without mods since forever.
I think there may be a BIG CLUE in the fact that it works correctly in a recently set up sub-domain with the SAME .htaccess file and config changed to reflect the URL. All other environment variables are EXACTLY IDENTICAL. Same server, same hosting company, same Apache version running the same modules, same PHP version with the same modules, timeouts, memory etc. set.
The controllers giving the WSOD provide me with quick and easy access to certain admin functions so they must work... And they do... In a "development" sub-domain on an identical server to "live" which runs in public_html.