Differences between revisions 2 and 5 (spanning 3 versions)
Revision 2 as of 2007-10-08 15:53:59
Size: 738
Editor: guest-214
Comment:
Revision 5 as of 2007-10-09 12:40:44
Size: 869
Editor: guest-214
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
[The following seems to be not necessary, but if you have problems try this:
Line 5: Line 6:
Open the Windows services application (Apache's tray icon has 'open services' or Windows Systemsteuerung/Verwaltung/Dienste), click right on 'Apache2', choose 'Eigenschaften', 'Anmelden' tab and allow 'Datenaustausch zwischen Dienst und Desktop zulassen'. Open the Windows services application (Apache's tray icon has 'open services' or Windows Systemsteuerung/Verwaltung/Dienste), click right on 'Apache2', choose 'Eigenschaften', 'Anmelden' tab and allow 'Datenaustausch zwischen Dienst und Desktop zulassen'.]
Line 7: Line 8:
Here an easy example to open the text file 'test.txt' with the windows standard editor: Here an example to open the text file 'test.txt' with the windows standard editor and start Firefox browser:
Line 10: Line 11:
echo exec("start c:/temp/test.txt"); echo system("start c:/temp/test.txt");
echo exec("start firefox");

To start external programs from PHP you can use the system() or exec() function. Under Windows this works with the command line PHP (php-cli) without problems.

[The following seems to be not necessary, but if you have problems try this: To execute external programs with the Apache mod_php you have to configure the Apache service. Open the Windows services application (Apache's tray icon has 'open services' or Windows Systemsteuerung/Verwaltung/Dienste), click right on 'Apache2', choose 'Eigenschaften', 'Anmelden' tab and allow 'Datenaustausch zwischen Dienst und Desktop zulassen'.]

Here an example to open the text file 'test.txt' with the windows standard editor and start Firefox browser:

<?php
echo system("start c:/temp/test.txt");
echo exec("start firefox");
?>

Note the use of 'start' to prevent PHP to wait on end of execution.

CompleteSearch: completesearch/ModPhpStartetExe (last edited 2007-10-09 12:40:44 by guest-214)