InfoFrame: Digitaler Bilderrahmen (Anzeige von Anrufen, E-Mails, Termine, Wetter...)

laut meiner info.php habe ich

PHP Version 5.3.29
System Linux TS-221 3.4.6 #1 Mon Dec 29 00:40:42 CST 2014 armv5tel
...
Server API Apache 2.0 Handler
...

in der /etc/config/apache/apache.conf steht unter anderem

#ServerType standalone
ServerRoot "/usr/local/apache"
LockFile /var/lock/apache.lock
PidFile /var/lock/apache.pid
#ScoreBoardFile /usr/local/apache/logs/apache.scoreboard **aber selbst die datei gibts dort nicht
Timeout 300

nach ein bischen wildes klicken habe ich in /etc/config/apache/extra/apache-msv2.conf gefunden

PHP:
<IfModule alias_module>
	Alias /MSV2 "/mnt/ext/opt/MSV2"
	<Directory "/mnt/ext/opt/MSV2">
		AllowOverride All
		Order allow,deny
		Allow from all
		# Disable directory browsing
		Options All -Indexes
		# display no errs to user
		php_flag display_startup_errors off
		php_flag display_errors off
		php_flag html_errors off

		# log to file
		php_flag log_errors [B][COLOR="#FF0000"]on[/COLOR][/B]
		php_value memory_limit 128M
		php_flag output_buffering Off
	</Directory>
</IfModule>

ändere ich es manuell auf on und mache danach ein /etc/init.d/Qthttpd.sh restart, so wird der urzustand wieder hergestellt - also off
 
Hallo friday

in der /etc/config/apache/apache.conf steht unter anderem
#ScoreBoardFile /usr/local/apache/logs/apache.scoreboard **aber selbst die datei gibts dort nicht *** ist ja auch auskommentiert

füg doch mal ErrorLog /var/log/error.log hinzu und starte den apache neu. Mal sehn, was passiert.

ändere ich es manuell auf on und mache danach ein /etc/init.d/Qthttpd.sh restart, so wird der urzustand wieder hergestellt - also off
Das hier verstehe ich nicht. Welchen der offs hast Du auf on gestellt? Was ist der Urzustand?

Gruß...
 
diesen hier

PHP:
# log to file 
        php_flag log_errors [B][COLOR="#FF0000"]on[/COLOR][/B]

sollte eigentlich so aussehen

# log to file
php_flag log_errors on

leider gehen formatierungen nicht wenn ich php-code einfüge. egal wird ja beim apache restart sowieso überschrieben.

test:
nachdem ich #ScoreBoardFile aktiviert habe wird nach nem apache-restart auch eins angelegt. jedoch aber erst, nachdem ich im browser das 2. mal aufgerufen habe. Inhalt = øNUL NUL

hinzufügen von ErrorLog /var/log/error.log bringt keine error.log zum vorschein dort
 
Im Netz gefunden.
http://technedigitale.com/archives/407

also füg doch mal alle drei Zeile ans Ende deiner /etc/config/apache/apache.conf
Code:
CustomLog logs/main_log combined
ErrorLog logs/error_log
LogLevel info

Logs sollen dann unter /mnt/ext/opt/apache/logs/ zu finden sein.
 
genau die seite hatte ich heut mittag auch gefunden, aber wegen

Now, this own’t work on QNAP running QTS 4.1.x onwards, as people from QNAP thought it was working far too good, and decided to through a challenge. For some reason, Apache configuration files are reset every time Apache is restarted by Qnap startup scripts. So until I get a stable solution, the workaround is to manually restart Apache:

und ein /usr/local/apache/bin/apachectl restart ging bei mir nicht.

mit den 3 zeilen habe ich nun eine error_log


