On CentOS v7 the PostgreSQL server is started with `systemd`.
Check if `/usr/lib/systemd/system/httpd.service` contains a line `PrivateTmp=true`.
If so then Apache cannot see the `/tmp/.s.PGSQL.5432` file. It's a good security feature,
-so use the [[#PostgreSQL_UNIX_Socket_Location_on_CentOS|preferred solution]]
+so use the [preferred solution](../appendix/Install-on-Centos-7/#adding-selinux-security-settings).
However, you can solve this the quick and dirty way by commenting out that line and then run
fail("pgsql returned with error code ($iReturn)");
}
}
+
+
+function runWithEnv($cmd, $env)
+{
+ $fds = array(0 => array('pipe', 'r'),
+ 1 => STDOUT,
+ 2 => STDERR);
+ $pipes = null;
+ $proc = @proc_open($cmd, $fds, $pipes, null, $env);
+ if (!is_resource($proc)) {
+ fail('unable to run command:' . $cmd);
+ }
+
+ fclose($pipes[0]); // no stdin
+
+ $stat = proc_close($proc);
+ return $stat;
+}
passthru($cmd, $result);
}
-function runWithEnv($cmd, $env)
-{
- $fds = array(0 => array('pipe', 'r'),
- 1 => STDOUT,
- 2 => STDERR);
- $pipes = null;
- $proc = @proc_open($cmd, $fds, $pipes, null, $env);
- if (!is_resource($proc)) {
- fail('unable to run command:' . $cmd);
- }
-
- fclose($pipes[0]); // no stdin
-
- $stat = proc_close($proc);
- return $stat;
-}
-
function replace_tablespace($sTemplate, $sTablespace, $sSql)
{
if ($sTablespace) {
}
pg_query($oDB->connection, 'TRUNCATE import_status');
- $sSQL = 'INSERT INTO import_status (lastimportdate, sequence_id, indexed) VALUES(';
- $sSQL .= "'".$sDatabaseDate."',".$aOutput[0].', true)';
+ $sSQL = "INSERT INTO import_status (lastimportdate, sequence_id, indexed) VALUES('";
+ $sSQL .= $sDatabaseDate."',".$aOutput[0].', true)';
if (!pg_query($oDB->connection, $sSQL)) {
fail('Could not enter sequence into database.');
}
$oDB->query($sSQL);
echo date('Y-m-d H:i:s')." Completed index step for $sBatchEnd in ".round((time()-$fCMDStartTime)/60, 2)." minutes\n";
- $sSQL = 'UPDATE import_status SET indexed = true';
+ $sSQL = 'update import_status set indexed = true';
$oDB->query($sSQL);
}
if (!$aResult['import-osmosis-all']) exit(0);
}
}
-
-function runWithEnv($cmd, $env)
-{
- $fds = array(0 => array('pipe', 'r'),
- 1 => STDOUT,
- 2 => STDERR);
- $pipes = null;
- $proc = @proc_open($cmd, $fds, $pipes, null, $env);
- if (!is_resource($proc)) {
- fail('unable to run command:' . $cmd);
- }
-
- fclose($pipes[0]); // no stdin
-
- $stat = proc_close($proc);
- return $stat;
-}