INSTALL for dummies - step 1: ensure that we throw an ugly error message in their face

if there's an ugly error when we first try to install. DON'T white screen until after
they've got it running.
This commit is contained in:
friendica 2013-11-05 19:45:02 -08:00
parent 5c71ccba98
commit 310ccfda99
3 changed files with 41 additions and 0 deletions

View File

@ -71,3 +71,14 @@ $a->config['system']['php_path'] = 'php';
$a->config['system']['directory_mode'] = DIRECTORY_MODE_NORMAL; $a->config['system']['directory_mode'] = DIRECTORY_MODE_NORMAL;
// PHP error logging setup
// Before doing this ensure that the webserver has permission
// to create and write to php.out in the top level Red directory,
// or change the name (below) to a file/path where this is allowed.
// Uncomment the following 4 lines to turn on PHP error logging.
//error_reporting(E_ERROR | E_WARNING | E_PARSE );
//ini_set('error_log','php.out');
//ini_set('log_errors','1');
//ini_set('display_errors', '0');

View File

@ -5,6 +5,24 @@ $install_wizard_pass=1;
function setup_init(&$a){ function setup_init(&$a){
// Ensure that if somebody hasn't read the install documentation and doesn't have all
// the required modules or has a totally borked shared hosting provider and they can't
// figure out what the hell is going on - that we at least spit out an error message which
// we can inquire about when they write to tell us that our software doesn't work.
// The worst thing we can do at this point is throw a white screen of death and rely on
// them knowing about servers and php modules and logfiles enough so that we can guess
// at the source of the problem. As ugly as it may be, we need to throw a technically worded
// PHP error message in their face. Once installation is complete application errors will
// throw a white screen because these error messages divulge information which can
// potentially be useful to hackers.
error_reporting(E_ERROR | E_WARNING | E_PARSE );
ini_set('log_errors','0');
ini_set('display_errors', '1');
// $baseurl/setup/testrwrite to test if rewite in .htaccess is working // $baseurl/setup/testrwrite to test if rewite in .htaccess is working
if (argc() ==2 && argv(1)=="testrewrite") { if (argc() ==2 && argv(1)=="testrewrite") {
echo "ok"; echo "ok";
@ -14,6 +32,7 @@ function setup_init(&$a){
if (x($_POST,'pass')) if (x($_POST,'pass'))
$install_wizard_pass = intval($_POST['pass']); $install_wizard_pass = intval($_POST['pass']);
} }
function setup_post(&$a) { function setup_post(&$a) {

View File

@ -88,3 +88,14 @@ $a->config['system']['directory_mode'] = DIRECTORY_MODE_NORMAL;
$a->config['system']['theme'] = 'redbasic'; $a->config['system']['theme'] = 'redbasic';
// PHP error logging setup
// Before doing this ensure that the webserver has permission
// to create and write to php.out in the top level Red directory,
// or change the name (below) to a file/path where this is allowed.
// Uncomment the following 4 lines to turn on PHP error logging.
//error_reporting(E_ERROR | E_WARNING | E_PARSE );
//ini_set('error_log','php.out');
//ini_set('log_errors','1');
//ini_set('display_errors', '0');