[PHP[Mon Feb 02 17:54:35 2015] [info] Init: Seeding PRNG with 512 bytes of entropy
[Mon Feb 02 17:54:35 2015] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Mon Feb 02 17:54:36 2015] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Mon Feb 02 17:54:36 2015] [info] Init: Generating temporary EC parameters (256 bits)
[Mon Feb 02 17:54:36 2015] [info] Init: Initializing (virtual) servers for SSL
[Mon Feb 02 17:54:36 2015] [info] mod_ssl/2.2.29 compiled against Server: Apache/2.2.29, Library: OpenSSL/1.0.1h
PHP Warning: Module 'SQLite' already loaded in Unknown on line 0
[Mon Feb 02 17:54:36 2015] [info] Init: Seeding PRNG with 512 bytes of entropy
[Mon Feb 02 17:54:36 2015] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Mon Feb 02 17:54:39 2015] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Mon Feb 02 17:54:39 2015] [info] Init: Generating temporary EC parameters (256 bits)
[Mon Feb 02 17:54:39 2015] [info] Shared memory session cache initialised
[Mon Feb 02 17:54:39 2015] [info] Init: Initializing (virtual) servers for SSL
[Mon Feb 02 17:54:39 2015] [info] mod_ssl/2.2.29 compiled against Server: Apache/2.2.29, Library: OpenSSL/1.0.1h
[Mon Feb 02 17:54:39 2015] [notice] Apache/2.2.29 (Unix) PHP/5.3.29 mod_ssl/2.2.29 OpenSSL/1.0.1j configured -- resuming normal operations
[Mon Feb 02 17:54:39 2015] [info] Server built: Dec 4 2014 00:25:20][/PHP]
 
na prima, dann lass Dein CalendarPlugin doch nochmal abstürzen und poste das Log.
 
das error_log wird nur beim apache start angelegt aber dann nicht weiter befüllt. steht also immer dasselbe drin.

und die erste Zeile von den 3 zinzugefügten in der apache.conf fehlt nach nem start auch -> CustomLog logs/main_log combined

die anderen beiden bleiben persistent

edit:

wenn ich der anleitung folge und mit Include /etc/config/apache/extra/apache-myconfig.conf dir 3 zeilen hinzufüge, dann wird noch eine main_log angelegt. dort steht aber nur

192.168.0.2 - - [02/Feb/2015:18:36:01 +0100] "GET / HTTP/1.1" 500 20 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.122 Safari/537.36 OPR/24.0.1558.64"
 
Zuletzt bearbeitet:
Hallo friday,

versuch mal folgendes. Speicher diese test.php in Dein Infoframeverzeichnis und führe sie direkt von der Console aus.
$php test.php

Den Pfad in Zeile 8 musst Du natürlich noch anpassen.

PHP:
<?php

error_reporting (E_ALL);
$config = parse_ini_file ("config.ini", true);
$sysconfig = $config['CalendarPlugin'];

// den Pfad musst Du Dir anpassen ------------------------------->
set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/google-api-php-client-master/');  
require_once 'autoload.php';

session_start();
$client_id = $sysconfig['client_id'];
$service_account_name = $sysconfig['account_name'];

try {
    $client = new Google_Client();
    $client->setApplicationName($sysconfig['project_name']);
    $service = new Google_Service_Calendar($client);
}
catch (Exception $e) {
    die ('Folgender Fehler trat auf: ' . $e->getMessage());
}

if (isset($_SESSION['service_token']))
    $client->setAccessToken($_SESSION['service_token']);

$key = file_get_contents($sysconfig['key_file']);
$cred = new Google_Auth_AssertionCredentials(
    $service_account_name,
    array('https://www.googleapis.com/auth/calendar'),
    $key);

$client->setAssertionCredentials($cred);
if ($client->getAuth()->isAccessTokenExpired())
    $client->getAuth()->refreshTokenWithAssertion($cred);
	
$_SESSION['service_token'] = $client->getAccessToken();
	
//set startDate, endDate, eventParams
$now = new DateTime('NOW');
$clone = clone $now;
$clone = date_modify($clone, '+1 month');
$startDate = date_format($now, DateTime::W3C);
$endDate = date_format($clone, DateTime::W3C);
	
$eventParams = array(
    'timeMin' => $startDate,
    'timeMax' => $endDate,
    'singleEvents' => 'true');
							
//get Calendar Ids	
$calendarList = $service->calendarList->listCalendarList();
	
