php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58131 .php file can't be executed by cscript.exe
Submitted: 2008-03-30 06:47 UTC Modified: 2015-08-31 21:17 UTC
From: miau dot jp at gmail dot com Assigned:
Status: Suspended Package: PHPScript (PECL)
PHP Version: 5_2 CVS-2008-03-30 (dev) OS: Windows XP/Vista
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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".

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-03 13:09 UTC] miau dot jp at gmail dot com
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 }
 };
 [2015-08-31 21:17 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2015-08-31 21:17 UTC] cmb@php.net
Because ActiveScript/PHPScript is unmaintained since years, I'm
suspendeding this request.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Aug 21 08:01:26 2019 UTC