|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-03-30 06:47 UTC] miau dot jp at gmail dot com
Description:
------------
.php files can't executed by cscript.exe or by some other scripting hosts, for example, Sakura Editor.
Adding information below to the Windows Registory, PHPScript works fine.
***** Begin of PHPScript.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\PHPFile\ScriptEngine]
@="PHPScript"
***** End of PHPScript.reg
Another option is prepare a new file extension such as ".phps" to handle PHPScript.
In either case, is it possible for you to update PHPScript install process to set such information?
Reproduce code:
---------------
***** Begin of test.php
$WScript->Echo("Hello World!");
***** End of test.php
>cscript /nologo test.php
Expected result:
----------------
Hello World!
Actual result:
--------------
Input Error: There is no script engine for file extension ".php".
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 02:00:01 2025 UTC |
I wrote a patch to fix the issue. I formerly wrote a sample to associate extension ".php" with PHPScript, it is better to associate extension ".phps" with PHPScript since PHPScript needs no "<?php ... ?>" tags. Index: classfactory.cpp =================================================================== RCS file: /repository/pecl/activescript/classfactory.cpp,v retrieving revision 1.12 diff -u -r1.12 classfactory.cpp --- classfactory.cpp 28 Jul 2004 12:32:49 -0000 1.12 +++ classfactory.cpp 3 May 2009 16:24:30 -0000 @@ -154,6 +154,8 @@ { HKEY_CLASSES_ROOT, "PHPScript", NULL, "PHPScript" }, { HKEY_CLASSES_ROOT, "PHPScript\\CLSID", NULL, "[CLSID]"}, { HKEY_CLASSES_ROOT, "PHPScript\\OLEScript", NULL, NULL}, + { HKEY_CLASSES_ROOT, ".phps", NULL, "PHPFile" }, + { HKEY_CLASSES_ROOT, "PHPFile\\ScriptEngine", NULL, "PHPScript" }, { 0, NULL, NULL, NULL } };