while(TRUE) {
    /***************** Loop through each Calendar, get id, and color **************************/
    foreach ($calendarList->getItems() as $calendarListEntry) {
		$calendarID = $calendarListEntry->getID();
		$color = $calendarListEntry->getBackgroundColor();
	 
		/***************** Get SysncToken to skip this calender at next update if nothing has changed **********/ 
		$events = $service->events->listEvents($calendarID, $eventParams);	    
		//If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken
		try{	
			$NextSyncToken = $events->getNextSyncToken();
		}
		catch (Exception $e) {
			if (strripos($e->getMessage(), "410") !== FALSE){
				$NextSyncToken = 'FEHLER';
			}else{
				die ('Folgender Fehler trat auf: ' . $e->getMessage());
			}
		} 
		$SyncToken = '';
		$insertToken .= "('".$calendarID."','".$NextSyncToken."'), ";	
		if ($NextSyncToken != $SyncToken) {
			$i++;
			$deleteCalendarData .= "color = '".$color."' OR ";	    	
			while(TRUE) {
				foreach ($events->getItems() as $event) {
					if (!empty($event['modelData']['start']['dateTime'])) {
						$begin = date_format(date_create($event['modelData']['start']['dateTime']), 'Y-m-d H:i:s');
						$end = date_format(date_create($event['modelData']['end']['dateTime']), 'Y-m-d H:i:s');
					}else{
						$begin = $event['modelData']['start']['date'];
						$end = $event['modelData']['end']['date'];
					}			  	
					$title = $event->getSummary();	
					echo $color." - ".$begin." - ".$end." - ".$title. "\n";	
				}
				$pageToken = $events->getNextPageToken();
				if ($pageToken) {
					$optParams = array('pageToken' => $pageToken);
					$events = $service->events->listEvents($calendarListEntry->getID(), $optParams);
				}else{
					break;
				}
			}
		} /********** if SysncToken changed perform update END  **********/
	} /*********** Loop through each Calendar, get id, and color END *************************/
	$pageToken = $calendarList->getNextPageToken();
    if ($pageToken) {
        $optParams = array('pageToken' => $pageToken);
		$calendarList = $service->calendarList->listCalendarList($optParams);
    }else{
		break;
    }
}
 
ich denke die datei muß dort sein, wo auch die anderen plugins sind (also calendar, wetter, benzin)

aber beim ausführen kommt


[admin@TS-221 ~]# cd /share/MD0_DATA/Web/plugins
[admin@TS-221 plugins]# $php test.php
-sh: test.php: command not found
 
Hallo friday,
diese Testdatei kommt dorthin, wo auch infoframe.php liegt. Dann:
cd /var/www oder wo bei Dir infoframe.php liegt.
php test.php auf der Konsole
Bei dieser Gelegenheit habe ich herausgefunden, dass google-api-php-client-master nach /tmp/Google_Client schreiben will. Diesem Verzeichnis habe ich dann 777 zugebilligt.
Jetzt gibt es nur noch 2 Warnungen, aber es geht immer noch nicht.
 
Zuletzt bearbeitet:
jono, ich habe ein anderes system als du. ich lasse das auf meinem Qnap-server laufen. bei mir gibts keine infoframe.php
 
Hallo friday,

so unterschiedlich ist Dein System nicht. Auf den Qnap läuft Linux, mit Apache, MySQL und PHP. Nichts anderes läuft auf unseren Systemen. Die index.php ist halt nur in infoframe.php umbenannt.
Was Dir Dein System aber übel nimmt, ist, wenn du bei $php test.php das $ mit eingibst :) (das "$" ist der Command Prompt, das wird häufig mit angegeben um zu veranschaulichen, dass wir uns auf der Console befinden). Das hättest Du aber spätestens bei der Fehlermeldung -sh: test.php: command not found merken sollen.

EDIT: Achso, jono hatte es zwar schon erwähnt, die Testdatei kommt ins Infoframe Hauptverzeichnis. Da, wo Deine index.php liegt, sonst findet er die config.ini nicht.

Gruß, Michael...
 
Zuletzt bearbeitet:
ja sorry, bin leider nicht versiert mit Linux. bei mir ist es die #
aber selbst ohne gehts nicht. angemeldet bin ich als admin

[admin@TS-221 ~]# cd /share/MD0_DATA/Web
[admin@TS-221 Web]# php test.php
-sh: php: command not found
 
beim aufruf vom browser kommt ne weisse seite, aber in der error_log jetzt 1 Eintrag mehr

[Tue Feb 03 16:05:35 2015] [error] [client 192.168.0.2] File does not exist: /share/Web/favicon.ico
 
führ mal das aus

PHP:
<?php
$alive=0;

error_reporting(E_ALL | E_STRICT);

$config = parse_ini_file ("config.ini", true);
$sysconfig = $config['CalendarPlugin'];

