aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-25 15:33:32 -0800
committerFriendika <info@friendika.com>2010-11-25 15:33:32 -0800
commit9fb967ae347909c8dc582b80e31972defc35eb82 (patch)
tree7e6b2cbb637db375423981e3b73b52e5ae3ec466
parent0a03a710b326dc6c21ade1d769348e67100457c6 (diff)
downloadvolse-hubzilla-9fb967ae347909c8dc582b80e31972defc35eb82.tar.gz
volse-hubzilla-9fb967ae347909c8dc582b80e31972defc35eb82.tar.bz2
volse-hubzilla-9fb967ae347909c8dc582b80e31972defc35eb82.zip
more pre-install checks to sort out broken environments
-rw-r--r--mod/install.php39
-rw-r--r--testargs.php6
2 files changed, 43 insertions, 2 deletions
diff --git a/mod/install.php b/mod/install.php
index cbe3b2fc9..21a1b7513 100644
--- a/mod/install.php
+++ b/mod/install.php
@@ -95,6 +95,9 @@ function install_content(&$a) {
$o .= check_php($phpath);
+ $o .= check_keys();
+
+
require_once('datetime.php');
$tpl = load_view_file('view/install_db.tpl');
@@ -115,12 +118,44 @@ function check_php(&$phpath) {
$o = '';
$phpath = trim(shell_exec('which php'));
if(! strlen($phpath)) {
- $o .= t('Could not find a command line version of PHP in the web server PATH.');
- $o .= t('This is required. Please adjust the configuration file .htconfig.php accordingly.');
+ $o .= t('Could not find a command line version of PHP in the web server PATH.') . EOL;
+ $o .= t('This is required. Please adjust the configuration file .htconfig.php accordingly.') . EOL;
+ }
+ if(strlen($phpath)) {
+ $str = autoname(8);
+ $cmd = "$phpath testargs.php $str";
+ $result = trim(shell_exec($cmd));
+ if($result != $str) {
+ $o .= t('The command line version of PHP on your system does not have "register_argc_argv" enabled.') . EOL;
+ $o .= t('This is required for message delivery to work.') . EOL;
+ }
}
return $o;
+
}
+function check_keys() {
+
+ $o = '';
+
+ $res = false;
+
+ if(function_exists('openssl_pkey_new'))
+ $res=openssl_pkey_new(array(
+ 'digest_alg' => 'sha1',
+ 'private_key_bits' => 4096,
+ 'encrypt_key' => false ));
+
+ // Get private key
+
+ if(! $res)
+ $o .= t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . EOL;
+
+ return $o;
+
+}
+
+
function check_funcs() {
if((function_exists('apache_get_modules')) && (! in_array('mod_rewrite',apache_get_modules())))
notice( t('Error: Apache webserver mod-rewrite module is required but not installed.') . EOL);
diff --git a/testargs.php b/testargs.php
new file mode 100644
index 000000000..65e56ec3e
--- /dev/null
+++ b/testargs.php
@@ -0,0 +1,6 @@
+<?php
+
+if(($argc > 1) && isset($argv[1]))
+ echo $argv[1];
+else
+ echo '';