Problem mit PHP Binary?!

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

Problem mit PHP Binary?!

Postby Hanno1 » 29. December 2006 22:10

Hallo,
ich bin nun schon seit längerem dabei das FUDforum lokal zu installieren. Hat auch soweit erstmal alles geklappt.

Zur NNTP Integration muss man nun aber folgendes als Cronjob ausführen:

G:/xampp/xampp/FUDforum/scripts/nntp.php 1


Wie das mit den geplanten Tasks etc. läuft weiß ich schon. Mir geht es primär darum dieses Script überhaupt auszuführen.

Die 1 ist außerdem kein Fehler, sondern wird wohl bei jedem Aufruf mit übergeben! Aus diesem Grund muss man laut Dokumentation auch PHP Binary nutzen.

Folgendermaßen habe ich schon versucht das Script auszuführen:
<?php
shell_exec(" php G:/xampp/xampp/FUDforum/scripts/nntp.php 1");
?>


popen("php G:/xampp/xampp/FUDforum/scripts/nntp.php 1","w");


Leider funktionierte nichts! Ich wäre für jeden Tipp sehr dankbar!

Viele Grüße
Hanno
Hanno1
 
Posts: 3
Joined: 29. December 2006 22:01

Postby Wiedmann » 29. December 2006 22:18

Folgendermaßen habe ich schon versucht das Script auszuführen:

Da willst du aber dieses Script seinerseits in einem PHP-Script aufrufen?

Wie das mit den geplanten Tasks etc. läuft weiß ich schon. Mir geht es primär darum dieses Script überhaupt auszuführen.

Das hört sich aber eher so an, dass du das Script als geplanter Task einrichten willst, bzw. in der Shell starten willst?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Hanno1 » 29. December 2006 22:21

Hallo,
das Script ist eigentlich dafür gedacht es mit einem Cronjob aufzurufen, um immer die neusten Beiträge zu laden.

Ich will es allerdings nur zum testen einmalig "von Hand" ausführen, wenn das einfacher ist, würde ich natürlich auch einen Geplanten tast einrichten!

Wichtig dabei ist, dass die "1" and den "PHP/Cli Parser" übergeben wird!

edit:
Ich poste einfach noch mal den Hinweis aus der Konfigurationsübersicht:

***Notes***
Exec Line parameter in the table above shows the execution line that you will need to place in your cron. It is recommended you run the script on a small interval, we recommend a 2-3 minute interval.
Cron example:

*/2 * * * * /home/forum/forum/scripts/nntp.php 1


Und etwas aus der Dokumentation:
On UNIX based systems it is best to execute the 'Exec Line' using a cron job, that would run every 2-3 minutes. On Windows 2000 and XP you can use task scheduler to accomplish the same thing.
Important

nntp.php is a PHP script, that requires you to have a PHP binary (cgi/cli). By default PHP binary can be found on /usr/local/bin/php, however on some distributions that may not be the case. If your PHP binary is not in /usr/local/bin/php, you will need to change the first line of the nntp.php script from

#!/usr/local/bin/php

to

#!/path/to/php/binary

Example 1.3. Sample Crontab for Newsgroups

The following is a sample crontab that will import messages from a newsgroup associated with rule #1 every 2 minutes.

*/2 * * * * /home/forum/forum/scripts/nntp.php 1

Hanno1
 
Posts: 3
Joined: 29. December 2006 22:01

Postby Wiedmann » 29. December 2006 22:35

Ich will es allerdings nur zum testen einmalig "von Hand" ausführen,

Und warum machst du das dann nicht? Wie gesagt, du versuchst es ja gerader innerhalb eines anderen Scriptes zu starten...

wenn das einfacher ist, würde ich natürlich auch einen Geplanten tast einrichten!

Das kommt auf das selbe heraus. Der Aufruf als geplanter Task ist der Selbe wie in der Shell:
Code: Select all
G:/xampp/xampp/php/php.exe G:/xampp/xampp/FUDforum/scripts/nntp.php 1

(Als geplanter Task würde sich da auch die "php-win.exe" anbieten)

Zum selber Nachlesen findest du das ganze hier:
Chapter 43. Using PHP from the command line
http://de.php.net/manual/en/features.commandline.php
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Hanno1 » 29. December 2006 23:09

Vielen Dank, es funktioniert jetzt alles!
Hanno1
 
Posts: 3
Joined: 29. December 2006 22:01


Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 41 guests