echo "ich lebe noch " . ++$alive . "<br>";

// den Pfad musst Du Dir anpassen ------------------------------->
set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/google-api-php-client-master/');  
require_once 'autoload.php';

echo "ich lebe noch " . ++$alive . "<br>";

session_start();
$client_id = $sysconfig['client_id'];
$service_account_name = $sysconfig['account_name'];

echo "ich lebe noch " . ++$alive . "<br>";

try {
    $client = new Google_Client();
    $client->setApplicationName($sysconfig['project_name']);
    $service = new Google_Service_Calendar($client);
}
catch (Exception $e) {
    die ('Folgender Fehler trat auf: ' . $e->getMessage());
}

echo "ich lebe noch " . ++$alive . "<br>";

if (isset($_SESSION['service_token']))
    $client->setAccessToken($_SESSION['service_token']);

$key = file_get_contents($sysconfig['key_file']);
$cred = new Google_Auth_AssertionCredentials(
    $service_account_name,
    array('https://www.googleapis.com/auth/calendar'),
    $key);

echo "ich lebe noch " . ++$alive . "<br>";

$client->setAssertionCredentials($cred);
if ($client->getAuth()->isAccessTokenExpired())
    $client->getAuth()->refreshTokenWithAssertion($cred);
	
$_SESSION['service_token'] = $client->getAccessToken();

echo "ich lebe noch " . ++$alive . "<br>";
	
//set startDate, endDate, eventParams
$now = new DateTime('NOW');
$clone = clone $now;
$clone = date_modify($clone, '+1 month');
$startDate = date_format($now, DateTime::W3C);
$endDate = date_format($clone, DateTime::W3C);
	
$eventParams = array(
    'timeMin' => $startDate,
    'timeMax' => $endDate,
    'singleEvents' => 'true');
							
//get Calendar Id�s	
$calendarList = $service->calendarList->listCalendarList();

echo "ich lebe noch " . ++$alive . "<br>";
	
while(TRUE) {
    /***************** Loop through each Calendar, get id, and color **************************/
    foreach ($calendarList->getItems() as $calendarListEntry) {
		$calendarID = $calendarListEntry->getID();
		$color = $calendarListEntry->getBackgroundColor();
	 
		/***************** Get SysncToken to skip this calender at next update if nothing has changed **********/ 
		$events = $service->events->listEvents($calendarID, $eventParams);	    
		//If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken
		try{	
			$NextSyncToken = $events->getNextSyncToken();
		}
		catch (Exception $e) {
			if (strripos($e->getMessage(), "410") !== FALSE){
				$NextSyncToken = 'FEHLER';
			}else{
				die ('Folgender Fehler trat auf: ' . $e->getMessage());
			}
		} 
		$SyncToken = '';
		$insertToken .= "('".$calendarID."','".$NextSyncToken."'), ";	
		if ($NextSyncToken != $SyncToken) {
			$i++;
			$deleteCalendarData .= "color = '".$color."' OR ";	    	
			while(TRUE) {
				foreach ($events->getItems() as $event) {
					if (!empty($event['modelData']['start']['dateTime'])) {
						$begin = date_format(date_create($event['modelData']['start']['dateTime']), 'Y-m-d H:i:s');
						$end = date_format(date_create($event['modelData']['end']['dateTime']), 'Y-m-d H:i:s');
					}else{
						$begin = $event['modelData']['start']['date'];
						$end = $event['modelData']['end']['date'];
					}			  	
					$title = $event->getSummary();	
					echo $color." - ".$begin." - ".$end." - ".$title. "<br>";	
				}
				$pageToken = $events->getNextPageToken();
				if ($pageToken) {
					$optParams = array('pageToken' => $pageToken);
					$events = $service->events->listEvents($calendarListEntry->getID(), $optParams);
				}else{
					break;
				}
			}
		} /********** if SysncToken changed perform update END  **********/
	} /*********** Loop through each Calendar, get id, and color END *************************/
	$pageToken = $calendarList->getNextPageToken();
    if ($pageToken) {
        $optParams = array('pageToken' => $pageToken);
		$calendarList = $service->calendarList->listCalendarList($optParams);
    }else{
		break;
    }
}
 
in test2 vergessen, sorry. jetzt lebt er bis 7
 
und nun hier die

