Making PHP parse php scripts named .asp as well?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
aalaap
-


Joined: 30 Mar 2004
Posts: 3

PostPosted: Tue Mar 30, 2004 6:35 pm    Post subject: Making PHP parse php scripts named .asp as well? Reply with quote

There's an app that is completely in ASP but i want to rewrite it using PHP but keeping the filenames same .. so there is no change required except for the backend. I tried adding "asp asa" to the list of extensions of the php parser (in addition to "php") but in IE i only get a "page cannot be displayed" and firefox says "no input file specified". For testing the test.asp file contains:

Code:
<? echo "hello"; ?>


How do I make it work?

For clarification: i dont want to run or use ASP - i want to write pure php but the filenames have to end in .asp for compatibility purposes.

- Aalaap
Back to top View user's profile Send private message
nquin321
-


Joined: 29 Jan 2004
Posts: 296
Location: Right Behind You

PostPosted: Tue Mar 30, 2004 7:56 pm    Post subject: Reply with quote

do this:

http://www.aprelium.com/abyssws/php.html

do this also

Enter asp in the Associated extensions, set Automatic Update of the CGI Paths (if available) to Yes, and press OK.
Back to top View user's profile Send private message
nquin321
-


Joined: 29 Jan 2004
Posts: 296
Location: Right Behind You

PostPosted: Tue Mar 30, 2004 7:57 pm    Post subject: Reply with quote

http://linux1.idg.dk/asp2php/

asp2php converter
Back to top View user's profile Send private message
aalaap
-


Joined: 30 Mar 2004
Posts: 3

PostPosted: Wed Mar 31, 2004 9:16 pm    Post subject: Reply with quote

Like I said in my earlier post, I already tried to make PHP handle asp and asa files but it doesnt take them. Technically it shouldn't matter since it doesnt really care about the extension anyway .. the web server does. Adding asp/asa to the extensions list does nothing.

ASP2PHP is not what I need. I've almost finished rewriting the ASP code (with enhancements, bug fixes) into PHP, but its the URLs that are important .. since there are other applications accessing these scripts using the .asp extensions, i have to keep the filenames .asp.

- Aalaap
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed Mar 31, 2004 9:17 pm    Post subject: Reply with quote

What is it exactly are you trying to do with
php files named .asp , PHP is for .php and
ASP is for .asp , thats just the way it is !
Back to top View user's profile Send private message Visit poster's website
aalaap
-


Joined: 30 Mar 2004
Posts: 3

PostPosted: Wed Mar 31, 2004 9:26 pm    Post subject: Reply with quote

If you go to c:\php and run php.exe without any parameters, it says No input file specified, which is the exact same error that Firefox shows me. From what I infer, Abyss is not passing the filename.asp parameter when it runs php after http://localhost/filename.asp is called.

Now that is funny, since it DOES call php (the no input file error is a php.exe error), but wihtout the script filename.

Part one:
URL called: http://localhost/test.php
Abyss takes it, figures out that the file is .php so php.exe should run it, so calls: c:\php\php.exe \htdocs\test.php
php runs the script, spits out the 200 header and the file contents. and everyone lives happily .. till the next try.

Part two:
URL called: http://localhost/test.asp
Abyss takes it, figures out that its an asp and the handler is also php.exe in the settings here so it calls: c:\php\php.exe
thats it .. no script filename .. php runs .. cant find any input file so says "No input file specified" and quits. Notice the absence of the 404 header. IE interprets it as a server error and says "page cannot be displayed" but Firefox .. just takes all the output regardless of the header absence and displays it.

Could this be a bug in Abyss?

- Aalaap
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed Mar 31, 2004 10:38 pm    Post subject: Reply with quote

ASP is a whole different language their is really no way to
make this work unless your a very good programmer in
PHP and ASP , I would just forget about it. LateR!
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Thu Apr 01, 2004 1:10 am    Post subject: Reply with quote

Like TRUSTpunk said earlier, why are you trying to do this?
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Apr 02, 2004 4:07 pm    Post subject: Reply with quote

aalaap,

PHP is a special case of CGI interpreters since it is better to pass the script name in the environment rather than passing it in the command line. Abyss takes care of this when the extension is php.

To solve the problem, you can use our PHP wrapper (available from http://www.aprelium.com/data/phpwrap.zip).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Fri Apr 02, 2004 11:55 pm    Post subject: Reply with quote

How many other programs do you have hidden in your data directory?
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sat Apr 03, 2004 12:18 am    Post subject: Reply with quote

I don't think thats any of your business lol :D
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Sat Apr 03, 2004 12:38 am    Post subject: Reply with quote

Yeah, that was meant as sort of a joke. I guess I'll have to start using emoticons so I can "set the mood" on my posts.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Apr 05, 2004 2:06 pm    Post subject: Reply with quote

iNaNimAtE wrote:
How many other programs do you have hidden in your data directory?

PHPWrap isn't hidden :D It was written as a workaround fot the CGI PHP bug that users faced when PHP 4.3.3 was released.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
j_browne
-


Joined: 26 Mar 2004
Posts: 13

PostPosted: Thu Apr 15, 2004 5:04 pm    Post subject: it worked! Reply with quote

aren't they clever?
now to find a use for this fix... :?
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group