PHP:
<?php
error_reporting(E_ALL | E_STRICT);

$config = parse_ini_file ("config.ini", true);
$sysconfig = $config['CalendarPlugin'];

// den Pfad musst Du Dir anpassen ------------------------------->
set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/google-api-php-client-master/');  
require_once 'autoload.php';

session_start();
$client_id = $sysconfig['client_id'];
$service_account_name = $sysconfig['account_name'];

try {
    $client = new Google_Client();
    $client->setApplicationName($sysconfig['project_name']);
    $service = new Google_Service_Calendar($client);
}
catch (Exception $e) {
    die ('Folgender Fehler trat auf: ' . $e->getMessage());
}

if (isset($_SESSION['service_token']))
    $client->setAccessToken($_SESSION['service_token']);

$key = file_get_contents($sysconfig['key_file']);
$cred = new Google_Auth_AssertionCredentials(
    $service_account_name,
    array('https://www.googleapis.com/auth/calendar'),
    $key);

$client->setAssertionCredentials($cred);
if ($client->getAuth()->isAccessTokenExpired())
    $client->getAuth()->refreshTokenWithAssertion($cred);
	
$_SESSION['service_token'] = $client->getAccessToken();
	
//set startDate, endDate, eventParams
$now = new DateTime('NOW');
$clone = clone $now;
$clone = date_modify($clone, '+1 year');
$startDate = date_format($now, DateTime::W3C);
$endDate = date_format($clone, DateTime::W3C);
	
$eventParams = array(
    'timeMin' => $startDate,
    'timeMax' => $endDate,
    'singleEvents' => 'true');
							
//get Calendar Id�s	
$calendarList = $service->calendarList->listCalendarList();
	
while(TRUE) {
    /***************** Loop through each Calendar, get id, and color **************************/
    foreach ($calendarList->getItems() as $calendarListEntry) {

		$calendarID = $calendarListEntry->getID();
		
		echo $calendarListEntry->getsummary() . "<br><br>";
		
		$color = $calendarListEntry->getBackgroundColor();
		
		/***************** Get SysncToken to skip this calender at next update if nothing has changed **********/ 
		$events = $service->events->listEvents($calendarID, $eventParams);	    
		
		//If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken
		try{	
			$NextSyncToken = $events->getNextSyncToken();
		}
		catch (Exception $e) {
			if (strripos($e->getMessage(), "410") !== FALSE){
				$NextSyncToken = 'FEHLER';
			}else{
				echo "hier bin ich gestorben";
				die ('Folgender Fehler trat auf: ' . $e->getMessage());
			}
		} 
		$SyncToken = '';
		$insertToken .= "('".$calendarID."','".$NextSyncToken."'), ";	
		if ($NextSyncToken != $SyncToken) {
			$i++;
			$deleteCalendarData .= "color = '".$color."' OR ";	    	
			while(TRUE) {
				foreach ($events->getItems() as $event) {
					if (!empty($event['modelData']['start']['dateTime'])) {
						$begin = date_format(date_create($event['modelData']['start']['dateTime']), 'Y-m-d H:i:s');
						$end = date_format(date_create($event['modelData']['end']['dateTime']), 'Y-m-d H:i:s');
					}else{
						$begin = $event['modelData']['start']['date'];
						$end = $event['modelData']['end']['date'];
					}			  	
					$title = $event->getSummary();	
					echo $color." - ".$begin." - ".$end." - ".$title. "<br>";	
				}
				$pageToken = $events->getNextPageToken();
				if ($pageToken) {
					$optParams = array('pageToken' => $pageToken);
					$events = $service->events->listEvents($calendarListEntry->getID(), $optParams);
				}else{
					break;
				}
			}
		} /********** if SysncToken changed perform update END  **********/
	} /*********** Loop through each Calendar, get id, and color END *************************/
	$pageToken = $calendarList->getNextPageToken();
    if ($pageToken) {
        $optParams = array('pageToken' => $pageToken);
		$calendarList = $service->calendarList->listCalendarList($optParams);
    }else{
		break;
    }
}
echo "ich bin komplett durch<br>";
 

Neueste Beiträge

Statistik des Forums

Themen
244,880
Beiträge
2,220,047
Mitglieder
371,605
Neuestes Mitglied
michaelwarwel
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.

IPPF im Überblick

Neueste Beiträge